How To Run Fully-Virtualized Guests (HVM) With Xen 3.2 On Debian Lenny (x86_64) - Page 2
Most installers require you to reboot at the end of the installation and remove the installation media; this is not possible if you have specified an ISO image in the guest configuration file, and even if you use a CD - the reboot of the guest happens so fast that you cannot remove the CD before the guest boots again. This means the guest will boot from the CD or ISO file and start the installer again.
If that happens, stop the guest...
xm destroy xen1.example.com
... and edit the guest configuration file:
Remove the CD drive from the boot line...
[...] boot="c" [...]
... and boot the guest again:
xm create /etc/xen/xen1.example.com.cfg
This time it should boot from its hard drive. Of course, you can now use VNC again to connect to the guest.
3 Using VNC When There Are Multiple Guests
If you have multiple guests running at the same time, the guests obviously cannot all use port 5900 at the same time. Therefore the second guest will use port 5901, the third one port 5902, and so on. You can check the VNC ports that are currently in use by running
server1:/etc/xen# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:5900 *:* LISTEN 24492/qemu-dm
tcp 0 0 *:5901 *:* LISTEN 24950/qemu-dm
tcp 0 0 *:5902 *:* LISTEN 25295/qemu-dm
tcp 0 0 *:42991 *:* LISTEN 2293/rpc.statd
tcp 0 0 *:sunrpc *:* LISTEN 2282/portmap
tcp 0 0 *:ssh *:* LISTEN 2987/sshd
tcp 0 0 localhost.localdom:smtp *:* LISTEN 2803/exim4
tcp 0 0 server1.example.co:5901 192.168.0.6:49936 ESTABLISHED 24950/qemu-dm
tcp 0 148 server1.example.com:ssh 192.168.0.2:4399 ESTABLISHED 4134/2
tcp6 0 0 [::]:ssh [::]:* LISTEN 2987/sshd
In your VNC viewer, you must specify the new port (e.g. 192.168.0.100:5901):
And voilà, here's the second guest, this time an Ubuntu 8.10 desktop:
And here's our third guest, a Windows XP desktop:
It might happen that you start a guest, but cannot connect to it using VNC, and netstat -tap shows no new VNC port. In the log file of the guest in /var/log/xen/qemu-dm-*.log you might see something like this:
I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0
Shut down one or two of the other guests, and afterwards it should be possible to start this guest again.
5 Important Xen Commands
Here are the most important Xen commands:
xm create -c /path/to/config - Start a virtual machine.
xm shutdown <name> - Stop a virtual machine.
xm destroy <name> - Stop a virtual machine immediately without shutting it down. It's as if you switch off the power button.
xm list - List all running systems.
xm help - List of all commands.