7 min read

The story of how I installed Debian on a Surface Laptop 3

So I have this Surface Laptop 3.

Funny thing is, I realised I didn't own any other devices running Windows and I was actually in a situation where I had to install Windows because it's part of a stupid requirement of a certain exam that I'm taking. But at the same time, I know I just can't daily drive a laptop running Windows, it would be too uncomfortable for me. So I thought to myself - why don't I just dual boot, Windows and Linux? Get rid off Windows after the exam? Installing Debian should be pretty straightforward right? Well... Surface is a Microsoft device, and I want to install Linux, you just have to have that open mindset no matter what - expect everything.

.....But it turns out it I was right! Installing Linux on it was actually pretty straightforward and it's all thanks to the internet community that made this possible. I can't imagine how it would've been without them. You know what, I've also noticed that installing a fresh copy of Windows is actually even more infuriating, on a Surface Laptop 3 - which is a Microsoft's laptop.

So here's how that journey went.

First - I setup a Ventoy USB stick - and put all the Operating System ISOs that I need on it.
I put on:
1. Debian 13 Live KDE ISO (I chose KDE).
2. Windows 11 ISO
3. Hiren's BootCD PE (This was just for Windows recovery & rescue, in case Windows goes nuts about me dual booting with Linux - but it turns out I didn't need it!).
4. Surface Laptop 3 latest firmware installation for Windows 11

After doing a quick research - I found out installing Windows first was the way to go, and Linux comes after. Which is what I did. Also I had to plug in an adapter for external keyboard and mouse because Microsoft likes to make life hard - more about that later, very interesting.

I turned on the laptop by holding the F4 + Power Button, wait for the Windows logo to come up and immediately let go. This was to get to Surface UEFI aka the laptop's BIOS.
The reason I went to the Surface UEFI was because I wanted to disable Secure Boot, you know, to skip all these crazy checks - more on that later.

Next I turned off the laptop. Turn it on again but this time by holding F3 + Power Button, wait for the Windows logo to come up then let go immediately. This is to force it to boot from the USB stick I plugged in, so that Ventoy runs.

Venoty loads up with multiple choices - I selected the Windows 11 ISO since I'm installing that first.
To be honest, I wasn't expecting a Windows installation to be so finnicky. I mean, I expect the complications after the installation, sure, but at the start? C'mon.
It was definitely a surprise when I found out there were so many buttons and options and stupid recommendations.
Man - it wasn't used to be like that. Anyway - after going through these brain-rotten challenges designed by Microsoft, I got Windows 11 setup. And yes it was complicated because there wasn't an option to setup a local account and it turns out I had to open Command Prompt using a secret key combination (Shift + F10) - then run a secret command (OOBE\BYPASSNRO) to bypass OOBE, then it restarts by itself - then open up Command Prompt AGAIN by pressing that secret key combo. Only then, I was prompted to create a local account. This was all happening right after the installation, at the first setup screen where you have to 'Select your language'. Imagine that. I didn't even mention about the installation part - the buttons and each options that I had to select, carefully choosing all these options during the installation.
Anyway - right after that - I installed the Surface Laptop 3 Firmware to get the touchpad and the built-in keyboard working.
So, remember when I said I had to plug in an external keyboard and a mouse? The reason is because Microsoft have this proprietary module for most Surface devices, that connects its touchpad and its built-in keyboard. So when you turn on the laptop without any drivers for the module, the touchpad and the built-in keyboard won't work. You need to install the firmware for it to work. No other laptop manufacturer do this. Pretty bizarre right? Well that's Microsoft for you. Right, this is now becoming a Microsoft-hate post but I don't care. They bad. They evil.
Don't get me started on the Surface Charger - thankfully it can still charge using its single-port USB-C @ 60W-65W. Even though I hate the fact that the laptop only has a single-port of USB-C, I guess at least, it works. If one day this port breaks, well, I definitely be living with a brick. Anyway, enough about the many tales of Microsoft's stunt for now.

Now let's get to the moment of magic. Linux. I opted for Debian because I'm a pretty boring person. Plus, this is a laptop, I want something I can rely on at all times. To install Debian, I first booted up into the just-installed Windows 11, resize the C drive using its built-in program called Disk Management. I left it as "Unallocated Space" - about half of the disk. Then, I shut down the laptop, boot it up with Ventoy and went for the Debian 13 Live KDE ISO. When you load up the Debian ISO, there are a few options - you can try it first (live-use) or install. Since I already know Debian, I chose to install. The setup process is pretty much straightforward.

