I recently tried to install Qubes OS alongside an existing Windows installation. It turned out to be surprisingly difficult—way harder than my last attempt—likely due to a combination of my encrypted /boot setup and older hardware. Here are some notes from the process.
Shrinking an NTFS Volume
I needed to free up some space from a Windows NTFS volume. Normally, this just takes a few clicks in Disk Management. This time, however, Windows reported a "shrinkable volume" that was suspiciously small.
Following this answer, I tried the standard fixes:
- Disabled hibernation (
powercfg /h off) - Disabled the pagefile
- Disabled system protection
This increased the shrinkable volume a bit, but nowhere near the actual free space left on the partition.
Digging into the Windows Application logs in Event Viewer, I finally found the culprit: The last unmovable file appears to be: \$Mft::$DATA. It turns out $Mft is a special block in NTFS that cannot be easily moved, and a simple defrag wasn't going to cut it. I tried a few third-party partition managers, but they all failed initially. Following a hint from one of the tools, I temporarily disabled BitLocker. That did the trick—AOMEI Partition Assistant was finally able to shrink the volume. Once it was done, I just had to re-enable everything.
Configuring the Display
I use a dual-monitor setup (let's call them A and B). The Linux console and GUI installer assumed monitor A was the primary display, leaving monitor B either completely blank (in the terminal) or showing an empty desktop (in the GUI). I wanted everything on B, and the usual Super+Arrow Key shortcut wasn't working.
Here is how I forced the display:
Turn Off the Display in the Terminal
Note: This forces the GUI installer to the correct screen, but doesn't change the terminal itself.
- Switch to the terminal (
Ctrl+Alt+F2). - Find the "bad" display in
/sys/class/drm/. - Run
echo off > /sys/class/drm/card0-<DEVICE_NAME>/status.
- Example:
echo off > /sys/class/drm/card0-HDMI-A-1/status
- Switch back to the GUI (
Ctrl+Alt+F6). The installer should now be forced onto the only "active" screen.
Turn Off the Display via Kernel Parameters
- First, find the device/port name by running:
ls -d /sys/class/drm/card*-*. Examples:
/sys/class/drm/card0-DP-1(Integrated)/sys/class/drm/card1-HDMI-A-1(Discrete)
- Add something like
video=eDP-1:dto the kernel parameters. - This gets more complicated when the ports are the same but the cards are different, though I haven't tested that scenario.
GRUB and Encrypted /boot
GRUB 2.12 supports LUKS2, but it doesn't support the Argon2 hashing algorithm—that didn't arrive until GRUB 2.14.
While GRUB 2.14 works perfectly on my newer machine, it refused to boot properly on this older one. After hours of troubleshooting, I realized that while GRUB 2.14 could boot directly into Linux, but it failed completely when trying to boot through Xen. Suspecting the issue lay somewhere between GRUB and Xen, I eventually gave up and downgraded to GRUB 2.12, changing my LUKS partition to use PBKDF2 instead of Argon2.
Another quirk: GRUB's decryption implementation feels about 100 times slower than cryptsetup. It likely lacks hardware acceleration for decryption, and the -A parameter isn't available for the cryptomount command in my version of GRUB. To keep boot times reasonable, I had to decrease the number of PBKDF2 iterations in LUKS.
LVM Issues
Xen and Linux finally booted, but the celebration was cut short. The boot process stalled, complaining that the /dev/mapper/boot device timed out, and it wouldn't even let me enter the rescue shell.
I fixed the rescue shell issue by booting from a live USB and giving root a password. The timeout issue, however, was much weirder. It turned out that only the LVM logical volumes specifically listed in the rd.lvm.lv kernel parameters were being unlocked; the rest were completely invisible. Even running vgs and lvs returned empty results.
I was eventually able to recover everything using the vgimportdevices -a command. Oddly, this created a duplicate LVM entry in the system.devices file, and manually removing the duplicate broke everything again. I ended up just deleting the file entirely and letting vgimportdevices recreate it from scratch. It’s been running smoothly ever since.
Secure Boot
Just as I got Qubes OS working with Secure Boot enabled, Windows broke. The UEFI complained that the boot signature wasn't recognized.
After some debugging, I figured out what happened: I had reset the Secure Boot keys on my motherboard to their factory defaults. Because the laptop is old, the factory defaults only contained the 2011 Microsoft keys. However, my Windows boot loader had been updated and was signed with the newer 2023 key.
I tried copying the Secure Boot database from another machine, but that failed (likely due to PK/KEK mismatch issues). After hours of trial and error, I solved it with a combination of the following actions:
- Set Secure Boot to Setup mode.
- Reset to factory keys
- Update Secure Boot variables via Windows registry and scheduled tasks (source)
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Secureboot /v AvailableUpdates /t REG_DWORD /d 0x5944 /f
Start-ScheduledTask -TaskName "\Microsoft\Windows\PI\Secure-Boot-Update"
# Manually reboot the system when the AvailableUpdates becomes 0x4100
Start-ScheduledTask -TaskName "\Microsoft\Windows\PI\Secure-Boot-Update"
- Boot
SecureBootRecovery.efifrom the Windows EFI partition.
I suspect running SecureBootRecovery.efi was the magic bullet, though the other steps likely set the stage. Surprisingly, this file never came up in my online troubleshooting; I just stumbled across it by accident while browsing the EFI partition.
Final Thoughts
Looking back, I definitely stacked too many tricky components together—older hardware, dual-booting, encrypted /boot, LVM, and Secure Boot—and hit a bit of bad luck along the way. Fortunately, it all worked out in the end. What a journey!
Comments