FreeBSD on the Lenovo Thinkpad T480
Last updated: January 7, 2020
Recently I replaced my 2014 MacBook Air with a Lenovo Thinkpad T480, on which I've installed FreeBSD, currently 13.0-CURRENT. This page documents my set-up along with various configuration tweaks and fixes.
So far working:
- WQHD screen (HiDPI)
- WiFi (802.11g)
- IR & visible light camera :)
- Suspend / resume
- Trackpad & trackpoint
- USB ports
Not working: Bluetooth (causes hang on reboot), 802.11ac (no support in FreeBSD). I don't have any Thunderbolt devices to test and don't have a fingerprint sensor installed.
X11 and HiDPI
Xorg requires the Intel video drivers from the package
drm-current-kmod. I've found building them from source to work more reliably than installing from packages. After installation, load them at boot by adding
I use i3 as my window manager, so much of the configuration here may be specific to this setup. For HiDPI support, the scaling factor must be set using xrandr. I do this in my
xrandr --dpi 140 && xrdb -merge $HOME/.Xresources
exec i3 # start the window manager
Note the instructions in the handbook to not install the
xf86-video-intel package. I found it much less performant than the default driver (
modesetting) (e.g. marching ants nearly freezing GIMP). However, it does have reliable screen tearing mitigation.
By default the cursor will be tiny. To increase the size of the cursor, select a cursor theme that has multiple cursor sizes and set the cursor size in
However, this only seems to work if you create the following symlink:
ln -s /usr/local/share/icons ~/.icons
In 12.1-RELEASE I had an issue where the cursor would still be very small in GTK apps (Firefox, xfce4-terminal); to fix, set the same cursor theme as in
If using an external monitor, by default the HiDPI scaling in
xinitrc will be applied. To use a different scaling, e.g. 96 dpi, first calculate the quotient of
hidpi/ext monitor dpi (in my case, 140/96 = 1.485), then set up the monitor using a command such as:
xrandr --output "HDMI-2" --mode 1920x1080 --scale 1.485x1.485 --right-of "eDP-1"
This works well for displaying, but the mouse appears to be unable to exceed the dimensions of the internal monitor on the external display. This appears to be a common issue but I haven't figured it out yet.
Trackpad / Trackpoint
Initially I used
moused (commented out in
/etc/rc.conf below). Everything worked, but two-finger scrolling was not smooth and didn't work if the motion was too fast, and no palm detection was available (cursor would jump and click while typing). I tried using
xf86-input-synaptics, but the buttons above the Trackpad wouldn't work, nor would the TrackPoint.
I ended up following instructions by Michael Gmelin to:
- Compile the kernel with
evdevsupport (no longer required starting in 12.1-RELEASE)
sysctl.confand enable synaptics support in
xorg, compile and install from ports (note: to apply a patch to ports in FreeBSD,
/usr/ports, and run
patch<'path/to/patch'). One of the patches wouldn't apply automatically but worked fine when I manually applied the changes described in the patch file.
- Configure input devices with
With this configuration, both the Trackpad and Trackpoint (and buttons) work as expected. My
/usr/local/etc/X11/xorg.conf.d/10-input.conf looks like this:
Identifier "libinput keyboard catchall"
Option "XkbRules" "evdev"
Identifier "libinput touchpad catchall"
Option "NaturalScrolling" "on"
Option "Tapping" "on"
Option "DisableWhileTyping" "on"
Option "AccelSpeed" "0.42"
i3 window manager
For i3wm, the generated configuration is more limited than the default loaded configuration (e.g. the generated config does not have a hotkey to exit i3). Copy the example configuration as a starting point:
mkdir -p ~/.i3 && cp /usr/local/etc/i3/config ~/.i3/config
5GHz WiFi networks
5 GHz networks won't be visible unless the country code is properly set for the WiFi interface (otherwise connectivity will be limited to the 2.4GHz band). I set the country code (for me, Canada, "CA") on this line in
ifconfig_wlan0="WPA country CA powersave"
WiFi is also limited to 802.11g speeds for the Intel 8265 Wireless card. I've tried using PCI passthrough with a Linux virtual machine in bhyve to use 802.11ac speeds, but haven't figured out how to keep this working after suspend/resume.
Suspend / resume
To enable suspend / resume on lid close when running X11, add
On 12.1-RELEASE I had an issue where the ethernet interface drops and won't connect again on resume. To fix, install the latest drivers from the
Also note that the TPM must be disabled in the BIOS for suspend/resume to work. Supported TPM models are listed in
man tpm and I guess the T480 TPM is not yet supported. According to the manual page, the TPM must be told to save its state before suspend; otherwise resume will fail.
The IR camera is the only camera option included with the WQHD screen. Setting up
webcamd with default settings has the infrared camera working fine but only as creepy night vision!
usbconfig shows two camera devices:
ugen0.2: <Bison Integrated IR Camera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (500mA)
ugen0.3: <SunplusIT Inc Integrated Camera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (500mA)
To use the visible light camera instead of the IR camera, set
/etc/rc.conf to indicate the right device to use, e.g.
webcamd_0_flags="-d ugen0.3 -B"
Alternatively, set up both cameras (as shown below in
/etc/rc.conf) so that apps will ask which one you want to use.
I still haven't figured out how to make the cameras accessible to Chrome (Chromium) or Firefox.
For anything not described above:
# Added by installer
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
# Power saving, see https://www.c0ffee.net/blog/freebsd-on-a-laptop/
# Intel Graphics driver
# Readable font size at console
# For XOrg
# Don't pause during boot for DHCP
# Networking; use ethernet if available, otherwise use WiFi
ifconfig_wlan0="WPA country CA powersave"
# Same as em0 MAC address cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
webcamd_0_flags="-d ugen0.3" # visible light camera
webcamd_1_flags="-d ugen0.2" # IR camera
# Touchpad, old configuration
#moused_flags="-V -A 1.8 -a 1.2 -U 4 -L 1.5"
# CUPS (allow printing)
# Virtualbox bridged networking
# Access to USB devices for operator group
# (references ruleset name in /etc/devfs.rules)
# Added by the installer
# Allow sleep on lid close
# Disable system bell / bell everywhere
# Allow mounting FUSE filesystems
# Added by installer
# Ethernet goes out on suspend/resume, fix by using newest Intel drivers
# (no longer needed on 13.0-CURRENT)
# Improved power and video support
# For webcam
# Touchpad driver
# Place devices in low power state when suitable driver not found
# (man 4 pci)