29 May 2015

FreeBSD as a desktop is notoriously challenging, with most recommending PC-BSD for a more enjoyable experience. That being said, FreeBSD makes a fine desktop. I’ve used it on traditional desktops and laptops for the better part of 15 years. With each iteration, I wind up learning new quirks and nuances that I either overlooked in previous iterations, or just did not exist. That said, this attempts to explain how I go about setting up a laptop for use with FreeBSD. This is intended for a dedicated machine, in my case a laptop, but if you do multibooting it’ll still work.

Prerequisites

  • a computer that can run FreeBSD
  • coffee
  • patience
  • dragon slaying skills

Getting started

Install FreeBSD - you should really be looking at the handbook right about now

After installation, you need some packages. Go ahead and install those now:

# pkg install -fy sudo xorg hal dbus openbox obconf git tmux konsole xcompmgr xf86-input-synaptics

Yes, this will bring in a whole slew of packages you may not use or need, such as Gnome and KDE dependencies, but disk space is cheap. Having been a *box user for many years, Openbox provides a familiar interface without the bloat of a full DE.

I run HEAD on my desktops, so my recommendation would be to update to a development branch to get access to newer features that don’t exist in the most recent release. You are free to do so yourself, but this is where the dragon slaying can come in handy.

Configure all the things

Config files need to be updated for laptop usage. My laptop has an Intel graphics chip, so i915 is what I want.

/boot/loader.conf:

i915kms_load="YES"
drm.i915.enable_rc6="7"
kern.vty=vt
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1
hw.psm.synaptics_support=1

/etc/rc.conf:

hostname="mylaptop"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP powersave"
powerd_enable="YES"
dumpdev="AUTO"
hald_enable="YES"
dbus_enable="YES"
moused_enable="YES"
performance_cx_lowest="Cmax"
economy_cx_lowest="Cmax"

/etc/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
        ssid="myssid"
        psk="MyAwesomePSK"
        priority=5
}

/etc/X11/xorg.conf:

Section "Extensions"
        Option "Composite" "Enable"
EndSection

This is not intended to be an exhaustive resource on how to manage or build a FreeBSD system. Your mileage may vary by following this. Godspeed.