Dual Boot Notebook
2024-12-08 00:11:24 PST (last update 2024-12-08 00:13:07 PST)
Bart Massey 2024
Just got a Lenovo X1 Carbon Gen 13 Aura Edition (yes, its real name) running Windows 11. I was setting up to dual-boot Lenovo-endorsed Ubuntu Wayland, and started this notebook to document the process.
The goal of this notebook is several-fold:
-
Remind future me what I did. ("'Future Me.' I hate that guy. He knows what he did." —Julian Kongslie)
-
Give others a guide with some pitfalls pointed out and navigated
-
Give feedback to the Ubuntu folks.
Background
It may be helpful to know where I'm coming from.
I started using 2.9BSD UNIX on a PDP-11 in 1982, and became
a paid sysadmin and later consultant and teacher of UNIX
stuff. I started with Linux around 1.2.13, using whatever
"distros" existed then. Later, I was a paid admin for a
network of Red Hat boxes, then switched to Debian at
slink
. I've been using Debian continuously since then. I
have small patches in the Linux kernel. I was one of the
founders of Linux Plumber's Conference.
What I'm saying is that I'm old enough and arrogant enough that the ridiculous mess that follows is something I can't imagine a new Linux user wading through on their own. In my opinion it was utterly irresponsible of Lenovo to claim they supported Ubuntu on the Carbon Gen 13 when it worked like this.
This is my first serious messing-about with Ubuntu. So that's on me.
2024-12-04
Prepping For Linux
Previously on this machine, I had installed Debian Sid. Gave it up, as X11 seemed not to be available and I didn't want to figure out Debian Wayland. In the process I had pre-done a few things to prep for Linux:
-
Modified Secure Boot: As shipped, Secure Boot would not allow booting non-Microsoft OSes. Turned on laptop, got into BIOS (repeatedly push F1 during boot) and found the setting for Secure Boot and modified it to allow Third-Party CA Certificates.
On the next Windows boot, this made me supply my BitLocker key, since the Secure Boot setting had changed. Did so without incident. I had no idea the Windows 11 install had shipped with BitLocker.
-
Disabled Bitlocker: A partition with BitLocker enabled cannot be resized by any means. However, needed to split the main 2TB partition between Windows and Linux. So found instructions for turning off BitLocker on the Windows partition. Should have done this before modifying Secure Boot.
-
Shrank Windows Partition: From the Debian installer, shrank the Windows partition to 500GB (should be plenty since I rarely use Windows for anything). I then let the installer use its default partitioning scheme on the resulting free space. Little did I know that I would reclaim this free space and start over later with Ubuntu.
The total time for this step was probably around an hour. It would be much faster if repeated.
Installing Ubuntu
Now I was ready to start over with Ubuntu. Some of these steps were actually duplicates of Debian install things, but we'll pretend that they were all new.
-
Configured DNS: Set up
bartcarbon13.po8.org
with IP address192.168.1.13
using my local DNS infrastructure. -
Configured DHCP: Set up my local DHCP infrastructure to recognize my machine with
dhcp-client-identifier
bartcarbon13
. This was necessary since the ethernet address would be that of an adapter rather than the machine itself. -
Built Ubuntu USB bootstick: Grabbed an old 8GB USB flash drive and copied a redundantly-named Ubuntu
plucky-mini-iso-amd64.iso
onto the base drive device (not a partition). Was extremely careful to check the device withparted
right before the copy: easy mistake to copy your boot iso onto one of your actual hard drives, leading directly to backup-recovery-town. -
Booted from USB: Turned on the laptop and got into the boot menu (repeatedly hit F12 during boot). Selected booting from USB. Was confronted with micro-text menu due to HIDPI display. Got my super-magnifying-glasses on.
-
Tried to start install: Turns out the micro-menu just said "Choose an Ubuntu Distribution To Install". Why is this a menu item?
Next micro-menu offered me a variety of options, none of which was the "Plucky" the mini-iso said it would install for me. I wouldn't mind an earlier Ubuntu, except I doubt it would support the Intel ARC Graphics on my laptop.
Folks say installing Ubuntu is easier than installing Debian. Don't think they've tried recently.
-
Tried installing again: Fetched a daily-build
plucky-desktop-amd64.iso
after a 5-minute download. 5.4GB should fit on my 8GB USB stick, but not with miles to spare for sure. Dumped the ISO onto my USB drive in another 18 minutes — that's a very slow drive and a big image.This time was presented with a four-item micro-menu. While trying to figure out which option to select, the bootloader timed out and started the default "Install Ubuntu." Apparently I was going with that.
After a couple of minutes of staring at a splash screen, I got an Ubuntu desktop screen. A minute later Ubuntu was more-or-less up, apparently running as a Live Image off the really slow USB drive. Not ideal, but I decided I could try working with it.
-
Tried an actual install: Noticed "Install Ubuntu 25.04" in the lower-right corner of the desktop, and decided to click on that once the handy USB drive activity light mostly quit flashing. The only effect seemed to be refreshing the list of volumes in the hotbar.
After a while I started clicking on things and eventually ended up stuck in an application search screen. I apparently had windows open according to the hotbar, but had no idea how to get to them. A quick Google search of "ubuntu return to desktop from app search screen" gave as its top hit "Super+D or Ctrl+Alt+D: Show desktop". Nope. Found a System 76 tutorial on Ubuntu Basics, which was helpful. Still couldn't get anywhere.
Finally gave up and rebooted.
-
Tried installing again: This time chose "Ubuntu (safe graphics)" from the boot menu, because I knew what was coming. Figured maybe there were graphics issues with the ARC stuff that weren't yet sorted on the Live CD. Waited again for a couple of minutes for things to come up.
This time I would be careful not to search for applications.
Got a window that said "Preparing Ubuntu" this time! Seemed more promising. I suspect graphics were just borked on the previous attempt. Frickin' bespoke hardware.
-
Continued installing: OK! Got the expected installation prompts. Apparently graphics were borked after all.
Everything was still micro-text, of course. Got out my heavy magnifying glasses again. Then switched to my Optivisor™ because the focal length of the glasses was like two inches and I wanted my face out of the screen.
But hey, on the second screen of the install I was offered the accessbility option of "Desktop Zoom". Perfect! But it turned out to be pan-and-zoom. Nope. Settled for "Large Text" and continued magnification, with the plan of fixing later.
-
Worked through the Ubuntu installer: Other than nice graphics, the screens and choices seemed to be pretty similar to the standard Debian installer.
Realized in here somewhere that I probably wanted to set up an Ubuntu mirror at home. Sigh.
-
Changed disk partitions: Oh! The installer offered to keep my old Debian installation and install Ubuntu as a third way for now. Tough choice. I could always delete the Debian partition later if I didn't miss it. But I couldn't imagine why I wouldn't miss it, and it would be easier now.
I decided to suck it up, take "Manual Installation" and reuse the Debian partition for Ubuntu. The partition editor was pretty Debian-standard, but was not interested in letting me erase the Debian partition. I didn't know what would happen, but decided to plunge on.
-
Continued installation: Having the timezone configuration auto-locate me, presumably by IP, was a nice touch: even Windows didn't do that.
Huh. The "Review Your Choices" panel pointed out that I had forgotten to go back and mark the swap partition as "swap" instead of "leave as swap". That's gross, but OK. Unfortunately the partition editor then made me reset everything else about the configuration, including stuff it had initially auto-guessed. Ah well. I'm kind of used to using a swap file instead of a swap partition for flexibility, but this was chosen for me by the Debian install and I decided to go along.
-
Installed installation: I pressed the "Install"ifier. Started a copy of files off the USB stick. Wasn't sure this was faster than from the Internet, but hey. Started seeing a series of post-purchase ad screens, including "Great for Gaming", which, well, yeah but also had Windows on the box so…
-
Rebooted from SSD: Ubuntu came up as the first option in the micro-menu, so I took it. Looked like Windows was there also though, as expected. Logged in and there it was: success! Went through a brief post-installation dialog and was looking at a running system.
The total time for this step was about four hours. If repeated, it would probably still be about two: there was a lot of sit-and-wait, and a lot of menus to wade through.
Configuring Linux
The fun doesn't stop when the desktop boots. Oh no.
I needed to configure my machine for my use cases. How hard could it be?
-
Installed a terminal: The startup had pointed out the "App Center" icon in the hotbar. I opened it. Took me a moment to realize that it was locked to "snap packages". Ugh. Switched to "Debian packages". Nothing under "terminal". Huh.
Found the "Show Apps" start menu thingy. Found a "Terminal" and pinned it to the ~~hotbar~~ "dock". Apparently it's called a dock.
Ah! The battery-looking bar icon in the upper-left corner took me back to the desktop. So yeah, things were just borked earlier on.
I hoped "Terminal" was Gnome Terminal, my standard ride and one that would make sense on a Gnome-based distro. When I checked… it was! My old friend. Finally started to feel a bit comfortable with this Ubuntu experience. A shell prompt is the key to the world of fixing stuff.
Things were suspiciously slow on this very modern laptop. I suspected something was wrong, but wasn't sure what yet. Continued anyway.
-
Messed with settings: Pinned the Settings app to the dock. Started to go through the settings, as one does.
-
WiFi: Added my home WiFi.
-
Display: Ah, was able to set the display to 3x scaling. That made things really easy to read without any magnification. They weren't hopeless with large fonts before, but this was way better.
-
Sound: Huh. Hadn't noticed until now that sound wasn't working. Only output was "Dummy Output". Needed looking into: this would be my laptop for my "Computers, Sound and Music" course in the future so sound wasn't optional.
-
Power: Power settings did not appear to be separate for powered vs battery. Not great. Set performance mode to "Performance" for now: perhaps (although unlikely) it would solve the performance problems I'd been seeing.
-
Appearance: Decided I would have to come back to get my generative "clouds" background up. It's a tradition.
-
Ubuntu Desktop: Made a bunch of boring changes, mostly in the interest of simplification and screen real-estate.
-
Mouse and Touchpad: Finally found out how to fix some of the touchpad sensitivity and weird behavior issues. Almost missed it, though: for some reason "Mouse" and "Touchpad" are separate tabs on a single settings window. Huh.
-
Keyboard: Set up the "Windows™ Key" as a Compose key, and moved "Special Character Entry" to right Control, which I never use anyway.
-
Printers: Found my networked printer automatically. Nice.
-
System: Turned on the SSH daemon here. Surprising and convenient. Then ran
ip address
, found the laptop IP, and tried to SSH in from my desktop. Nope.From root terminal, ran
apt install openssh-server molly-guard
. Thensystemctl start ssh
. That got it.Would a reboot have fixed it? Who knows?
-
At this point I was noticing huge lag spikes during typing in the terminal. 10 or 15 repeats of a key would get buffered up during a pause, which was really, really annoying. Obvious starting point would be a reboot, but wanted to do a couple more things now that I was SSH-ed in from my desktop where things were more convenient.
It had been another hour. I took a break.
I should take breaks more often during this stuff. I just want to power through it, though. It's frustrating to notice how much needs to be done just to make things work.
--
Came back late in the evening, having slept the laptop (I think?) unplugged for about six hours while I did other things. Battery was down to 85%, which was not a good sign if it really was asleep — needed to check that. Continuing with the adventure, the battery seemed to be dropping really fast. Was curious how the battery would perform in Ubuntu — really needed to be minimum three hours for some of the stuff I do.
Performance was garbage. Decided to reboot. Seems to have fixed it for now. I don't know.
-
Set up Firefox: This involved a surprising number of dialogs and options, and a password. But it seemed to work fine in the end.
-
Enabled SSH: Hadn't said
systemctl enable ssh
earlier, so needed to enable SSH and start it so it would be available on future reboots.
Plugged the hard Ethernet back in. My current home WiFi setup is kind of a mess.
-
Installed emacs: Specifically
emacs-nox
andemacs-common-non-dfsg
. Needed it, would keep needing it. -
Set the DHCP client identifier: Added it to
/etc/dhcpcd.conf
. Didn't appear to have changed anything, though. Decided to figure out later how to ensure that I got the right internal IP from DHCP. -
Sent over my dotfile kit: I have built up an infrastructure where I can run a
package-dotfiles
shell script and have all my portable personal dotfiles, scripts, etc to a tarball that can be copied to a remote machine and extracted into my home directory.Did this. Then realized I had accidentally done it as root on the laptop and extracted into
/root
. Sigh. Redid it: worked surprisingly well. Now I had my emacs configuration, among many other things.
At this point, the laptop terminal was very difficult to type in because of lag spikes and key repeating. Something was clearly quite wrong.
Oh, also, since Wayland means no setxkbd
I needed to
figure out how to set the Caps-Lock key to Control, or I
would go mad. Found this blog
post
which summarized why I had to switch to Wayland, and why I
really didn't want to, and maybe what to do about it. Left
it to explore later.
Oops. A warning popped up on the laptop: "Suspending soon because of inactivity." Apparently being ssh-ed into the box did not count as activity. Bleah.
-
Came back to DHCP: Discovered that Ubuntu uses "netplan" to manage the network. Found
/etc/netplan
which contained YAML files (ugh) to control stuff, which explained whydhcpcd.conf
was being ignored. Again left it to explore later. -
Set up SSH key: Used
ssh-keygen
to make an ED25519 keypair for my host to connect to my laptop. Copied the public key over and set it up inauthorized_keys
. Worked.Used
ssh-add
on the host to be able to avoid typing passwords for a bit. Figured this would speed things up.
OK, power seemed better than feared. About 10% down in an hour of moderate use.
-
Fixed up laptop sudo config: I have an… idiosyncratic idea of how local sudo should work. A bit of
visudo
later, and I had it how I wanted it. Gross but necessary for peace. -
Set a root password: Realized Ubuntu has no root password by default. Admirable, but not OK: wanted it as a backup. Fixed.
Figured I'd try the next one and then go to bed.
-
Installed Rust: Yeah, it's a critical use case.
apt-install rustup
followed byrustup install stable
just worked. Zero issues. Nice.After some messing around, installed my version of the Programming Rust
mandelbrot
. Failed to link becauserustc
was usingcc
by default? I thought we'd switched torust-lld
. What version was this anyhow? Ah, the default install didn't includellvm-tools
— fixable. Installedclang
because wanted it anyhow, and rebuilt. Build time was 17 seconds real, vs 15 for my big fast home box. That was fantastic news! Runtime was not so great: laptop 1.9 seconds vs home box 1.1 seconds. However, this is a benchmark that uses a lot of cores: home box is 12-core/24-ht, laptop is 8-core. It's a laptop: it will be fine. The compiles consumed about 1% of power each. Fair enough.
Was bedtime. Power was at 70%. Left the laptop unplugged and suspended overnight to see how it did.
2024-12-05
Got up after seven hours or so. Apparently the laptop hadn't suspended. Power was down to 35%. Plugged it in and left it for later. Wow, charging was fast. About 10% in ten minutes, while running.
Oh, right. Made a list of things marked "deal with later":
-
Display font size final adjustment
-
Fixing keymap
-
Typing issues
-
DHCP client side
-
Sound(!)
-
rust-lld
-
Installed
rust-lld
: A weird side-effect of using the Debian packaging ofrustup
is that I never got to set up a "normal" Rust environment.cargo install rust-lld
worked, but still didn't have$HOME/.cargo/bin
in my necessarily in my path because no$HOME/.cargo/env
. After staring at it for a while, just reinstalledrustup
usingcurl
, thenapt install --reinstall rustup
to make sure the one in/usr/bin
was current, then deleted therustup
in$HOME/.cargo/bin
to avoid confusion. There were still a bunch of corresponding files between/usr/bin
and$HOME/.cargo/bin
, but didn't seem worth playing with for now. -
*Set up "reverse" SSH:" Made a new SSH key on the laptop and installed it on my host. Set up
.ssh/config
on my laptop.Except I didn't. I wiped out my SSH config on my host instead, because screwup. Complete disaster. Backup time. Hey, at least learned how to restore files on my new backup system!
Tried again. Succeeded.
Suddenly, a wild failure appeared! The laptop popped up a problem dialog. Looks like my dhcpcd screwing around earlier left things borked? While dealing with this, my laptop locked hard and needed to be "hard" powered-off and rebooted.
I became doubtful I was going to keep this thing.
-
Restored
/etc/dhcpcd.conf
: This was harder than it looked:apt
really didn't want to install a fresh copy of the file. Finally fixed it byapt remove --purge dhcpcd-base
followed by reinstalling it and all the things that had been removed by uninstalling it. Ugh. -
Fixed the lid switch: Made the lid switch not suspend the laptop when powered. Consensus of the internets was to just edit
/etc/systemd/logind.conf
. Nice…
Tried disabling "disable touchpad while typing". Didn't seem
to fix the keyboard problems. top
showed nothing
interesting. Laptop latency spikes continued and worsened.
Apparently installing Linux 6.12 will fix sound. Have to go to work. Will return to it later.
2024-12-06
-
Installed the latest kernel: Spent a good hour trying to figure out how to set up https://kernel.ubuntu.com/mainline as an
apt
source. Finally just gave up and clicked on the fourlinux-*.deb
files I wanted like a chump, then copied them to the laptop and usedapt
to install Linux 6.13.0-rc1.The kernel was not signed, so ultimately had to disable Secure Boot in BIOS; then booted it fine. Made a mental note to fix that in the indefinite future when a working signed kernel became available. Would Windows boot without Secure Boot enabled? Who knows?
Even with the newer kernel, sound still didn't work. Surprising. Did find a Phoronix article saying this kernel should fix the keyboard and mouse lag spikes and whatnot I had been experiencing. Time would tell.
Time immediately told. Keyboard and mouse lag spikes continued.
Thought to look in the kernel log and found where the kernel sound stuff was crashing with a null pointer deref. I love C.
Tried again with Linux 6.12.3. Something hung hard enough I needed a 60-second hard powerdown. Eventually came back up. Seemed to work without kernel panics, so decided to keep it for now.
Sound still didn't work.
-
Got sound working: Had found this https://forums.gentoo.org/viewtopic-t-1171193-start-0.html which mentioned getting Lunar Lake audio working. Having gotten a new kernel, seemed like time to explore. Unfortunately, looked like I probably maybe had all the modules I needed.
Then went with this https://forum.manjaro.org/t/no-sound-dummy-output-on-asus-zenbook-s14-lunar-lake-under-6-12-0-rc2/170460 . Went through the complicated process of installing the latest Intel SOF firmware and… success! As I rebooted I got sound.
The running Pipewire version is a little stale but functional.
Reviewed my to-do list.
-
Display font size final adjustment
-
Fixing keymap
-
Typing issues (lag spikes)
-
DHCP client side
-
~~Sound(!)~~
-
~~
rust-lld
~~ -
Fixed font sizes: The first item was easy. The display font I chose was a little large even for the hidpi display. Went back from 300% display scaling to 200%. This still left the terminal font too small, so installed Bitstream Vera Sans Mono and set it to a reasonable size for 80×24.
If it weren't for the lag spikes, this thing would be starting to feel like home. Had to believe that a kernel update would catch that.
-
Fixed lag spikes(!), fixed grub boot menu size: Found this https://bbs.archlinux.org/viewtopic.php?id=300155 in my backlog, which suggested a kernel boot argument of
intel_idle.max_cstate=1
.While applying this by editing
/etc/default/grub
, also updated GRUB's idea of the display resolution to something more sane.Both of these things seemed to work! Without the lag spikes, this was probably a viable machine.
To-do list was now
- ~~Display font size final adjustment~~
- Fixing keymap
- ~~Typing issues (lag spikes)~~
- DHCP client side
- ~~Sound(!)~~
- ~~
rust-lld
~~
This seemed manageable. Break time.
- Made the console usable: Ran
dpkg-reconfigure console-setup
and picked the largest VGA font offered. After much messing around, gave up on making it even bigger.
Along the way, checked that Windows still booted. Yep. Yay.
Switched to X11 for a bit! This was as easy as finding the little gear icon while signing in. Didn't work: system experienced some failure almost immediately. But good to know it should be on soon. Rebooted and went back to Wayland for now.
-
Fixed CapsLock: After a bunch of messing around on the internets, tried this
gsettings set org.gnome.desktop.input-sources \ xkb-options "['caps:ctrl_modifier']
and it immediately worked.
-
Set up my GitHub SSH key: Was fairly straightforward.
In the process, finally fixed the weird "command-not-found database" error message I'd been having. Maybe.
apt install --reinstall command-not-found
Nope. Idk. Removed the package. That shut it up.
It was bedtime again. I'd made progress. Getting close.
2024-12-07
The laptop had lost 30% power in 8 hours in unpowered sleep. Clearly sleeping was not a viable long-term alternative until someone fixed something.
Boot time through BIOS and Ubuntu seems to be about 25 seconds, with most of that in BIOS. Ugh.
-
Fixed DHCP client id: That was exciting. Like several excruciating hours of exciting. tl;dr…
nmcli con show nmcli con modify f92bba01-5461-3e40-9d31-610788c0350f ipv4.dhcp-client-id bartcarbon13.po8.org
Then go set the
dhcpd.conf
host
entry on the DHCP server box to haveoption dhcp-client-identifier "\000bartcarbon13.po8.org";
The
\000
is a "type id", becausedhcpd
is kind of borked.As far as I can tell, the GNOME NetworkManager GUI provides no way to set the
dhcp-client-id
. (The XFCE Network Manager GUI does provide this on Debian.)Learn to love
tshark
.shark -i ent0 -f 'port 67 or port 68' -w /tmp/packets tshark -r /tmp/packets -V >/tmp/decode
Now some decoded DHCP packets will be in
/tmp/decode
. -
Checked the Camera: Just worked right out of the box. Really nice camera, too. Even has a hard camera cover that also turns off the camera when you close it.
Great feature!
With that, I was done. I'd accomplished everything I could think of that really mattered. My Dual Boot Notebook dual-booted, and Linux worked well enough to use.
Conclusions
For all intents and purposes, Linux is not yet supported on the Lenovo X1 Carbon Gen 13 Aura Edition. I've put myself through a ridiculous amount of difficult fiddly diagnosis and repair. Even following my instructions, which may not work next week, it would be a big job to get this all up and working.
That said, now that I have the laptop mostly working I am rather fond of it. Assuming that the idle issues can be fixed, the boot time improved a bit and the X server made to work reliably, I think will be a great ride.
("A friend" who knows the insides of the X Server mumbled something about "atomic KMS modesetting" when I told my stories. Apparently there is a reasonable path to making X11 work if someone find the will.)
I found Ubuntu to be nice in a few ways, and annoying in others. The install experience was pretty bad compared to a Debian install, something I really did not expect. Ubuntu doesn't seem to have the package depth of most Debian-derived distros; I tried to install several things that seemed like they should be there but weren't. On the other hand, the polish of the UI and the really nice documentation on the Ubuntu website were great. I'm not sure whether internet searches for relevant information yielded more or less than they would have with stock Debian: seemed about even.
Anyhow, I'm going to pretend I have a working new laptop for now, and start tackling issues lazily as they arise like I usually do.
Thanks for listening.