03 April 2025

Adventures into using Desktop Linux - Part 2

Part 2. Booted back into Windows. Turns out that Windows and Linux generate separate pairing keys for Bluetooth devices - completely bollocksing up trying to use devices on both. More searching revealed this StackOverflow post, which led me to https://github.com/x2es/bt-dualboot - let's give that a punt.

Also, while I've been doing this, I've decided "screw installing Bazzite, one Linux environment is enough" - I'm just going to use gparted to expand the existing partitions. It really isn't worth the effort to have multiple, and I might as well just have the space for one. Also, frankly, I'm not enough of a masochist to go through all this crap twice. Might try Bazzite straight off the USB to test it, but the general purpose environment is enough.

Back to the bluetooth stuff. So, it involved installing python3-pip, and then doing sudo pip install bt-dualboot - which didn't work.

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Fun. So, let's try doing what it asks. Installed pipx at the terminal, and ran pipx install bt-dualboot, then pipx ensurepath as suggested, and following instructions in pipx completions - and ran echo 'eval "$(register-python-argcomplete pipx)"' >> ~/.bashrc to add it to bash. Also remembered fish is my preferred shell - must add that to the todo list, and add completions there too, but bash will do for now. Restarted the terminal as advised. Tried running  sudo bt-dualboot --sync-all --backup - and got command not found. No huge surprise really with a virtual environment. The command we were actually looking for here was sudo pipx run bt-dualboot --sync-all --backup - which sort of worked, but it couldn't find the Windows partition to mount. Clicked the Windows partition in the Cinnamon file browser, which mounted it via NTFS-3G on FUSE to a /media/rick/{long-hex-number} directory. Then it worked. (This did remind me that there's a kernel level NTFS driver pulled in from Paragon, which will likely give higher performance, but for the limited amount I'm going to be using NTFS access, I suspect it's overkill here, and there's something to be said for known good battle-hardened tech.)

Unfortunately, while it worked, I realised I'd then copied the wrong non-working keys from the Linux side to Windows. Derp. Okay. Time to un-pair and re-pair. Got it back on on the Linux side, let's reboot to Windows and see if it worked.

Side note, bit of an annoyance with Firefox, I specifically installed the en-GB version, yet it came with the en_US dictionary, which highlighted half the words in this document incorrectly as I typed it. Come on, do better Mozilla, it's not rocket science, install the right dictionaries with the localised install...

Okay. Couple of reboots later, couple of re-pairs of devices, and we're in business - we've got the same keys working between Linux and Windows for Bluetooth. Magic. Cool, another annoyance got rid of.

Realised I was getting annoyed with the login window appearing on all monitors. A quick hop into settings->login window->settings->Monitor and switching it to the laptop built-in display should fix that. It didn't. A minor annoyance and nothing to really worry about, but still, irritating.

Next, I want Input Leap installed. Annoyingly, it appears only Barrier, an old version of the software, is easily available in apt. I could manually compile and install it, or I can repackage. Or I can locate it in flatpak! Hurrah. Turns out going to https://flathub.org/apps/io.github.input_leap.input-leap, clicking the install button, then clicking the small flatpackref file fires it up in Software Manager, as an Unverified Flatpak. Fine, seems reasonable to me. Time to import the config file I exported in Windows. (Or not, that blatantly didn't work. Copied the SSL files though.) Okay. We're up and running. Cool.

So, what's next? Steam. Should probably install Steam. Oh, and a driver for the xbox controller, let's get that in too. Steam first though. On installing Steam, it tells me "you'll need the 32 bit version of the nVidia libraries" - specifically nvidia-driver-libs:i386.  They're not in the software installer, or in apt, though they can be accessed by enabling the appropriate i386 architecture. Quick bit of googling suggests "don't install that from the software manager, you're in for a world of pain". Good to know. (I'm going to put a summarised "how to get set all these annoying quirks sorted" document together after all this crap I'm going through. Headed to steampowered.com, and installed the .deb manually.

Ah. Yes. Fonts. I'll probably want to install a bunch of those. Backed them up before I wiped Windows, I'll just copy those in once I figure out how. This doesn't look too pretty:

Reminds me of old remote X sessions on a Sun box. Nostalgic, but ugly. Still, looks fine once signed in. Straight into Settings, Compatibility and enable Steam Play for all titles, left it on the default Proton Hotfix version for now and will change for individual games if they don't run well. Another bit of searching suggests I should probably update the nVidia drivers as the ones built-in to Mint are a bit old - which makes sense, Windows has updates for them every 3 minutes. A quick sudo add-apt-repository ppa:graphics-drivers/ppa in the terminal (or via the software manager if the GUI is preferred, I suspect) adds the latest ones to the driver manager. Yup, a jump from 550 to 570 available. Let's try installing that. Reboot time. Cool, no mokutil crap this time, that's nice.

Re fonts - Install ttf-mscorefonts-installer via your preferred package install method to get most of the basics. I'll just do those for now, and install others if necessary later.

Set Satisfactory installing as a quick test of this. In the meantime, I'd better install the xbox wireless driver. Looks like xone is the way to go. No nice easy way to install on Mint/Ubuntu as there's no packages - I get the feeling I'm going to be doing some packaging in the next week or two - this is the nature of open source, spot a problem, fix it, share it, everybody wins - but for now, old school compile it is. Cloned it, ran the sudo ./install.sh command, checked the log and saw that it had the signing command and key listed in the output so shouldn't get any pain with mokutil again, then remembered to actually finish following the instructions so it'd work. Quick pair up... and we're in business, and Steam could immediately see it. Nice. I don't need it for Satisfactory, but let's see what happens when I try to launch it.

Next: Figure out how to get Satisfactory Mod Manager working. Oh, that's nice, there's a Linux version. Downloaded that, moved it to ~/.local/bin, and it runs from the terminal, but I'd like an icon with a shortcut. Can't just right click the desktop and create one it seems. Hrm. Looks like you can create a shortcut by dragging with CTRL+SHIFT, but that didn't let me set an icon. Created ~/Applications/SatisfactoryModManager and moved it there for ease of visibility, along with a 32x32 and 64x64 icon from Github. Right clicking the launcher icon has an Edit Menu option. Into Games I go, add an entry for the created application, edit the desktop file. Still no icon though. Apparently it wants the Icon= line to be relative, and the file to be in ~/.icons. Sure. Still doesn't work. This is a pain in the arse.

Oh. Rebooted, and apparently my bluetooth headphones are no longer connected to the laptop, for no particular reason. Erm, cool? Hit search... then they reconnected again. Marked them as trusted, maybe that's a thing. Wonder why it's listed as "miscellaneous"... 

Okay. Back to my stupid desktop icon. Urgh... just noticed a second Icon= line in the file. Deleted that, now it works. But god, that was a pain in the arse. Turns out it does work just fine with a fixed path instead of in .icons. Okay. Found a program to to it. It'll cost me 51MB in a flathub install. Interesting, loading it up gave me a non-responsive program - until I realised it'd popped up a dialog box on another monitor. Ffs. This whole experience is making me pretty angry thus far. And the flatpak Input Leap decided it was going to be a dick about saving its configuration, or remembering the config file I'd provided it. Another bit of an argument and I finally got that to play ball. This definitely feels like life on hard mode. Why would a regular user want to put themselves through this?!

 So. Mods reinstalled for Satisfactory. Reloading the game. Immediately crashed on start trying to use DX12 by default. Switched to Vulkan rendering in options. And we're in! Right up until I hit Print Screen to take a screenshot to upload to here - and crashed it. Are you kidding me?! How is this such a shit experience?! Note to self, F12 is the Steam screenshot hotkey. Tried reloading it again. Promptly crashed on trying to load my game again. What the hell. Is this something dual-GPU related? Is it just crap? Hard to tell. Reloaded, went back into graphics options, and it claimed it was being forced into DX11. Added -vulkan on the command line, let's see what happens. I swear, all this is doing is making me want to move all my games back to Windows, this isn't worth the pain.

Oh. Wow. So if you alt+tab out of some Steam games, Proton/Wine dies horribly for no particular reason.  That is... definitely something.

