Difference between revisions of "NetBSD"

From PrgmrWiki
(removed garbage and updated ftp links)
Line 1: Line 1:
so, NetBSD-stable doesn't support PAE or AMD64,  and non-PAE Xen systems are hard to come by these days.  (understandably... 4GB isn't much these days.)  to run on most Xen systems, you need a i386-PAE or a AMD64 (x86_64 in gcc nomenclature. Same thing as the AMD64 arch in NetBSD or linux) kernel.
NetBSD-current supports both AMD64 (as a Dom0 and DomU) and i386 PAE (DomU only)  This will be an overview of how to set that up (specifically on prgmr.com systems, but it should work with any provider that gives you pygrub or pvgrub or the like.)
in the DomU, w/ prgmr.com PyGrub,
title NetBSD install
        root (hd0,0)
        kernel /boot/netbsd-INSTALL_XEN3_DOMU
title NetBSD run
        root (hd0,0)
        kernel /boot/netbsd-XEN3_DOMU root=xbd1a
boot the XenU, select the 'NetBSD install' pygrub option
in the install install onto xbd1 (xbd0 being /boot)
choose ftp for the install media
you will need to change the base directory to something like
go through the regular install.  reboot, and boot into the netbsd kernel in pygrub
Once it is up, you probably want to append ,softdep to the options field in /etc/fstab
Once you are booted into the NetBSD domU if you want to change the grub menu options, execute
mount_ext2fs /dev/xbd0d /mnt
and you can edit grub/menu.lst and change the kernel.  (Note, grub will continue to load off that xbd0d partition;  this is because of the way the prgmr.com system is setup.  other providers may be different)
for the Dom0: http://www.netbsd.org/ports/xen/howto.html#netbsd-dom0
install current
(if disk is slow, look into softdep)
untar pkgsrc
install pkgsrc/emulators/netbsd32_compat40
install pkgsrc/sysutils/xentools33
and xenkernel33
mkdir -p /xen/kernels
cp /usr/pkg/xen3-kernel/xen.gz /xen/kernels/xen-3.3.gz
cd /xen/kernels
wget ftp://mirror.planetunix.net/pub/NetBSD/NetBSD-daily/HEAD/200809050002Z/amd64/binary/kernel/netbsd-XEN3_DOM0.gz
gunzip netbsd-XEN3_DOM0.gz
now pkg_add -f ftp://ftp.netbsd.org/pub/NetBSD/packages/4.0/i386/sysutils/grub-0.97nb8.tgz
install grub
# grub --no-floppy
grub> root (hd0,a)
Filesystem type is ffs, partition type 0xa9
grub> setup (hd0)
install menu.lst
must explicitly state console=tty0 if you are using a vga console
/etc/ifconfig.bridge0 file with:
!brconfig $int add ex0 up
or otherwise create the bridge on boot
== chris2's gentle guide to installing NetBSD in a prgmr DomU (January 2009) ==
== chris2's gentle guide to installing NetBSD in a prgmr DomU (January 2009) ==
Line 114: Line 27:

Revision as of 06:57, 8 June 2009

chris2's gentle guide to installing NetBSD in a prgmr DomU (January 2009)

Installing NetBSD as DomU is easy, but not trivial.

Boot your preconfigured system, jot down its IP address:

eth0      Link encap:Ethernet
          inet addr:64.62.205.XXX  Bcast:  Mask:

On stables, shutdown the instance.

On stables, create instance, in Grub, boot "Centos Rescue".

Wait for DHCP to time out.

Setup IP with

ifconfig eth0 up 64.62.205.XXX/26
route add -net gw eth0

Partition /dev/xvda, create a 63mb ext2 partition as partition 1, make a directory boot/, wget and extract there (stable versions should be similar):


(or newer)

Create a file boot/grub/menu.lst with this content:

timeout 5

title NetBSD run
        root (hd0,0)
        kernel /boot/netbsd-XEN3_DOMU

title NetBSD install
        root (hd0,0)
        kernel /boot/netbsd-INSTALL_XEN3_DOMU

Shutdown again.

Create instance. Boot first grub item, then pick "NetBSD install".

Install onto xbd0(!).

IMPORTANT: Change disklabel such that xbd0a starts after the end of the ext2 partition. Add a disklabel for the /boot partition, so you can update the kernels and adjust the menu.lst later. (You can find out its sectors by using fdisk /dev/xbd0). Here is an example disklabel setup for a 3072M disk with a 32M boot partition:

 We now have your BSD-disklabel partitions as:
 This is your last chance to change them.
    Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
    --------- --------- --------- ---------- ----- ----- -----------
 a:        31      2912      2882 FFSv1      Yes   Yes   /
 b:      2913      3040       128 swap
 c:         0      3071      3072 NetBSD partition
 d:         0      3071      3072 Whole disk
 e:         0        30        31 Linux Ext2
 f:         0         0         0 unused
 g: Show all unused partitions
 h: Change input units (sectors/cylinders/MB)
>x: Partition sizes ok

Install by FTP, setup networking by the noted data. Adjust the FTP paths to the snapshot you use.

Reboot, now with "NetBSD run".


19:30, 3 February 2009 (UTC)