Introduction

I have installed Arch Linux on a Microsoft Surface Book 3 to use as my “focus” machine. This page outlines some set up items and other issues.

Most everything works out of the box except the cameras, which I’ve disabled in the BIOS.

Suspend only supports suspend to idle so I use Hibernation.

This is not a recommended laptop for running Linux.

Common issues and general set up

Blacklisted modules

I’ve had issues with suspending and not resuming on lid closing/opening events. It’s a known issue so I’ve blacklisted surface_gpe to just turn these events off.

The touchscreen functionality doesn’t work very well at all. Similar to a reported issue in the Surface Book 2. I’ve blacklisted ipts to turn it off.

Here are the changes to /etc/modprobe.d/blacklist.conf

# Blacklisting lid vs. suspend issue module
blacklist surface_gpe
# IPTS - Intel Precise Touch and Stylus
blacklist ipts

Visual Studio Code hangs on launch

Had this issue.

Work around add to ~/.vscode-oss/argv.json

        "password-store": "basic"

Toshy - Mac key bindings

Installed Toshy because apparently it works better with Wayland.

Install xremap-gnome for this to work on Wayland.

SSH Agent

Add this to ~/.bashrc

# ssh-agent modified from: https://wiki.archlinux.org/title/SSH_keys#ssh-agent
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
    ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
    source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
fi

Realized that the timeout is set to 1 hour with the “-t 1h” flag. I removed this since it was annoying.

Jetbrains Mono, Apple and Microsoft fonts

Arch has this

sudo pacman -S ttf-jetbrains-mono apple-fonts ttf-ms-win11-auto

Set the default for Visual Studio Code: https://stackoverflow.com/questions/59776906/how-do-i-change-vs-code-settings-to-use-jetbrains-mono-font

Avahi

Install

sudo pacman -S avahi nss-mdns

Enable and start

sudo systemctl enable avahi-daemon.service
sudo systemctl start avahi-daemon.service

Enable hostname resolution. Modify line in /etc/nsswitch.conf

hosts: mymachines mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns

Brother HL-3170CDW printer

Install CUPS

sudo pacman -S cups
systemctl enable cups.service
systemctl restart cups.service
systemctl status cups.service

Install driver

yay -S brother-hl3170cdw

Add printer via CUPS Administration http://localhost:631/admin

Hibernate

I set up a large enough swap partition (equal to RAM size) so that extra set up like setting up a swap file offset isn’t necessary.

The other steps are to configure the initramfs:

  • Add ‘resume’
  • Regenerate initramfs

Specify the kernel parameter resume=${swap_device}.

FROM: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation

Nvidia GPU

This comes with a GeForce GTX 1660 Ti:

$ lspci | grep NVIDIA
02:00.0 3D controller: NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] (rev a1)

With 6GB of VRAM:

$ nvidia-smi -q -d MEMORY

==============NVSMI LOG==============

Timestamp                                 : Wed Aug 21 16:14:56 2024
Driver Version                            : 555.58.02
CUDA Version                              : 12.5

Attached GPUs                             : 1
GPU 00000000:02:00.0
    FB Memory Usage
        Total                             : 6144 MiB
        Reserved                          : 389 MiB
        Used                              : 5 MiB
        Free                              : 5751 MiB

It’s enough to run some machine learning models.

For NVIDIA drivers with custom kernels, you need to install the nvidia-dkms package. The non-DKMS ones are built specifically for Arch’s kernel, so they won’t load with any other kernels (not even Arch’s LTS kernel).

I’m finding strange keyboard issues with the base Arch kernel so I’ve stuck with the Linux Surface kernel. The downside of the nvidia-dkms package is that it needs to be rebuilt (automatically) each time a new kernel is installed/upgraded, hence the term “dynamic kernel module support”.

More details: https://www.reddit.com/r/archlinux/comments/16iz9co/comment/k0n00uf/

Resume from Hibernate has the wrong time

Resume from Hibernate suffers from clock drift so has the wrong time.

To resolve this, I set up a systemd service that runs a time synchronization command when the system wakes up. Here’s a step-by-step approach to implement this.

First, make sure you have the systemd-timesyncd service enabled and running. This is the default time synchronization daemon for Arch Linux. If it’s not already enabled, you can enable it with:

sudo systemctl enable --now systemd-timesyncd.service

Create a new systemd service file:

sudo vi /etc/systemd/system/fix-time-on-resume.service

Add the following content to the file:

[Unit]
Description=Fix system time on resume from hibernate
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart systemd-timesyncd.service

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

Reload the systemd daemon to recognize the new service:

sudo systemctl daemon-reload

Enable the new service:

sudo systemctl enable fix-time-on-resume.service

This service automatically restarts the systemd-timesyncd service when your system resumes from hibernation, which corrects the time.

Other packages

Some other packages I install:

chromium
code
freetube
git
go
hugo
jq
rust
sudo
vim

Unresolved issues

dmesg output:

[  861.301517] i915 0000:00:02.0: [drm] *ERROR* Link Training Unsuccessful

Similar to: https://github.com/NixOS/nixpkgs/issues/36392

Appears to be an issue with the dock and using a USBC to Display Port cable.

Unplugging the power cable (which connects to the dock) seems to help get the external screen displaying again. Annoying workaround.

Suspend - Only support Suspend to Idle

Suspend only supports ACPI state 0 Suspend-To-Idle and eats up 20%+ of the battery life overnight.

I Hibernate my laptop which writes the state to disk so only uses less than 1% of battery life a day (normal no usage battery trickle).

This link explains why the the laptop only supports suspend to idle:

Suspend-to-ram, on the other hand, is disabled by the ACPI firmware of the device. I think people have tried to enable it again in some other issue, but that requires patching of the ACPI tables (i.e., not something that we can do from the kernel/software side alone).