I've been running Qubes OS on Machine A alongside Windows for a while. My setup involved storing the unencrypted /boot partition and the LUKS header on an external USB drive.
Recently, I planned to install Qubes on Machine B, also in a dual-boot configuration. However, the complexity jumped significantly:
Machine B has Secure Boot enabled because BitLocker requires it. On previous installs, I grew tired of toggling Secure Boot in the BIOS every time I switched operating systems.
I only have one USB drive. Managing separate
/bootpartitions for two different Qubes installations on a single thumb drive is messy.
After some experimentation, I found a way to solve both problems.
Sharing One USB Drive for Multiple Qubes Installations
The solution is elegant: Don't store /boot on the USB drive. Instead, move /boot to the encrypted internal disk partition. The USB drive's only job is to unlock that partition and hand over control to the system. Once I grasped this concept, implementation was relatively straightforward using the Arch Wiki and AI.
Some notes:
- The USB drive only needs an EFI partition containing the GRUB binary and the LUKS header files. In my case, these total less than 30MB.
- While recent GRUB versions support LUKS2, but only very recent commits supports Argon2. Fedora's version was too old, but the packages in Debian Sid worked. Arch shoud also work.
- I wrote a simple
grub.cfgthat loads the necessary modules (GPT, LUKS2), unlocks the partition viacryptomountusing the header file on the USB, and then passes control usingconfigfile. - For this setup, usually,
/bootcan just be a folder in the root directory/filesystem. However, because my root is on a thin-provisioned LVM logical volume (which GRUB does not yet support), I had to create a separate, standard LVM logical volume specifically for/boot. - I used
grub-mkstandaloneto create a bundled GRUB binary andefibootmgrto register it with the UEFI firmware. - When the kernel/initramfs boots from the now-unlocked
/boot, it doesn't "inherit" the unlocked state. To avoid typing the password twice, I embedded a LUKS keyfile into the initramfs to automate the second unlock. - To support both machines, I copied both LUKS headers to the USB. I then modified grub.cfg to detect the machine's UUID via
smbios, allowing it to automatically select the correct header and partition.
The Benefits
Compared to the standard "detached USB" method, this stores significantly less data on the unencrypted drive, making backups easier and security tighter.
It also solved a major headache: updates. Previously, I had to manually mount /boot before updating dom0 and remember to unmount it before rebooting. If I forgot and triggered a reboot of sys-usb, the system would often hang. Now, those days are over. I can update the system without the USB drive even being plugged in; the drive itself rarely needs updates.
Make Qubes OS Play Nice with Secure Boot
It turned out I misunderstood "Qubes OS doesn't support Secure Boot." What that actually means is that Qubes doesn't provide an out-of-the-box way to verify the entire chain (Xen, kernels, etc.).
However, if our goal is simply to allow Qubes to boot without disabling Secure Boot in the BIOS, it’s actually quite easy:
- Set up shim, register the entry with UEFI, and point it to my GRUB EFI binary.
- Ensure my GRUB binary contains an SBAT section. I used
objcopyto extract this from Debian GRUB binary, then included it viagrub-mkstandalone. - Disable MOK validation
mokutil --disable-validation. The MOK Manager actually refers to it by "Disable Secure Boot", but it doesn't actually affect UEFI or Windows. - Enroll my GRUB binary hash during the first boot.
That's it!
I was surprised by the simplicity. I expected to be wrestling with PK/KEK keys and accidentally bricking my Windows bootloader. Instead, learning how shim and MOK interact made the process painless.
Security Implications
To be clear: this method allows Qubes to run alongside Secure Boot, but it does not (yet) cryptographically verify the Xen image or Linux kernels.
However, since that data resides on an encrypted partition and the bootloader is on a detached USB, it meets my personal threat model. In the future, I may look into creating my own keys to sign the images properly.
I’m also considering moving the GRUB binary to an internal partition. If I embed the LUKS header directly into the GRUB binary and enroll its hash, the shim would theoretically notify me if the binary was tampered with. It’s not a perfect defense against physical access, but it's a significant step up from a standard unencrypted boot.
Comments