HVM Guests¶
HVM (Hardware Virtual Machine) guests run on emulated hardware provided by QEMU. This allows unmodified operating systems — including Windows — to run as Xen guests without any modifications.
HVM requires CPU virtualization extensions (Intel VT-x or AMD-V), which are present on all modern processors.
Creating an HVM guest¶
Here is a minimal HVM configuration for a Linux or Windows guest:
type = "hvm"
name = "myguest"
memory = 2048
vcpus = 2
disk = [ "file:/var/lib/xen/images/myguest.img,hda,w",
"file:/path/to/installer.iso,hdc:cdrom,r" ]
vif = [ "bridge=xenbr0" ]
boot = "dc"
Save this as /etc/xen/myguest.cfg and start the guest:
xl create /etc/xen/myguest.cfg
The boot option specifies the boot order: d means the disk, c means the CD-ROM. Use "dc" to try the CD-ROM first (for initial installation), then switch to "cd" to boot from the disk once the OS is installed.
Connecting to the guest¶
HVM guests typically use VNC for graphical console access. By default, Xen binds the VNC server to localhost on a port starting from 5900.
Connect with any VNC client:
vncviewer localhost:0
To configure VNC options, add to the guest configuration:
vnc = 1
vncpasswd = "mypassword"
vnclisten = "0.0.0.0" # listen on all interfaces (use with caution)
Configuration reference¶
typeSet to
hvmfor HVM guests.memoryRAM in megabytes. Windows guests typically need at least 1024 MB.
vcpusNumber of virtual CPUs.
diskDisk devices. File-backed images (
file:) or physical devices (phy:). HVM guests usehda,hdbetc. for emulated IDE disks, orxvdaetc. for paravirtualized disks (with PV drivers installed).vifVirtual network interfaces.
bootBoot order string:
c= hard disk,d= CD-ROM,n= network.
See the xl.cfg(5) man page for the full list of HVM-specific options.