Note that there is also a Xen HOWTO. Arguably this content could be folded in there.


Here's how to install and get a dom0 running in the simplest way. It's not as simple as it could be, but it's pretty fast compared to older methods. We hope to fix the system installer for NetBSD 7.0 so it can all be done from there.


1) boot a 6.1 install image. I'm booting the CD-ROM image, NetBSD-6.1-amd64.iso .

2) Perform a normal amd64 install. At the end of the install, there is a "configure additional items as needed" menu. Choose "e", "Enable installation of binary packages". (This requires that the network be available)

3) reboot the newly installed system, and log in as root.

4) Install the Xen binary packages using pkgin (assuming the network is configured):

# pkgin install xentools41
<answer Y when asked to install dependencies>

# pkgin install xenkernel41
<answer Y>

5) install a dom0 netbsd kernel that Xen can load:

cd / && ftp

6) Edit /boot.cfg to add Xen Dom0 as an option at boot time

Add the following line:

menu=Boot Xen:load /netbsd-XEN3_DOM0.gz console=pc; multiboot /usr/pkg/xen41-kernel/xen.gz dom0_mem=512M

(you may also want to increase the default timeout from 5sec to 30sec to make choosing "Xen" easier)

7) Copy the boot scripts from /usr/pkg/share/examples/rc.d :

# cp /usr/pkg/share/examples/rc.d/xen* /etc/rc.d

(The default should be to install these files when installing a pkg, but it isn't yet. )

8) edit /etc/rc.conf and add the following lines:


9) reboot and choose "Boot Xen" from the menu. (You can make it the default by editing /boot.cfg)

10) demonstrate you're running a dom0 by doing "xm list" at a root prompt.

it's not "obviously and always good" to install rc scripts automatically; otherwise you'd eg have xencommons in rc.d on a machine that is supposed to control other systems without being a Xen server itself (there are other examples like that in pkgsrc). Thus, I disagree with the "should be installed automatically, it's an error that they don't" sentiment.
Comment by spz Thursday afternoon, October 3rd, 2013


nice to see a more updated Xen how to.

But I am curious on that: why not use /usr/pkg/etc/rc.d instead of polluting /etc/rc.d with third part scripts?

Thank you, Raimundo Santos

Comment by Raimundo in the wee hours of Sunday night, April 28th, 2014
Add a comment
Contact | Disclaimer | Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.
NetBSD® is a registered trademark of The NetBSD Foundation, Inc.