Running a HVM/PVHVM guest

Setup

check that VMX/SVM is enabled,

xl dmesg | grep VMX

get SPICE or VNC up and running,

apt install tightvncserver

#slackpkg search vnc
#slackpkg install tigervnc #extra

no need to run the freaking daemon,

ps auxww | grep vnc

then prepare your guest machine,

guest=GUESTNAME

mkdir -p /data/guests/$guest/
cd /data/guests/$guest/
dd if=/dev/zero of=$guest.raw bs=1G count=0 seek=50
cat > $guest <<-EOF
#XEN 4.10+
type = "hvm"
#XEN 4.9-
#builder = "hvm"

vnc = 1
vnclisten = "0.0.0.0"
vncpasswd = "PASSWORD"

#spice = 1
#spiceport = XXXX
#spicepasswd = "PASSWORD"

#nographics=1
#serial='pty'

name = "$guest"
memory = 512
vcups = 4
disk = ['tap:tapdisk:aio:/data/guests/$guest/$guest.raw,xvda,w',
        'tap:tapdisk:aio:/data/ISO-IMAGES/ms/win7sp1u.iso,xvdb:cdrom,r']
vif = [ 'bridge=xenbr0, vifname=$guest.0' ]
on_crash = "preserve"
#on_reboot = "preserve"
#on_poweroff = "preserve"
EOF
vi $guest

note. this is XEN 4.10+. If running 4.9-, revert back to builder = instead of type =

ready to go,

xl create $guest -c

and eventually remotely,

#vncviewer x.x.x.x:5900

when finished, you might want to switch back to serial console,

nographics=1
serial='pty'

Additional notes

Other options

arch = 'x86_64'
maxmem = 1024
maxcups = 2
boot = "cd"
hap = 1
acpi = 1
usb = 1
usbdevice = "tablet"
shadow_memory = 16
audio=0

Troubleshooting

libxl__domain_make: domain creation fail: Invalid argument
initiate_domain_create: cannot make domain: -3

==> enable VT…

libxl: error: libxl_dm.c:2339:device_model_spawn_outcome: Domain 4:domain 4 device model: spawn failed (rc=-3)
libxl: error: libxl_create.c:1501:domcreate_devmodel_started: Domain 4:device model did not start: -3
libxl: error: libxl_dm.c:2453:kill_device_model: Device Model already exited
libxl: error: libxl_domain.c:1003:libxl__destroy_domid: Domain 4:Non-existant domain
libxl: error: libxl_domain.c:962:domain_destroy_callback: Domain 4:Unable to destroy guest
libxl: error: libxl_domain.c:889:domain_destroy_cb: Domain 4:Destruction of domain failed

==> watch /var/log/xen/qemu-dm-bsd2.log and see Could not open '/data/ISO-IMAGES/netbsd.iso': No such file or directory

Resources

Spice Graphics Support https://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html#Spice-Graphics-Support

Xen Feature Detection http://www.brendangregg.com/blog/2014-05-09/xen-feature-detection.html

Xen Linux PV on HVM drivers https://wiki.xen.org/wiki/Xen_Linux_PV_on_HVM_drivers


Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml