Information Technology Reference
In-Depth Information
;;
'stop')
su vboxuser -c 'VBoxManage controlvm "Windows XP"
acpipowerbutton' >> /var/tmp/vboxguest.log 2>&1
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
There are a few things to note about this script. First, it is very basic and could
use several improvements, such as checking whether the guest machine is already
running before trying to start it. VirtualBox permits only one copy of a machine
to run at any time, however, so this change would be more cosmetic than func-
tional. Second, the stop method performs a safe shutdown of the guest using the
ACPI power button signal. Another choice of a hard stop might seem like an im-
provement, but because the Container is running only a single application, this
can be accomplished by just shutting down the Container. Third, for monitoring
purposes, all command output is logged in /var/tmp/vboxguest.log . Only the
guest start and stop commands are logged, so this file should not grow excessively
large over time.
8.5.7 Cloning the Windows Container
Now that we have gone through all of the configuration steps to get our Windows
XP desktop in a Container, what about adding a second or third desktop? Because
all of the configuration data, including the guest disk images, is stored in the
Container, all we must do is clone the Container and voila!—we have a second
desktop exactly like the first. Because we carefully planned to keep all of the nec-
essary data in ZFS, cloning a desktop in this way is easy and fast.
As described in Chapter 6, a cloned Container starts with a configuration. In
this case we will use our existing Container, winxp-desktop1 , as a template.
We can simply change the location of the zonepath and IP address of the new
Container. The following command sequence does just that. The source Container,
winxp-desktop1 , must be halted before running these commands.
 
 
Search WWH ::




Custom Search