Netbsdinstall

Notes during NetBSD installation on i386 machine.


Download

Check releases page and download installation media image for the target architecture, in this example will be used USB media for a i386 architecture;

$ wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/NetBSD-8.0-i386-install.img.gz


Prepare media

Read preparing the installation media from netbsd guide, first extract image and then copy to USB;

# gunzip NetBSD-8.0-i386-install.img.gz
# dd if=NetBSD-8.0-i386-install.img.gz of=/dev/your-usb bs=2m

Boot USB with grub

If the bios don't support boot from USB is possible to boot USB from installed grub on disk;

root     (hd1,msdos1)
chainloader +1
boot

To find block and partition number use "ls (" and press tab.

Boot USB with NetBSD bootloader

Select "5. Drop to boot prompt, and list drives/blocks enter;

> dev

Boot;

boot hd1a:netbsd

Boot using networkinhg PXE

Setup dnsmasq pxe? boot ...


Installation

Wizard contain good explanation for each step, choose most default options.


Post install

Draft only with notes

Read NetBSD command line and first steps after install. Pre installed editor is vi. To setup keyboard for currest session use wsconsctl;

# wsconsctl -k -w encoding=us.dvorak
encoding -> us.dvorak

Edit /etc/wscons.conf file:

encoding us.dvorak

Configure /etc/rc.conf;

hostname=machine
dhcpcd=YES
sshd=YES
rpcbind=YES
famd=YES 
dbus=YES 
hal=YES
defaultroute=10.0.0.1

Change shell and enable tab completion;

$ chsh

Set ksh shell;

Shell: /bin/ksh

Edit ~/.profile to enable autocompletion;

export EDITOR=vi

To install binary packages from upstream netbsd builds set environment PKG_PATH to where packages are located;

PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/<PORT>/<RELEASE-NUMBER>/All"

Replace <PORT> with target architecture and <RELEASE-NUMBER> by the NetBSD installed release, example for i386 release 8.0;

$ echo $PKG_PATH
http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/8.0/All/

Uncomment on root ~/.profile and add to admin user ~/.profile files;

# Uncomment the following line(s) to install binary packages
# from cdn.NetBSD.org via pkg_add.  (See also pkg_install.conf)
export PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f '1 2' -d.|cut -f 1 -d_)/All"

Install packages vim, tmux, firefox52 and mate.

# pkg_add -v vim
# pkg_add -v tmux
# pkg_add -v fam
# pkg_add -v hal
# pkg_add -v firefox52
# pkg_add -v mate
# cp /usr/pkg/share/examples/rc.d/famd /etc/rc.d/
# cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/
# cp /usr/pkg/share/examples/rc.d/hal /etc/rc.d/

Create user xinitrc file;

$ cp /etc/X11/xinit/xinitrc ~/.xinitrc

Configure ~/.xinitrc to start mate desktop, read install mate as a reference to configure with other window managers;

## Start the window manager

	#xrandr -s 1366x768
	#xrandr --dpi 100
	#xrandr --output eDP1 --mode 1366x768
	#xgamma -gamma 0.8
	#syndaemon -d
	#setxkbmap dvorak

	#exec openbox-session
	#exec dwm
	#exec spectrwm
	exec mate-session

Reboot;

# reboot