Updated (2021-12-14): When I installed NetBSD for the first time, I remember I’d to collect bits and pieces of information from different places, some of which were rather old and outdated. So, I’ve decided to write this stuff down and publish it here.
Hope that it helps anyone looking to install and configure NetBSD as a laptop/desktop daily driver, if it helps one single soul, I’d be happy!
I'll try to keep this updated on a regular basis ;)
I got this 2014 laptop* without a hard drive, but with 8GB of RAM.
How large should the hard drive be?
Looking on the web and asking a few questions, I concluded that NetBSD wouldn’t require that much for a full install.
So I bought a 30GB SSD for $20 and placed it in this laptop. Then, I installed NetBSD-9.2_STABLE from an usb, as described in, the guide.
Choose keyboard -> Install to hard disk -> Full installation -> Use the entire disk, then set the sizes of the partitions,
When the base install was finished, I let
dhcp configure my network connection automatically, set the console keyboard, created a root password, set the root shell to
/bin/ksh and configure the system to use the correct pkgin mirror.
On this install, I’ve chosen not to set-up
pkgsrc. Keep it simple to start with and, to be honest, I think a larger hard drive would be handy to build packages from source using
pkgsrc, as the build directory needs some space to grow during the building process.
Note: I'm currently building quite a few packages with
pkgsrc and so far, so good. No issues with the disk size, just remember to always clean the build (
make clean-depends and
make distclean) before you start the next one ;)
I always choose to add a system user after installing, so that’s what I’ve done this time as well.
After installing and rebooting the system, login as root and…
# pkgin install doas dbus spectrwm slock firefox vim scrot xpdf-4 gtar xz montserrat git-base desktop-file-utils feh mozilla-rootcerts-openssl featherpad qt5ct redshift
For my needs, I also install
hunspell-sv_SE, but your needs may be slightly different ;)
spectrwm, but obviously, you can replace it with whatever wm you prefer. Note that,
spectrwm needs a screenlock to function, therefore I'm pulling
Next copy some start up files to
# cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/
Add these to
/etc/rc.conf with the following:
If, like me, you have an Intel processor and would like to have the intel-microcode updated, remember Meltdown and Spectre?!
Install the intel-microcode package,
# pkgin install intel-microcode-netbsd
copy the start-up script to
# cp /usr/pkg/share/examples/rc.d/intel-microcode /etc/rc.d/
rc.conf and reboot.
Once again, login as root and add an user
# useradd -g wheel -G users -s /bin/ksh -c "your real name" -m user_name
# passwd user_name
Make sure your user_name has been added to wheel (check
/etc/group). If not, add it now.
/usr/pkg/etc/doas.conf file according to your needs.
Here's mine as an example,
permit nopass user_name cmd reboot
permit nopass user_name cmd shutdown
Reboot, login as the new user and configure your stuff, things like
Next time you login, you can issue
startx to launch the graphical environment on your install.
For wireless configuration using
wpa_supplicant see this archived post by @JuvenalUrbino.
Also, by the same author there are quite a few very interesting and valuable tutorials, among others on how to set-up a firewall and configuring external media automount. Visit the archive for further information.
*HP EliteBook 820 G1
$ sysctl hw.machine_arch hw.model hw.ncpu hw.usermem64
hw.machine_arch = x86_64
hw.model = Intel 686-class
hw.ncpu = 4
hw.usermem64 = 8448819200
$ pcictl pci0 list
000:00:0: Intel Core 4G (mobile) Host Bridge, DRAM (host bridge, revision 0x0b)
000:02:0: Intel HD Graphics (GT2) (VGA display, revision 0x0b)
000:03:0: Intel Core 4G (mobile) Mini HD audio (mixed mode multimedia, revision 0x0b)
000:20:0: Intel Core 4G (mobile) USB xHCI (USB serial bus, xHCI, revision 0x04)
000:22:0: Intel Core 4G (mobile) MEI (miscellaneous communications, revision 0x04)
000:25:0: Intel I218-LM Ethernet Connection (ethernet network, revision 0x04)
000:27:0: Intel Core 4G (mobile) HD Audio (mixed mode multimedia, revision 0x04)
000:28:0: Intel Core 4G (mobile) PCIe (PCI bridge, revision 0xe4)
000:28:3: Intel Core 4G (mobile) PCIe (PCI bridge, revision 0xe4)
000:28:5: Intel Core 4G (mobile) PCIe (PCI bridge, revision 0xe4)
000:29:0: Intel Core 4G (mobile) USB EHCI (USB serial bus, EHCI, revision 0x04)
000:31:0: Intel Core 4G (mobile) LPC (ISA bridge, revision 0x04)
000:31:2: Intel Core 4G (mobile) SATA Controller (AHCI) (SATA mass storage, AHCI 1.0, revision 0x04)
000:31:3: Intel Core 4G (mobile) SMBus (SMBus serial bus, revision 0x04)
002:00:0: Intel Centrino Advanced-N 6205 WiFi (miscellaneous network, revision 0x34)
003:00:0: Realtek Semiconductor RTS5227 PCI-E Card Reader (undefined, subclass 0x00, revision 0x01)