netbsd

Tutorial on NetBSD 4.0 i386 setup in kvm.

Create a 10G disk image:

qemu-img create -f qcow2 netbsd-4.0-i386.qcow2 10G

Avoid hangup on boot with --no-acpi and the default network card timeout by trying out a different card, e.g. -net nic,model=ne2k_pci:

kvm -hda netbsd-4.0-i386.qcow2 -cdrom i386cd-4.0.iso --no-acpi -net user -net nic,model=ne2k_pci

Walk through the installer.

Install additional packages with pkg_add:

export PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/4.0/i386
pkg_add vim ctwm firefox wget

Include them in path:

echo "PATH=$PATH:/usr/pkg/bin" >>/etc/profile
. /etc/profile

Install the latest stable pkgsrc:

wget ftp://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2008Q1/pkgsrc-2008Q1.tar.gz
tar xzf pkgsrc-2008Q1.tar.gz -C /usr

Make sure that pkgsrc fetches binary packages for dependencies, when possible:

echo ".ifdef BSD_PKG_MK
BINPKG_SITES=ftp://ftp.NetBSD.org/pub/NetBSD/packages/4.0/i386
BINPKG_SITES+=/usr/pkgsrc/packages/All
.endif" > /etc/mk.conf

Configure pkg_online to be able to search for packages

cd /usr/pkgsrc
cvs -d:pserver:anonymous@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip login
cvs -z3 -d:pserver:anonymous@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip checkout -P wip
cd /usr/pkgsrc/wip/pkg_online
unset PKG_PATH
make package DEPENDS_TARGET=bin-install

Search for additonal packages

pkg_online_find :s:pptp

P.S. Thanks to Aleksey Cheusov <vle@gmx.net> for implementing and making available pkg_online.