A few years ago I bought a new laptop that came with Windows 11. I hadn’t used Windows in a long time, thought WSL was really cool and decided to give it an extended trial.
WSL worked surprisingly well most of the time, in some ways I liked it even better than MacOS – it was real Linux, no more fighting with Brew. Still, it had it’s own issues, most notably a layer of abstraction between WSL and the network and devices. VSCode made a valiant effort to make it all transparent but somehow Windows kept poking through.
More recently, with all the AI integration into the OS and the persistent WSL and Docker Desktop crashes, I realized I didn’t really want the Windows anyway.
So, I installed Fedora (dual boot for now).
Some pleasant surprises
(Encrypted) Windows drive
I was able to mount my encrypted Windows drive directly from Nautilus! Just click on it and supply the recovery key when prompted. The Gnome keyring will even remember the password, if desired.
WSL drive
Accessing my WSL drive was a bit more of a challenge. First off, most pages I found were about importing Linux drives into WSL. The few pages I found about mounting the WSL virtual drive referenced libguestfs-tools. I tried to follow those instructions with no success. What finally worked was this sequence:
sudo modprobe nbd max_part=8
sudo qemu-nbd --connect=/dev/nbd0 '/run/media/<linux user name>/Windows/Users/<windows user name>/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_<random instance id>/LocalState/ext4.vhdx'
sudo mkdir /media/wsl2
sudo mount -r /dev/nbd0 /media/wsl2
It took some rummaging around on the Windows drive to find the right vhdx file – find is your friend.
Todo: Mount this automatically. See https://unix.stackexchange.com/questions/791753/how-to-automatically-mount-external-bitlocker-encrypted-drives-at-boot-on-linux for the Windows part. Maybe this for the nbd part: https://mattgadient.com/how-to-using-systemd-to-mount-nbd-devices-on-boot-ubuntu/.
Less pleasant surprises
Nextcloud
I use Nextcloud for file sharing. On Windows, Nexcloud supports virtual files. These files are retrieved on demand. That means I don’t have to download and store my whole Nextcloud share locally. There is supposedly “experimental” support for virtual files on Linux but even when it works, it isn’t at all transparent.
What I ended up doing for now is to set up two different Nexcloud shares. One with the Nextcloud client that selectively syncs only the files I need to have local copies of at all time and another using Gnome’s “Online Accounts” that acts kind of like an NFS or SMB share – online only..
KeepassXC
The first thing I noticed when I installed KeepassXC is that auto-type didn’t work – the Auto-Type tab was missing from the Settings entirely. My first instinct was to blame Flatpak so I uninstalled that and reinstalled as an RPM.
That didn’t change anything. Turns out this one was Wayland’s fault.
I needed to add QT_QPA_PLATFORM=xcb to my environment. That did fix the issue but I couldn’t find a pretty way to add it just for keepassxc that would work when I launched from Gnome. I ended up writing this wrapper script and putting it in ~/bin:
#!/bin/bash
real="$(PATH="${PATH##*"$HOME"/bin:}" which "${0##*/}")"
QT_QPA_PLATFORM=xcb exec "$real" "$@"
What this does is find the “real” keepassxc by stripping everything up to and including the ~/bin directory from the path and then searching for keepassxc again. Then it invokes that keepassxc with any arguments that might have been passed in but adding QT_QPA_PLATFORM=xcb. Note that keepassxc isn’t mentioned anywhere in this script – it can be used to wrap any program that might need this variable set – just make links to the same file.