Jump To: Support > KB > NetBSD > XenServer
NetBSD on XenServer (paravirtualisation)
- Install NetBSD i386 or amd64 as normal
- Copy the Xen3 DOMU kernel in the root of the VM's filesystem. For i386 this will be netbsd-XEN3PAE_DOMU.gz. For amd64 this will be netbsd-XEN3_DOMU.gz. For test purposes use the INSTALL kernels (i.e. netbsd-INSTALL_XEN3PAE_DOMU.gz or netbsd-INSTALL_XEN3_DOMU.gz). You must use the PAE kernels for NetBSD/i386
- Shutdown VM
- Get to console on XenServer
- Locate VM's UUID using
xe vm-list
. Take a note of it as you will need to use it later:[root@xenserver1 ~]# xe vm-list uuid ( RO) : 116058ee-370d-1108-0f82-575f36c52079 name-label ( RW): NetManager 5.0 i386 power-state ( RO): running uuid ( RO) : 97a480ca-156d-4dd6-a8a4-736d3cf8e5ee name-label ( RW): Windows Server 2008 (1) power-state ( RO): halted uuid ( RO) : 074fc5bd-82b7-480f-866a-0d1c813b1ca7 name-label ( RW): Control domain on host: xenserver1 power-state ( RO): running uuid ( RO) : 1317dd59-5137-b23e-4d41-46e501228d79 name-label ( RW): NetBSD/amd64 5.1 power-state ( RO): halted uuid ( RO) : b087db7e-e218-f2af-1e9d-cb07e416e2fa name-label ( RW): XenDDC power-state ( RO): halted
- Convert VM to PV from HVM by clearing HVM-boot-policy using
xe vm-param-set
. Adjust the uuid as appropriate, of course:[root@xenserver1 ~]# xe vm-param-set uuid=1317dd59-5137-b23e-4d41-46e501228d79 HVM-boot-policy=""
- Set pygrub as the bootloader by setting the PV-bootloader option:
[root@xenserver1 ~]# xe vm-param-set uuid=1317dd59-5137-b23e-4d41-46e501228d79 PV-bootloader=pygrub
- Set the kernel file to use by setting the PV-bootloader-args option:
[root@xenserver1 ~]# xe vm-param-set uuid=1317dd59-5137-b23e-4d41-46e501228d79 PV-bootloader-args="--kernel=/netbsd-INSTALL_XEN3PAE_DOMU.gz"
- Determine the UUID of the virtual disk used by the NetBSD VM using
xe vm-disk-list
:[root@xenserver1 ~]# xe vm-disk-list uuid=1317dd59-5137-b23e-4d41-46e501228d79 Disk 0 VBD: uuid ( RO) : fb8064e2-ec57-476d-757b-5a57189f8373 vm-name-label ( RO): NetBSD/amd64 5.1 userdevice ( RW): 1 Disk 0 VDI: uuid ( RO) : 1ff9b516-89cd-4ae9-8f68-8637480d5d8f name-label ( RW): NetBSD/amd64 sr-name-label ( RO): Ugly VHDs virtual-size ( RO): 10737418240
- Make the virtual disk bootable by using
xe vbd-param-set
. N.B. the uuid to use is the VBD uuid from the vm-disk-list command, not the VDI uuid or the VM's uuid:[root@xenserver1 ~]# xe vbd-param-set uuid=fb8064e2-ec57-476d-757b-5a57189f8373 bootable=true
- Close down XenCenter and restart it. This is because XenCenter caches whether the VM is PV or HVM and if you skip this step, it is likely that you won't be able to type at the console of the VM.
- The VM is now ready to boot. Caution, you must unload the ISO image from the VM otherwise you will get the error The bootloader for this VM returned an error -- did the VM installation succeed? Error from bootloader: too many bootable disks (2 disks).
- To switch it back to HVM, just reset the HVM-boot-policy option:
[root@xenserver1 ~]# xe vm-param-set uuid=1317dd59-5137-b23e-4d41-46e501228d79 HVM-boot-policy="BIOS order"
Getting a text console
XenServer normally takes the text console and connects it to a VNC server. This is then used by XenCenter to give access to the console. However, this a) requires XenCenter (though Web-based Self Service should also work in XenServer 5.6 Fp1) and b) is slow. If you want to just ssh in and get to the raw console you need to kill the VNC server and then connect directly.
[root@xenserver1 ~]# xe vm-list name-label="NetBSD/i386" uuid ( RO) : 5ac81c4e-3d4c-bd70-355e-d1a1c2d7716d name-label ( RW): NetBSD/i386 power-state ( RO): running [root@xenserver1 ~]# xe vm-param-get uuid=5ac81c4e-3d4c-bd70-355e-d1a1c2d7716d param-name=dom-id 29 [root@xenserver1 ~]# ps ax | grep '/29/serial' 5983 ? Ssl 0:00 /usr/lib/xen/bin/vncterm -v 127.0.0.1:1 -x /local/domain/29/serial/0 5995 ? S 0:00 /usr/lib/xen/bin/vncterm -v 127.0.0.1:1 -x /local/domain/29/serial/0 6989 pts/9 S+ 0:00 grep /29/serial [root@xenserver1 ~]# kill 5983 5995 [root@xenserver1 ~]# /usr/lib/xen/bin/xenconsole 29
Problems with NetBSD 5.0 and 5.1
While the PV will boot successfully and network and block devices will be found, the network devices will not work and dmesg on the dom0 (XenServer) will report lots of :__ratelimit: 1431411 callbacks suppressed xen_net: Memory squeeze in netback driver. xen_net: Memory squeeze in netback driver.
More seriously, this will immediately kill network access on all VMs on the XenServer and will also stop the VMs from shutting down (even force does not work). You may need to resort to powering off the XenServer or if you are lucky, halt -p
at the XenServer console will shut it down cleanly.
A patch for netbsd-5 can be found here.
On a lighter note, the PV block devices do work.
The NetBSD domU kernels prior to NetBSD 6 do not support SMP, so there is no point in assigning more than one vCPU to the VM.
More info
http://community.citrix.com/display/xs/The+Operation+of+Unsupported+Guests+on+XenServer+5.5+and+5.6