Cannot boot Qubes after switching to UEFI boot

I had to install Qubes in legacy boot mode because in UEFI boot mode (the default on my new PC), the Qubes installer just showed a blank screen. I was unable to switch to legacy boot mode without purchasing and installing a graphics card, because the Intel built-in graphics refuses to boot in legacy mode. But after installation I experienced two problems:

  1. After some time, the machine would drastically slow down. I suspect this is because the intel_pstate driver should be used but Qubes does not support this, at least not out of the box.

  2. After using it for a few days, I suddenly experienced rapid flickering and blanking of the middle 2/3rds of the display.

To try to solve both of these problems, I decided to remove my graphics card. However, the BIOS detected this and, because the Intel graphics doesn’t support legacy boot, it reset back into UEFI boot. So now the machine is booting straight back into Windows 11.

How can I boot back into Qubes, and how can I set it up for EFI boot?

I tried using the Rescue option on the installation USB, but just like the installer, that just gave me a blank screen after the boot menu.

From some Googling it seems like it may or may not be possible to boot into Qubes using kexec from a Linux live USB stick. But I don’t know how to do that. Can anyone give me any pointers?

Well you definitely have conflicting hardware technologies. If you can’t get qubes UEFI to work then unfortunately you will have to make a decision. Also if I am reading this right you are “dual” booting win & qubes environments which is not advised for many reasons.

You could do a full qubes install and then build win10/ maybe 11 hvm within qubes.

But sadly the conflicting hardware tech just isn’t going to work. I would Install aftermarket gxp card and run with that and leave Intel as much as possible out of the equation.

What makes things worse is, Windows 11 on this machine often crashes after a few minutes, so trying to use Windows to solve the problem is going to be difficult, and best avoided. I do, however, have an older Qubes 4.0 machine that I can use to write a live USB image to a USB stick. (This machine has a Qubes 4.1 installation.)

The other option, I guess, would be to put the graphics card back in, boot back into Qubes using legacy boot, and somehow install the EFI bootloader from within Qubes dom0. But I don’t know how to switch grub from MBR mode to EFI mode either. Any tips?

I had some troubles booting, and then using, Fedora from the Live USB, but I figured out how to fix the bootloader. Here’s the steps in case anyone finds this useful:

  1. On the old PC, start a terminal in an AppVM
  2. git clone
  3. sudo make install
  4. Download a Fedora ISO image
  5. Plug a spare USB key into a USB port - ALL DATA ON IT WILL BE ERASED BELOW
  6. sudo livecd-iso-to-disk --efi --format ext4 --nomac ~/Downloads/Fedora-Workstation-Live-x86_64-35-1.2.iso /dev/xvdi - adjust the name of your .iso file and USB device as appropriate
  7. Detach the USB device from the AppVM

Now, on the new PC:

  1. Ensure that UEFI boot is enabled and the graphics card is removed/disabled
  2. Remove the USB key from the old PC and plug it into the new PC
  3. Boot into the USB key
  4. Choose the option to Start Fedora-Workstation-Live (or whatever)
  5. Wait for it to boot and then choose “Try Fedora”
  6. Press Alt+F2
  7. Type gnome-terminal
  8. sudo bash
  9. Mount the Qubes installation as described in the documentation here. In my case I had to type crypsetup luksOpen /dev/nvme0n1p7 qubes and then mount /dev/qubes_dom0/root /mnt
  10. mount -t proc proc /mnt/proc
  11. mount -t sysfs sysfs /mnt/sys
  12. mount -t efivarfs efivarfs /mnt/sys/firmware/efi/efivars
  13. mount -o bind /dev /mnt/dev
  14. mount -t tmpfs tmpfs /mnt/run
  15. cat /mnt/etc/fstab
  16. Use blkid --uuid to find the /boot device whose UUID is given in the above file
  17. mount /dev/nvme0n1p6 /mnt/boot
  18. Use fdisk to find the ESP
  19. mount /dev/nvme0n1p1 /mnt/boot/EFI
  20. chroot /mnt
  21. grub2-install --efi-directory=/boot/efi. This will probably fail with an error about not existing. If so, you’ll need to install the relevant package using dnf. This is a bit tricky because Qubes’ dnf config doesn’t work in a chroot.
  22. grub2-install --efi-directory=/boot/efi. This will probably fail with an error about efibootmgr not existing. If so, you’ll need to install the relevant package using dnf. This is a bit tricky because Qubes’ dnf config doesn’t work in a chroot.
  23. grub2-install --efi-directory=/boot/efi. This should finally work with no errors now!
  24. exit the chroot
  25. Reboot
  26. Select Qubes in the boot menu

However, now I am again faced with a blank screen, and I can’t progress any further. Any suggestions?

The fix was to repeat the steps above up to step 20 and then install kernel-latest. Then reboot and go into the sys-net settings, and remove the “unknown” PCI device and replace it with my wifi chipset PCI device.

However, I am still experiencing display corruption on the disk unlock password screen, but that is something I can ignore.