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

... and edit the guest configuration file:

vi /etc/xen/

Remove the CD drive from the boot line...


... and boot the guest again:

xm create /etc/xen/

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

netstat -tap

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       ESTABLISHED 24950/qemu-dm
tcp        0    148        ESTABLISHED 4134/2
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      2987/sshd

In your VNC viewer, you must specify the new port (e.g.

And voilà, here's the second guest, this time an Ubuntu 8.10 desktop:

And here's our third guest, a Windows XP desktop:


4 Troubleshooting

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.


Share this page:

Suggested articles

0 Comment(s)

Add comment


By: Falko Timme