this is obsolete doc -- see http://doc.nethence.com/ instead

HVM XEN guest 

 

 

Requirements 

You'll never see (vmx|svm) in /proc/cpuinfo if you're currently running a dom0 or domU. The Xen hypervisor suppresses these flags in order to prevent hijacking. To check if Intel VT or SVM (formaly AMD-V) are available or enabled for HVM guests, on a non-xen system, 

egrep '(vmx|svm)' /proc/cpuinfo

on a xen system, 

xm dmesg | grep -i hvm

 

note. qemu comes with xen-tools, no need to install qemu seperately. 

note. 32 and 64-bit guests both seem to work even as hvm (we're running xen4 with a 64-bit dom0 here) 

 

 

Configuration 

Build guest's skeleton (harddrive and config file), 

mkdir -p /data/guests/hvmguest/
cd /data/guests/hvmguest/
dd if=/dev/zero of=hvmguest.disk bs=1024k count=1 seek=10000
locate hvmloader
locate qemu-dm | grep bin
vi hvmguest

like, 

kernel = '/usr/lib/xen/boot/hvmloader'
builder='hvm'
device_model = '/usr/lib/xen/bin/qemu-dm'

 

name = 'hvmguest'
memory = 1024
disk = ['file:/data/guests/hvmguest/hvmguest.disk,hda,w',\
        'file:/data/share/ISO-IMAGE.iso,hdc:cdrom,r']
vif = [ 'type=ioemu,bridge=bridge0,vifname=vhvmguest.0' ]
boot = "dc"

 

sdl=0
vnc=1
vnclisten='0.0.0.0'
vncconsole=0
vncpasswd='PASSWORD'

note. change ISO-IMAGE accordingly 

note. boot=dc to force the boot on cdrom 

 

note. for FreeBSD 8.{1,2} only hda works (otherwise it will install but won't reboot...), 

disk = ['file:/data/guests/hvmguest/hvmguest.disk,hda,w',\
        'file:/data/share/FreeBSD-8.2-RELEASE-amd64-disc1.iso,hdc:cdrom,r']

 

note. for Redhat 6.2, sda is just fine (hda will make the installer stuck at format stage...), 

disk = ['file:/data/guests/hvmguest/hvmguest.disk,sda,w',\
        'file:/data/share/zoot-rpmrcfix.iso,hdc:cdrom,r']

 

note. for Oracle Solaris 10, sda or hda doesn't matter yet, as the console doesn't show anything beyond the SunOS release and copyright statement. 

 

note. for Oracle Solaris 11, only hda is recognized by the installer, 

disk = ['file:/data/guests/hvmguest/hvmguest.disk,hda,w',\
        'file:/data/share/sol-11-exp-201011-text-x86.iso,hdc:cdrom,r']

 

note. for OpenSolaris 0906-x86, sda makes it dump at boot time. Try with hda? 

disk = ['file:/data/guests/hvmguest/hvmguest.disk,hda,w',\
        'file:/data/share/osol-0906-x86.iso,hdc:cdrom,r']

 

note. for Windows 2000, hda is fine, 

disk = ['file:/data/guests/hvmguest/hvmguest.disk,hda,w',\
        'file:/data/share/w2kadvfr.iso,hdc:cdrom,r']

 

note. other iso-images, 

        #'file:/data/share/sorcerer-x86_64-20110501.iso,hdc:cdrom,r']
        #'file:/data/share/DragonFly-x86_64-LATEST-ISO.iso,hdc:cdrom,r']

 

 

Ready to go 

Start the guest, 

modprobe tun
#lsmod | grep tun
#ls -l /dev/net/tun
xm cr hvmguest

note. you can now connect with VNC (to the dom0 IP). Eventually choose US-English keyboard, as your VNC client deals with your keymap locally. 

note. check Qemu launched the vnc server, 

netstat -an --inet | egrep '59[0-9][0-9]'

note. eventually disable tcp offloading (see http://pbraun.nethence.com/doc/sysutils_xen/network.html) 

 

Install the operating system and once finished, edit the guest configuration again, 

cd /data/guests/hvmguest/
vi hvmguest

to remove the ISO-IMAGE line. Also comment 'boot = "dc"' 

 

 

References 

http://www.howtoforge.com/how-to-run-fully-virtualized-guests-hvm-with-xen-3.2-on-debian-lenny-x86_64 

http://www.virtuatopia.com/index.php/Configuring_and_Installating_a_Xen_Hardware_Virtual_Machine_(HVM)_domainU_Guest