Difference between revisions of "How to install a NetBSD domU on a Linux host (Debian 3.1, Xen 2.0.7, NetBSD 2.1)"
Lars.kurth (talk | contribs) (Created page with "<!-- MoinMoin name: NetBSDdomU --> <!-- Comment: --> <!-- WikiMedia name: NetBSDdomU --> <!-- Page revision: 00000013 --> <!-- Original date: Mon Aug 13 06:29:30 2007 …") |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 13: | Line 13: | ||
− | <pre |
+ | <pre> |
lvcreate -L4G -n netbsd3.0 vol1 |
lvcreate -L4G -n netbsd3.0 vol1 |
||
− | + | </pre> |
|
Line 21: | Line 21: | ||
− | <pre |
+ | <pre> |
wget ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0-RC5/200511302123Z/i386/binary/kernel/netbsd-INSTALL_XENU.gz |
wget ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0-RC5/200511302123Z/i386/binary/kernel/netbsd-INSTALL_XENU.gz |
||
wget ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0-RC5/200511302123Z/i386/binary/kernel/netbsd-XENU.gz |
wget ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0-RC5/200511302123Z/i386/binary/kernel/netbsd-XENU.gz |
||
Line 27: | Line 27: | ||
gunzip netbsd-INSTALL_XENU.gz |
gunzip netbsd-INSTALL_XENU.gz |
||
gunzip netbsd-XENU.gz |
gunzip netbsd-XENU.gz |
||
− | + | </pre> |
|
For Xen3 hosts, use: |
For Xen3 hosts, use: |
||
− | <pre |
+ | <pre> |
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz |
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz |
||
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-XEN3_DOMU.gz |
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-XEN3_DOMU.gz |
||
Line 38: | Line 38: | ||
gunzip netbsd-INSTALL_XEN3_DOMU.gz |
gunzip netbsd-INSTALL_XEN3_DOMU.gz |
||
gunzip netbsd-XEN3_DOMU.gz |
gunzip netbsd-XEN3_DOMU.gz |
||
− | + | </pre> |
|
Line 46: | Line 46: | ||
− | <pre |
+ | <pre> |
kernel = "/home/garry/kernels/netbsd-INSTALL_XENU" <--- point to where you downloaded the kernels in step #2 |
kernel = "/home/garry/kernels/netbsd-INSTALL_XENU" <--- point to where you downloaded the kernels in step #2 |
||
memory = 128 |
memory = 128 |
||
Line 59: | Line 59: | ||
netmask = "255.255.x.x" |
netmask = "255.255.x.x" |
||
gateway = "a.b.c.d" |
gateway = "a.b.c.d" |
||
− | + | </pre> |
|
Line 65: | Line 65: | ||
− | <pre |
+ | <pre> |
xm create -c netbsd.cfg |
xm create -c netbsd.cfg |
||
− | + | </pre> |
|
Line 77: | Line 77: | ||
− | <pre |
+ | <pre> |
pub/NetBSD/NetBSD-3.1 |
pub/NetBSD/NetBSD-3.1 |
||
− | + | </pre> |
|
Line 87: | Line 87: | ||
− | <pre |
+ | <pre> |
mount /dev/xbd0a /mnt |
mount /dev/xbd0a /mnt |
||
cd /mnt/dev |
cd /mnt/dev |
||
Line 94: | Line 94: | ||
halt -p |
halt -p |
||
− | + | </pre> |
|
Line 104: | Line 104: | ||
− | <pre |
+ | <pre> |
kernel = "/home/garry/kernels/netbsd-XENU" <--- change /home/garry/kernels to where you downloaded the kernels in step #2 |
kernel = "/home/garry/kernels/netbsd-XENU" <--- change /home/garry/kernels to where you downloaded the kernels in step #2 |
||
− | + | </pre> |
|
Line 112: | Line 112: | ||
− | <pre |
+ | <pre> |
xm create -c netbsd.cfg |
xm create -c netbsd.cfg |
||
− | + | </pre> |
|
Line 124: | Line 124: | ||
− | <pre |
+ | <pre> |
console "/usr/libexec/getty Pc" vt100 on secure |
console "/usr/libexec/getty Pc" vt100 on secure |
||
ttyE0 "/usr/libexec/getty Pc" vt220 off secure |
ttyE0 "/usr/libexec/getty Pc" vt220 off secure |
||
Line 132: | Line 132: | ||
... |
... |
||
− | + | </pre> |
|
Line 138: | Line 138: | ||
− | <pre |
+ | <pre> |
#screen 0 - vt100 |
#screen 0 - vt100 |
||
#screen 1 - vt100 |
#screen 1 - vt100 |
||
Line 145: | Line 145: | ||
#screen 4 - - |
#screen 4 - - |
||
#screen 4 80x25bf vt100 |
#screen 4 80x25bf vt100 |
||
− | + | </pre> |
|
Line 151: | Line 151: | ||
− | <pre |
+ | <pre> |
powerd=YES |
powerd=YES |
||
− | + | </pre> |
|
Line 161: | Line 161: | ||
[[Category:Users]] |
[[Category:Users]] |
||
[[Category:Developers]] |
[[Category:Developers]] |
||
+ | [[Category:NetBSD]] |
||
+ | [[Category:Guest Install]] |
Latest revision as of 13:30, 26 March 2012
This mini-HOWTO describes how to install a NetBSD domU on a Linux host (dom0). Specifically, I used Debian 3.1 on Xen 2.0.7 as the host and put NetBSD 2.1 in a domU (with NetBSD 3.0-current kernel). This has been updated to include details on
Create storage space. I used LVM:
lvcreate -L4G -n netbsd3.0 vol1
Download netbsd-XENU-INSTALL and netbsd-XENU kernels:
wget ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0-RC5/200511302123Z/i386/binary/kernel/netbsd-INSTALL_XENU.gz wget ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0-RC5/200511302123Z/i386/binary/kernel/netbsd-XENU.gz gunzip netbsd-INSTALL_XENU.gz gunzip netbsd-XENU.gz
For Xen3 hosts, use:
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-XEN3_DOMU.gz gunzip netbsd-INSTALL_XEN3_DOMU.gz gunzip netbsd-XEN3_DOMU.gz
If the snapshots above are not available at the time you read this, just search for a newer snapshot.
Create /etc/xen/netbsd.cfg:
kernel = "/home/garry/kernels/netbsd-INSTALL_XENU" <--- point to where you downloaded the kernels in step #2 memory = 128 name = "netbsd3.0" disk = [ 'phy:/dev/vol1/netbsd3.0,0x3,w' ] # I needed to add this because the installer couldn't find a network card without it vif = ['mac=00:0C:6E:40:59:A3'] # Replace with your IP info ip = "a.b.c.d" netmask = "255.255.x.x" gateway = "a.b.c.d"
Start VM
xm create -c netbsd.cfg
Your system will boot into the NetBSD installer. Install NetBSD like normal, noting the following:
When you get to the part where it is formatting your filesystems, you may get an error about "invalid disklabel" or something like that. From my experience, it can be ignored.
When it asks for installation method, choose 'FTP', then change the base directory to:
pub/NetBSD/NetBSD-3.1
NetBSD 3.1 was the latest version of NetBSD at the time of this writing, you may choose a newer one if you wish.
mount /dev/xbd0a /mnt cd /mnt/dev cp -pR /dev/rxbd* . cp -pR /dev/xbd* . halt -p
For some reason, these devices are not created by Xen when the VM is booted. And yes, I tried every combination of the "disk" and "root" Xen options in "netbsd.cfg" that I could think of, but nothing worked.
The above process is probably not necessary for XEN3 3.1 kernels.
Edit /etc/xen/netbsd.cfg, change the first line to the following:
kernel = "/home/garry/kernels/netbsd-XENU" <--- change /home/garry/kernels to where you downloaded the kernels in step #2
Start VM again
xm create -c netbsd.cfg
You're now booted into your brand new NetBSD VM!
You'll notice some errors during the bootup, such as "wsconscfg: /dev/ttyEcfg: Device not configured".
To turn this off, edit /etc/ttys and turn off all terminals except "console", like so:
console "/usr/libexec/getty Pc" vt100 on secure ttyE0 "/usr/libexec/getty Pc" vt220 off secure ttyE1 "/usr/libexec/getty Pc" vt220 off secure ttyE2 "/usr/libexec/getty Pc" vt220 off secure ttyE3 "/usr/libexec/getty Pc" vt220 off secure ...
Also, comment out all screens in /etc/wscons.conf:
#screen 0 - vt100 #screen 1 - vt100 #screen 2 - vt100 #screen 3 - vt100 #screen 4 - - #screen 4 80x25bf vt100
Finally, so that "xm shutdown" works from your host (dom0), put the following in /etc/rc.conf:
powerd=YES