Talk:How to set up a guest OS using xen3

From NetBSD Wiki

Jump to: navigation, search

Installing NetBSD as domU into an image-file w/o sysinst

I got some error from disklabel when trying to install NetBSD 4.0.1 as domU with sysinst (dom0: NetBSD 4.0.1, Xen3). But the installation worked with the tutorial of [1].

In short: They extract the sets from the NetBSD install CD into a folder and use makefs(8) to create a image-file. This works fine when you want to use a file as disk for your NetBSD Xen VM.

   mount /cdrom # mount the NetBSD CD
   tar xzpfe /cdrom/i386/binary/sets/kern-XEN3_DOMU.tgz -C /var/xen/
   tar xzpfe /cdrom/i386/binary/sets/kern-XEN3_DOMU.tgz -C /var/xen/netbsd-root/
   tar xzpfe /cdrom/i386/binary/sets/base.tgz -C /var/xen/netbsd-root/
   tar xzpfe /cdrom/i386/binary/sets/etc.tgz -C /var/xen/netbsd-root/
   
   cd /var/xen
   # create the image-file
   makefs -M size netbsd-root.ffs netbsd-root

Now you you have to edit the basic things before you boot your domU for the first time. To do this, we mount the created netbsd-root.ffs for post processing.

   vnconfig vnd0 netbsd-root.ffs
   mount vnd0a /mnt
   cd /mnt
   # edit etc/fstab, etc/rc.conf, etc/ttys, and etc/wscons.conf inside /mnt
   # (see the wiki article for in detail explanation)
   cat etc/fstab
   /dev/xbd0a / ffs rw 1 1
   kernfs /kern kernfs rw
   procfs /proc procfs rw,noauto
   
   (don't forget to set 'rc_configured=YES' in etc/rc.conf)
   
   # when you finished with editing you netbsd-root.ffs run
   umount /mnt
   vnconfig -u vnd0

My Xen config for NetBSD domU:

   kernel = "/var/xen/netbsd-XEN3_DOMU"
   memory = 64
   disk = [ 'file:/var/xen/netbsd-root.ffs,0x301,w' ]
   vif = [ 'bridge=bridge0' ]
   root = "/dev/wd0d"

Maybe someone can integrate this into the Wiki article? --Bugmenot 21:42, 21 November 2008 (UTC)

Personal tools