Skip to content

Instantly share code, notes, and snippets.

@s0lesurviv0r
Created November 13, 2022 06:34
Show Gist options
  • Save s0lesurviv0r/2cbabd135389afe1340de3e55ec131b7 to your computer and use it in GitHub Desktop.
Save s0lesurviv0r/2cbabd135389afe1340de3e55ec131b7 to your computer and use it in GitHub Desktop.
Ubuntu 22.04 on a Surface Laptop 4

Ubuntu 22.04 on a Surface Laptop 4

There's a few gotchas I've discovered trying to get Ubuntu running on the Microsoft Surface Laptop 4. These steps assume an external keyboard was connected to the device and Ubuntu was installed already. These steps will install all drivers needed so the Surface Laptop 4 can operate with it's built-in keyboard. This isn't intended to be a complete guide, just a cheat-sheet for me or anyone else.

Disable iommu

sudo nano /etc/default/grub to edit the grub configuration

Add the following under the other GRUB_CMDLINE_LINUX lines:

GRUB_CMDLINE_LINUX="amd_iommu=off iommu=off"

Run update-grub

Install linux-surface

wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
    | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg
echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" \
	| sudo tee /etc/apt/sources.list.d/linux-surface.list
sudo apt update
sudo apt install linux-image-surface linux-headers-surface iptsd libwacom-surface
sudo systemctl enable iptsd
sudo apt install linux-surface-secureboot-mok
sudo update-grub

Initramfs Modules

sudo nano /etc/initramfs-tools/modules to edit initramfs modules. We need these modules to load before the rest of the kernel so we can get the keyboard working for things like LUKS2. Add these lines to the file:

8250_dw
surface_hid_core
surface_hid
surface_aggregator_registry
surface_aggregator_hub
surface_aggregator
pinctrl_amd

Generate a new initramfs image by running sudo update-initramfs -u -k all

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment