this is obsolete doc -- see http://doc.nethence.com/ instead
Setting up NetBSD/XEN hypervisor and dom0
Requirements
Make sure ntp and LVM are enabled, e.g. base rc.conf might look like this,
sshd=YES
ntpd=YES
ntpdate=YES
raidframe=NO
wscons=YES
Setup the XEN dom0
Proceed,
echo $PKG_PATH
pkg_add xenkernel45
cd /
cp /usr/pkg/xen45-kernel/xen.gz xen45.gz
wget "http://ftp.fr.netbsd.org/pub/NetBSD/NetBSD-`uname -r`/amd64/binary/kernel/netbsd-XEN3_DOM0.gz"
mv netbsd-XEN3_DOM0.gz netbsd-701-XEN3_DOM0.gz
cp boot.cfg boot.cfg.dist
vi boot.cfg
menu=xen45-netbsd701:load /netbsd-701-XEN3_DOM0.gz console=pc;multiboot /xen45.gz
#dom0_mem=256M
#dom0_max_vcpus=1 dom0_vcpus_pin
Setup the XEN daemons
Proceed,
echo $PKG_PATH
pkg_add xentools45 xenvstat
cd /dev && sh MAKEDEV xen
cp /usr/pkg/share/examples/rc.d/xendomains /etc/rc.d/
cp /usr/pkg/share/examples/rc.d/xencommons /etc/rc.d/
cp /usr/pkg/share/examples/rc.d/xen-watchdog /etc/rc.d/
cat >> /etc/rc.conf <<EOF
xenwatchdog=YES
xencommons=YES
xendomains=YES
EOF
Setup the network bridge,
cd /etc/
cat > ifconfig.bridge0 <<EOF
create
!brconfig $int add wm0 up
EOF
Eventually setup a few handy aliases and symlinks,
cd ~/
echo "alias xm='xl'" >> .shrc
. ./.shrc
cd /etc/
ln -s ../usr/pkg/etc/xen
cd ~/
ln -s /etc/xen
Ready to go
Reboot,
shutdown -r now
and make sure everything is fine,
xl list
References
http://www.NetBSD.org/ports/xen/howto.html
https://wiki.netbsd.org/tutorials/how_to_set_up_a_guest_os_using_xen3/