Tried switching to nVidia performance mode on the GPU. My portrait monitor is back in landscape again. *sighs and resets it again* Oh, and my ssh-agent won't work any more, because of this bug - so you can't sign out of your user and log back in and expect things to work like they should. Good lord.

Okay. Yup, turns out it does appear to be related to the dual GPU AMD/nVidia setup. It does not like it, and worked just fine once I turned on the nVidia performance mode. Could alt+tab no issue there. Even got my screenshot. Which it turned out Steam stored in ~/.local/share/Steam/userdata/33012702/760/remote/526870/screenshots - wtf. Found the option under Settings->In Game->Save an external copy of my screenshots and set them to a sane location (like in ~/Pictures/Steam Screenshots). What's with that batshit screenshot directory? Though doing a bit of reading suggests it pulls the same shit on Windows. That's just a weird and non-user-friendly setup, Steam.

 

Found the screenshot. Eventually.
 
Of course, if I disable the AMD graphics, I lose a screen, as the nVidia card can only support 4. Guess it's what I get for not replacing the three 24" ones with the big one I've been talking about for ages, most people aren't mental enough to be running 5 screens off a laptop. But still... there's definitely a "ffs" going on here. (Edit: turns out turning on the nVidia as the primary card did actually work and solve much of the problems, including the ALT+TAB issue - but then the laptop's internal screen that was hooked up to the AMD card just stopped working at random later that session. Er... great?)
 
Seriously considering just sacking off Mint / Ubuntu bases and going for something Arch-based here - a suggestion that I've noticed a few times across various forums. I really wish I could just run FreeBSD on the lot, but it's way pickier about hardware. Maybe NetBSD... heh.
 
Hrm. What to do with this now. Installed Telegram, that was simple enough. WhatsApp I'm preparing for a battle for if I want to make calls, possibly using the Android version under Waydroid. I'm not sure I want to continue with the pain of this, but at least it's all being documented up so I can use the information if I do decide to flatten and reinstall.

More to follow - if I've not got so fed up with this whole experiment that I've decided to quit computing and gone to find a nice cave to hide in with no internet. But I do have an annoying habit of stubbornly finishing a job after starting out of sheer bloody mindedness.

02 April 2025

Adventures into using Desktop Linux again for the first time in years - Part 1

Windows 11 has finally annoyed me enough with the pushy AI, schizophrenic half-classic half-"Modern" (aka TIFKAM*) interface, and generally not being the greatest performance wise, even though I'm on reasonable hardware (a Lenovo Legion Legion 5P 15ARH05H). So I decided to go on an adventure back into Desktop Linux. My distributions of choice to try this time - Linux Mint 22.1 Cinnamon, and Bazzite, for a pure gaming distro. I figured I'd document the good and the bad here.

First things first, I tried doing a Refresh My PC on Win11 to reinstall a minimal version, because some games just plain don't work on Linux yet due to anti-cheat. (Looking at you, Destiny 2. (Call of Duty MW2 is in the same boat, but that's degenerated into a complete crapshoot now - I used to love playing DMZ, but it's very much dead and full of cheats. C'est la vie.) That decided to keep cancelling on me every time I tried, so I eventually gave up, created boot media, and just blatted it with a SHIFT-F10, diskpart, and clean on both drives, creating a couple of dedicated partitions across the two drives in the laptop. Easy enough, and simple enough to get back up and running. I'm under no illusions of what definitely won't work on Linux, as I've got a Steam Deck. But I digress.

Things I knew I was going to have to work around: Missing Phone Link on Windows 11 (I figure I can use KDE Connect or something similar on both Windows and Linux), the aforementioned games, and a few bits of software that was probably going to grumble about being run under Wine or a VM. 