So about that "Unallocated Space" left earlier - Debian installation is clever enough to pick it up - there's an option to choose "Guided - use the largest continuous space" which I also believe was the first & default selected option. Then I chose my location, language, keyboard, setup new account and I'm straight into Debian. Honestly, I couldn't believe how straightforward it was - shame on you Windows! Anyway - I was in.
A lot of the things are already working - like the Wifi, Sound etc - but what about the rest? So within that Debian session, I connect it to my home wifi and open up the browser. I went to this particular website to check out this community-made Surface Linux kernel:
https://github.com/linux-surface/linux-surface

On there - there's a feature matrix that we can check, to see what would work and what doesn't work. After all, we are talking about a Microsoft product here, I doubt they'll be happy knowing people are using Linux instead of Windows on their own product.
The best part? after checking the feature matrix - for this Surface Laptop 3 that I have - everything works with this Surface Linux kernel! My Surface Laptop 3 is the Intel version, specifically i7-1065G7 CPU. There is also a very detailed guide on how to install this kernel on that website.
This is what I did...
Firs, we need to add the repo into apt ('apt' is a package manager that Debian uses, or any other Debian-flavoured distros - it is NOT an annoying song by a Korean singer featuring Bruno Mars).
I opened up Konsole (or Terminal), import the keys - all I did was copy & paste & enter lol:

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

Then, I added the repo & config:

echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" | sudo tee /etc/apt/sources.list.d/linux-surface.list

Next I update apt and install the packages needed:

sudo apt update
sudo apt install linux-image-surface linux-headers-surface libwacom-surface iptsd

Now if you noticed from the command above, I left out a package called "linux-surface-secureboot-mok" - which is mentioned on the detailed guide. The reason is because I had disabled Secure Boot prior, so I didn't need it.
In my own personal opinion having to dealt with many computers in the past, Secure Boot often causes more problems than what it is intended to do. So for personal devices, I opted to disable it. However - In a corporate environment though (for work etc), Secure Boot is a must. Go search it up to understand what it is for. Do not disable Secure Boot on a corporate laptop/computer for no reason. But hey, since this is my own, personal, Surface Laptop 3 device - I do what I want, and I want it disabled haha.

Last and quite crucial - I updated GRUB so that it can detect both OS:

sudo update-grub

Side-story: GRUB is a Bootloader capable of launching multiple operating system on a single device. It's included on many Linux distros. If you've used a Mac, this is similar to BootX. If you've never use any other operating system on your computer except Windows, the bootloader is called "Windows Boot Manager" - and it's no good unless you 'just Windows'. You probably don't even notice the bootloader because it often chooses Windows automatically and skips the bootloader screen. So kids - if you want to understand how things work, like we should do, as humans seeking out reasons on this world, use GRUB, or at least start with that. I mean that. Really.

Next I reboot the laptop and right after the Microsoft logo screen, voila! I was prompted with GRUB's default screen, with selections to boot up which operating system I want to load!
So if I want to boot up Debian, I just select 'Debian GNU/Linux' (which is the default-selected option at the top). Or if I want to use Windows for my exams later, I can use the arrow keys to choose "Windows Boot Manager", which loads up Windows 11 I installed earlier.

I boot it up to Debian ofcourse, and I checked all these feature based on that 'feature matrix' that says what should work and what doesn't. And YES, EVERYTHING WORKS!!
My Wifi, Bluetooth, Camear, TouchPad, Hotkeys - everything.

At that point I thought to myself - this just cannot be true - there must be something that doesn't work. I need to find a quirk. It doesn't matter if it's a quirk I can live with or I can't - all things have its pros and cons. There must be something here. How can everything just works on Linux (Debian) on a Microsoft's very own-made device?!

After stress-testing it - I did find one minor quirk (well, it's a minor for me). And it's not even on Debian.
So again, remember that proprietary module that Microsoft uses for the keyboard and touchpad? I noticed that whenever I restart the laptop while already on a Linux session, and switch to Windows - the touchpad seems sluggish in Windows. But here's the interesting part - if I shutdown/power off, turn it on and select Windows from the start, the touchpad works fine. So I went down the rabbit hole and found out it was because of that proprietary module. The workaround is very doable, and not even hard:
So whenever I want to switch between Linux to Windows, I just have to power off / shut down and turn it on again, and select the OS I want.

Oh, then I went ricing, I rice hard, I think.