Some notes on using FreeBSD

See the FreeBSD Virtual Terminal docs for more.

Login as root or install and use doas to complete most of the tasks below.

Wifi

Restart wifi:

service netif restart

Add wifi credentials to: /etc/wpa_supplicant.conf

Install security patches

freebsd-update fetch
freebsd-update install

Update packages

pkg update
pkg upgrade
pkg autoremove
pkg clean

Update the FreeBSD version

For example, to upgrade from 14.0-RELEASE to the 14.1-RELEASE (get info on release numbers from freebsd.org):

freebsd-update -r 14.1-RELEASE upgrade
freebsd-update install

Reboot:

shutdown -r now

Login as root and run the install command again:

freebsd-update install

Virtual Terminal/Console

Use the second virtual terminal (alt-F2) to avoid the system console.

Using vidcontrol

Change color of virtual console: e.g., yellow text on blue background:

vidcontrol yellow blue

See other color options:

vidcontrol show

To make changes permanent, add the following to /etc/rc.conf:

allscreens_flags="-c yellow blue"

Using vidfont

vidcontrol can be used to set fonts, but vidfont offers a menu of options. Run vidfont to select among the options. To make a setting permanent, add to /etc/rc.conf:

allscreens_flags="-f spleen-32x64"

See more fonts in /usr/share/vt/fonts.

Virtual Console Mouse

The mouse or trackpad can be used in the virtual terminal, but sometimes I find it annoying. To turn it off:

vidcontrol -m off
To make permanent:
allscreens_flags="-m off"

Laptop Sleep

To see the available power management parameters:

systl hw.acpi

To learn what happens by default when closing the lid, see:

systl hw.acpi.lid_switch_state

To change it to sleep, do:

doas systl hw.acpi.lid_switch_state=S3

To make it permanent, edit the /etc/sysctl.conf file and add:

hw.acpi.lid_switch_state=S3

Installing the Sway window manager

After installing Wayland and Sway per the FreeBSD Handbook, install the graphics driver:

pkg install drm-kmod
sysrc -f /etc/rc.conf kld_list+=i915kms

Ensure that $USER is in the video group and reboot.

Starting Sway

Do this as $USER and not as root.

sway