So here we begin the journey. As I knew I was going to be doing a dual boot with Bazzite (because why not, might as well try out a dedicated gaming one. I'll probably regret that, but not like I can't delete it later). Installed Ventoy on a flash drive, and copied on the ISOs for Mint, Bazzite and Gparted Live (because naturally Windows' disk management is often a git about shrinking partitions). Rebooted, forgot about the joy of Secure Boot, and promptly got a mokutil screen - something I'm familiar with. Easy enough, just go in, install a key from the flash drive (in a folder conveniently labelled "VTOYEFI" followed by an "ENROLL_THIS_KEY_IN_MOKMANAGER" entry). At least, it would have been simple had I read the instructions about Secure Boot on the Ventoy website in the first place, but let's pretend it all went smoothly like it did the second time round. 🫠 So far, so good. Fire up gparted live... and watch it crash horribly because I've got both the CPU integrated AMD graphics and the discrete nVidia graphics enabled. Good start. Head into EFI setup, disabled the onboard GPU, and off we go again. Re-partitioned up, all fine so far, and then back into setup to re-enable the hybrid graphics. (Also, another minor annoyance, no USB keyboard support in GRUB via USB3 ports it appears. I'll have to look to see if there's a legacy keyboard enable option in the BIOS like on my old PC at some point. Maybe rEFIt will be more sane.)

Booted off the USB again, and into Mint. Worked fine, picked up the two displays connected (laptop and one external on HDMI at the time). Hit the install button, manually partitioned it up with a view to throwing 75GB on the system drive for Mint and starting with 375GB for a /home partition on the second SSD, both ext4 - boring but reliable. Chose to encrypt the home directory, mostly to see  Did consider setting up ZFS - I'm a big fan of ZFS - but it seemed like a lot of hassle for an initial install. So far, so good. Installed up fine. Went through the welcome screen setup, chose a dark theme, set up system snapshots (nicely done with hardlinks via Timeshift, that's cool), installed the latest proprietary nVidia drivers via the Driver Manager, installed updates and configured local mirrors, so far so good. Was weird installing via a GUI, my usual method is all CLI, but it was pleasant enough.

Then decided to uninstall Thunderbird (I use Gmail at the moment, I can consider TB if/when I finally migrate away from that), and added a couple of packages. Added the Mozilla Nightly repo and installed Firefox Nightly, KeepassXC and Dropbox. First two went fine. The third, the Dropbox native client, it turns out isn't at parity with Windows and doesn't believe in online-only storage and caching on demand, and promptly decided to try and download 400GB onto the 375GB home partition. Erm... nope. Promptly signed out and deleted the Dropbox folder - guess I'll be finding an alternative client or method for that then.

In the meantime, I'd tried running updates from the Update Manager, and it started whinging about 403 errors from one of the mirrors. I rolled my eyes, and changed mirror, then promptly closed the update manager and went to the command line, and did a straight "apt full-upgrade". Cool, that did what it was supposed to do. Attempted to reboot, and was faced with this: 

Now there's the desktop Linux experience I remembered. Quick web search suggested it was wifi related. It wouldn't go away, I shrugged, hard powered down, and rebooted. Remembered how ugly the Grub default boot menu is, and made a note to install rEFIt later.

Booted back into the desktop. Noted the complete lack of any other monitors than the built-in one.  Guess that nVidia driver worked well then. Peachy. Guess I'll be going to search for why that is then. Did spot an option in the nVidia settings called "PRIME Profiles", which I'm guessing is the "use the built in GPU unless we're doing something beefy", but changing the setting and rebooting did nothing. Plus side, that lockup I saw earlier around the WiFi card didn't happen this time.Maybe because I'd connected to the wifi network on the laptop, or maybe it was the system update. I was just happy it went away.

Ahh. Of course. A bit of investigation suggests the issue is, unsurprisingly, my old friend Secure Boot from earlier. I don't know why I bothered trying to keep it enabled, it's an absolute pain in the arse. Should have known really, I've been arguing with secure boot and CrowdStrike modules today at work with a very similar outcome, and my response there was also "kill secure boot". I did spot a mokutil screen appear when I booted earlier, but didn't really know what to do with it at the time, so I suspect I just exited, and promptly failed to sign the appropriate driver. I do remember it asked me to add a password for signing... derp. Back to Nouveau I go and reinstall it then I suspect, it's likely the least painful option. Time to reboot again...

Yup. That got me back onto 5 screens. Set the left one to portrait, and got greeted with this, which I'm hoping is just an anomaly with the driver.


