• see Absolute FreeBSD for good overview


Install public key of ansible host to target freebsd machine:

    ssh-copy-id smeredith@freebsd-host

Use visudo to allow members of wheel to sudo w/o password:

    $ su
    # pkg install sudo
    # visudo


  1. sudo pkg install python
  2. security patches (see below)
  3. upgrade packages (see below)
  4. use ansible to finish the configuration
  5. take a snapshot
  • To map caps-lock to ctrl in X, use the UI keyboard settings.
  • Connect to wifi. See <>.
  • Enble screen locker via GUI.



# pkg upgrade


security patches

# freebsd-update fetch
# freebsd-update install

minor versions


Installed packages will continue to work.

major versions


Installed packages will require forced upgrade.


  • system keeps configuration in defaults sub dirs
  • you override default config in seperate file of same name
  • system updates the config in defaults so you don’t have to merge
  • don’t copy defaults and edit; empty config file means no changes to default


Use visudo to allow members of wheel to sudo su pkg install sudo visudo:

  userX ALL=(ALL) ALL


Raspberry Pi

  • first boot takes a little while due to auto resize of the disk
  • once resize is done, you can ssh as freebsd, the su to root
  • default user: freebsd/freebsd
  • default root password: root
  • use adduser to add user smeredith and add to group wheel to allow su to root
  • rmuser freebsd
  • change root password using passwd
  • change hostname in /etc/rc.conf


Use visudo to allow members of wheel to sudo w/o password:

  $ su
  # pkg install sudo
  # visudo

Install python to allow ansible to run:

  # sudo pkg install python

Install public key of ansible host to target FreeBSD machine:

  $ ssh-copy-id -i ~/.ssh/ freebsd-host

Do the rest via ansible.

Add NTFS USB Drive

Install NTFS driver:

  # pkg install fusefs-ntfs
  # sysrc kld_list+=fuse

Add to /etc/rc.conf:


ntfs/ssd is an automatic label for this disk.

To mount for 1-time use:

  # ntfs-3g /dev/ntfs/ssd /mnt/ssd

I could not get these to mount at boot; hang. I tried adding the following to /etc/fstab:

  UUID=B25ECD4B5ECD08D5 /mnt/ssd ntfs-3g  rw,sync,suid,dev,exec,auto,nouser,async,dmask=000,fmask=111,utf8=1,late      0       2
  UUID=9C0AD9830AD95B3A /mnt/bighdd ntfs-3g rw,sync,suid,dev,exec,auto,nouser,async,dmask=000,fmask=111,utf8=1,late      0       2

Mount a SMB Drive

Need to be su

  # mount_smbfs -N -u <uid> -g <gid> -I //guest@ /smb/shared
  # mount_smbfs -N -u <uid> -g <gid> -I //guest@ /smb/shared
  • -N is to prevent prompting for password
  • get <uid> and <gid> from id command


  • network speed test
  • reciever: nc -l 3333 > /dev/null
  • sender: dd if=/dev/zero bs=64k count=2000 | nc -v 3333
  • (7112319 bytes/sec) from mac to Raspberry Pi 2 running FreeBSD via ethernet
  • (11435232 bytes/sec) from mac to Raspberry Pi 2 running Raspian via ethernet
  • restart a service: service <service-name> restart

Directory structure

  • /usr/local/etc: app config files
  • /usr/local/share/doc: app docs
  • /usr/local/etc/rc.d: app startup scripts


  • /etc/rc.conf: startup options
  • /var/log/messages system log
  • /var/run/dmesg.boot boot messages
  • /boot/loader.conf loader settings, boot-time tunables, including kernel sysctl values


  • run passwd in single user mode to reset password for root
  • edit fstab in single user mode to resolve boot disk issues
  • edit /etc/rc.conf to disable startup app that panics and prevents system from booting

Dell Inspiron E1505

Broadcom BCM4311 802.11b/g WLAN (driver: bwn). The wifi keyboard shortcut works (if enabled in BIOS), but does not change the wifi light on the keyboard one time, need to install new wifi firmware: (download the sources tar first)

tar -C / -xzvf src.txz
cd /usr/ports/net/bwn-firmware-kmod
make install clean

add this to /boot/loader.conf


add the following to /etc/rc.conf

ifconfig_wlan0="WPA DHCP"
  • pressing the “Wifi Up/Down” button in wifimgr adds/removes wlan0, probably using rc.conf
  • keyboard wifi light goes off when the interface is removed
  • can’t make this work: disconnecting ethernet then connecting to wifi
  • boot with ethernet disconnected
  • add to /etc/wpa_supplicant.conf for AP configs.


Normal operation:

  • use ethernet at desk: disable wifi via keyboard shortcut
  • use wifi: enable via shortcut, disconnect wifi, and reboot
  • use wifimgr to connect to new AP (writes to wpa_supplicant.conf and restarts network)
  • service netif restart when switching between wireless and wifi

Desktop Environments

Display Manager

  • see
  • graphical login program
  • KDM, GDM, slim
  • if you use KDM or GDM, they will launch the corresponding session, and so exec is required in .xinitrc
  • if you use slim, it will startx so you need to exec the session in .xinitrc
  • a DM can be used to switch between desktop environments or window managers

file: .xinitrc

  • executed when xstart is called
  • runs until x session exits
  • can run some apps in the backgroun by launching them before exec foo-wm


pkg install ruby22-gems
gem install jekyll
gem install github-pages
# local build / test for errors
jekyll build --incremental --drafts
# local preview
jekyll serve --host --port 4000 --drafts --watchs

Burn and img to SD card

Assuming sd card in USB adapter:

gzip -dc ~/Downloads/LibreELEC-RPi2.arm-7.0.2.img.gz | sudo dd of=/dev/da0 obs=64k



zfs get all <pool>
  • a stub is a parent of other datasets


Create snapshot of all datasets:

zfs snapshot -r zroot@hello-snapshot

Roll back to snapshot (no -r; must do for each dataset):

zfs rollback zroot@hello-snapshot

Merge snapshot back in and remove snapshot:

zfs destroy -r zroot@hello-snapshot

List snapshotes:

zfs list -t snapshot


Install and use peazip.


Set up using KDE Add Printer.

Brother HL-3170CDW * <ipp://> * Generic PCL 6 driver * Only B\&W

Brother 1440 * <ipp://>


See and

In /etc/rc.conf:


In /etc/devfs.rules:

add path ugen1.2 mode 0660 group usb
add path usb/1.2.0 mode 0666 group usb

Compaq nc8430

Suspend and Resume

  • acpiconf -s 3 to suspend
  • S4 doesn?t work, with or without hw.acpi.s4bios
  • hw.acpi.lid_switch_state=S3 to enable lid switch to suspend
  • hw.acpi.reset_video must be 0 for suspend to work