Bit borked, that. Let's try installing the nVidia drivers again... time to reboot. Hopefully I get said signing screen.

Spoiler: I did not.

Another bit of hunting on the web, and the data seems to suggest I need to sign it with a .der file that is on the laptop. Found one that looks suspiciously like what I'm looking for - /var/lib/shim-signed/mok/MOK.der, and a corresponding private file. Running it through openssl suggests it could be it.

Found a page on how to install nVidia drivers in Mint via the Mint forums. Noticed the following command on there: sudo update-secureboot-policy --enroll-key. Went through a very similar process to the one I went through earlier via the GUI when I first installed multimedia codecs. Looks like that might be the thing that forced mokutil to re-prompt. Let's try giving it another reboot and see what happens.

Behold! The mokutil blue screen. Went to "Enroll MOK", checked the certificate (matched what I'd seen previously from OpenSSL), enrolled it, rebooted, and I have all my screens working. Complete with a non-flickering portrait monitor. Cool, that's a good start. It'd have been nice if I'd been told what I needed to do before I got to that screen previously - maybe one to comment as a feature improvement later to the Mint folk - but at least we got there in the end. Thankfully I'm a pretty seasoned Linux user, or I'd likely have been banging my head against the wall for a bit there.

(I have to say at this point I'm beginning to question my decision to install two distributions, but I've started, so I'll finish.) 

Okay. So far so good. Sound works. Doesn't appear to have the dual speaker / line out option that Windows does, but I don't care terribly much, as I'm generally using one or the other anyway. Time to try and connect to my Bluetooth headphones. Double click on Bluetooth Devices, turn the device on, and look confused as to how I'm supposed to do so. Ah, of course, the entirely intuitive Adaptor->Search. The same Search on the toolbar that is greyed out, by the look of it 🙄 Okay. Let's connect to the WH-1000XM3s. "Pairing failed." Tried right clicking on the headphones and clicking get info, and this happened:

Some weird always-on-top window appeared above the info panel. Wouldn't go away either. It also masked the screenshot utility I was trying to take that screenshot with. Thankfully ALT+SPACE and Move works just like Windows does. But that's an annoying bug. (Oh. Found out that annoying window was from the Emoji package listed below. Had to close the window from the task bar. Emoji popup thing still works. Wonder if that was related to the SUPER bug...)

As a side note, I just discovered that I have to install an Emote package to be able to pop up the equivalent of windows+full stop emoji picker to insert the above rolling eye emoji. The hotkey defaults to CTRL+ALT+E, but happily remapped to Win+Full Stop. - or, in UNIX parlance, Super and Full Stop - but weirdly, I have to press it twice to make it pop up with that combination. Meh, I can live with CTRL+ALT+E, it does make more sense.) I don't mind having to manually install the extra functionality though, it was somewhat the point of this exercise to only install the software and functionality I specifically wanted.

Another minor tangent I discovered while searching for said missing emoji picker - the Software Manager will seamlessly often either system-wide installation (classic install) or a Flatpak install, which are containers with a full set of dependencies as a static bundle, Ã  la Docker. I thought it was a choice, but it's just showing where it's going to install from. Have occasionally seen issues with Flatpaks - I remember having issues on the Steam Deck with KeepassXC not being able to talk to web browsers via the appropriate extensions due to restrictions with Flatpaks, something that doesn't occur with regular system packages - but this seems pretty seamless.

Hmm. Interesting. Just realised there's only a start bar (or "panel") on my primary screen, not the secondary monitors. And clicking on the Firefox icon when I've 2 windows minimised both, and would only restore one. Had to alt+tab to get to the other one. That's somewhat annoying too. Aha, though hovering over it did present both windows so I could restore the other one. That's something.

Now, by this point, I'm actually starting to appreciate how much easier Windows is to install and get working properly. I'm a good few hours into this, and Windows does have a tendency to mostly Just Work. This feels like it... well, does not.

Back to the Bluetooth setup. That greyed out search button stopped being greyed out, which is nice. Waiting for it to finish its scan, then try and pair again. Realised they'd re-paired to my phone when I switched them back on. Disconnected them from there, tried to reconnect again, no joy (though it did do the LE_WH-1000XM3 thing). Then they appeared as the WH-1000XM3s again - and they actually paired up. Nice, supports LDAC out of the box, and it looks like it auto-switched the audio to the device too. That works. Cool. Good time to install Spotify. Huh, there's also Spot (which was spotted, no pun intended, the other day on a plane on the Steam Deck) and Psst. The joy of many alternatives. Sod it, let's install them all and see what looks better. (Then spotted Spotube, yet another alternative for Spotify and YouTube music... too many choices...) Huh, turns out "psst" in the software manager is the "Power stress and shaping tool". Pretty sure that's not what I was looking for. Whatever, I'll just use the official client right now, can't be arsed messing about.

Oh. Yeah. No working (or at least useful) Dropbox client yet. *grump* I could install the official client and just not sync the giant 300GB folder with Insta360 videos in it, but I'm still feeling irritated about it. And for some reason the Spotify client doesn't have the login with QR code option that the Windows one does. Of course it doesn't. Guess I'll be pulling up Keepass2Android and trying to type this mess of random characters then for now. Yay. Still, it did work, and Spotify now plays.

Hmm. Instant messaging clients. I can have Telegram (or several extended open source versions) natively. WhatsApp? Forget it, they're just a bunch of web wrappers, and you aren't getting voice or video calls through it. That's annoying. One of the things I often do is answer WhatsApp/Telegram/phone calls via my PC (the latter via Phone Link). A bit of research suggests I may be able to do this via an audio gateway feature, but I'm putting that under "to do later", I'm already getting pretty tired and annoyed with this whole setup procedure. Did just pair the phone to the laptop over bluetooth, and it says I'm connected for calls and audio. Does that mean it's working on a basic level? Well, the phone is certainly using the PC's speaker or headphone output. I think it's working for a phone call (albeit I sound terrible), it's certainly not working for Discord on the phone. I'll have to try a WhatsApp and Telegram call with someone tomorrow, see if it works or not. I suspect the answer here may, sadly, simply be "hook the headphones up to the phone in the daytime", and WhatsApp calls on my desktop are a non-starter. mutters something about wanting unified clients

Urgh. Still need my password manager, which means I still need Dropbox. Fine. Guess it's getting installed with a very selective sync for now. Bleurgh. Annoying. Reinstalled it, briefly got the GUI that let me tweak the selective sync... then it's no longer available under preferences on the Dropbox app? What the shit, Dropbox? God, roll on my OwnCloud/NextCloud/whateverCloud install when I set my new server up. (Edit: The answer was rclone, which I couldn't find to save my life at the time.)

Sod this for a game of soldiers for now. I'm going to bed.

(He says - also just spotted https://github.com/winapps-org/winapps to investigate tomorrow. Which I just spent 20 minutes on. Bad Rick, no biscuit. Just discovered rootless Docker mode too. Which I'm pretty sure I just cocked up. Rabbit hole moment...)

2 hours later. Still here. Discovered the Easy Effects flatpak (not the system one, it's more faff than I could be bothered with getting the DeepFilterNet .so to load), and enabling the Deep Noise Remover on the input. Remarkably effective at removing the background hum of the UPS. Admittedly I shouldn't still be awake, but here we are...

* The Interface Formerly Known as Metro, as coined by The Register.

20 January 2022

Fix for Lenovo Legion 5P losing FreeSync compatibility in hybrid mode after updating AMD drivers

Upgrading the AMD drivers to an updated version is a Good Idea - see this post on The Register for an example - as the ones released by Lenovo are at least a year old. However, doing the regular upgrade wipes out the ability to use FreeSync with the built-in 144Hz screen, because it does a full settings reset and wipes the OEM customisations.

After some trial and error, the way to fix this is as follows:

  1. If you've already upgraded the drivers and lost FreeSync, use the AMD Cleanup Utility to delete any sign of existing AMD drivers.
  2. Reinstall the original drivers from the Lenovo support page for your laptop.
  3. Get the latest AMD Adrenalin software.
  4. Install it - but UNTICK the box that specifies "do factory reset". That's what breaks the existing configuration for FreeSync.

Successful results: