Qubes R4.1 no proper boot device

Just installed a freshly downloaded Qubes R4.1.0 beta1 on my system. Got greeted with a Reboot and select proper boot device. Check UEFI troubleshooting page to set up efi and realize now it uses grub. Can you guys plz help me set it up in the right way.

do you mean that, there’s no qubes os entry in bootloader menu ? and can you tell. are you using dual boot / dual disk / trying to install to usb stick ?

Fresh new installation on an SSD using usb installer. No Qubes selection menu appears when booted. No other operating system installed.

attach your qubes os installation media, and boot into qubes os rescue, continue and enter your disk pass.

mount /dev/sdX1 /mnt/efi ## your /boot/efi device
mount /dev/sdX2 /mnt ## your /boot device

efibootmgr -v -c -u -L QubesOS -l /EFI/qubes/grubx64.efi -d /dev/sdX -p 1 ## you can change QubesOS to any name you like

umount /mnt/efi
umount /mnt

poweroff ## i prefer poweroff than reboot, my device issue.
1 Like

Tried those steps, and still it doesn’t work

run efibootmgr -v in the shell, can you take a full pict of the output ?

What I did earlier

And ended up with the same error

oh my bad, so sorry it should be -d /dev/sdX -p 1, in your case here’s the code :

efibootmgr -v -c -u -L QubesOS -l /EFI/qubes/grubx64.efi -d /dev/sda -p 1

try again.

Tried the corrected command still the same error. Might try reinstalling the Qubes all over again. Thanks for your help though

So I decided to investigate the grubx64.efi and found out that it’s entirely empty!

check in /boot/efi/EFI/BOOT folder are there any files end with .efi and .cfg? if yes : do efibootmgr -v -c -u -L QubesOS -l /EFI/BOOT/*.efi -d /dev/sda -p 1

Note : change * with filename you found inside. ex : BOOTX64.efi

Another option is rebuild the bootloader :

Boot device not recognized after installing

Some firmware will not recognize the default Qubes EFI configuration. As such, it will have to be manually edited to be bootable. This will need to be done after every kernel and Xen update to ensure you use the most recently installed versions.

  1. Copy the /boot/efi/EFI/qubes/ directory to /boot/efi/EFI/BOOT/ (the contents of /boot/efi/EFI/BOOT should be identical to /boot/efi/EFI/qubes besides what is described in steps 2 and 3):
 cp -r /boot/efi/EFI/qubes/. /boot/efi/EFI/BOOT
  1. Rename /boot/efi/EFI/BOOT/xen.cfg to /boot/efi/EFI/BOOT/BOOTX64.cfg :
 mv /boot/efi/EFI/BOOT/xen.cfg /boot/efi/EFI/BOOT/BOOTX64.cfg
  1. Copy /boot/efi/EFI/qubes/xen-*.efi to /boot/efi/EFI/qubes/xen.efi and /boot/efi/EFI/BOOT/BOOTX64.efi . For example, with Xen 4.8.3 (you may need to confirm file overwrite):
 cp /boot/efi/EFI/qubes/xen-4.8.3.efi /boot/efi/EFI/qubes/xen.efi
 cp /boot/efi/EFI/qubes/xen-4.8.3.efi /boot/efi/EFI/BOOT/BOOTX64.efi
  1. Point boot manager :
efibootmgr -v -c -u -L QubesOS -l /EFI/BOOT/BOOTX64.efi -d /dev/sdX -p 1
1 Like

Checked the efi/EFI/BOOT directory and it’s empty

Tried copying qubes files to BOOT but there’s no xen.cfg file but instead there’s grub.cfg

cd /mnt/efi/EFI/qubes
ls
fonts grub.cfg grubx64.efi xen-4.14.2.efi

Also I assume that the above steps apply to Qubes 4.0.4?

No it would work to with 4.1, here’s your :

cp -r /boot/efi/EFI/qubes/. /boot/efi/EFI/BOOT
mv /boot/efi/EFI/BOOT/grub.cfg /boot/efi/EFI/BOOT/BOOTX64.cfg
cp /boot/efi/EFI/qubes/xen-4.12.2.efi /boot/efi/EFI/qubes/xen.efi
cp /boot/efi/EFI/qubes/xen-4.12.2.efi /boot/efi/EFI/BOOT/BOOTX64.efi
efibootmgr -v -c -u -L QubesOS -l /EFI/BOOT/BOOTX64.efi -d /dev/sda -p 1
1 Like

Hey tried this, now boot device does show up but ends with this error:

xen 4.14.2 (c/s) EFI loader
Using configuration file ‘BOOTX64.cfg’
No Dom0 kernel image specified.

sorry been a while, i forgot to reply.

  • Boot into your qubes os rescue, continue and enter your disk pass / you can do with other system to make easier copy paste command.

  • Mount your /boot and /boot/efi partition into /mnt (boot) and /boot/efi (/mnt/efi) (the command below i provide to you if you use my mounting recommendation).

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-<YOUR DISK UUID> rd.luks.uuid=luks-<YOUR SECOND DISK UUID> rd.lvm.lv=qubes_dom0/root rd.lvm.lv=qubes_dom0/swap plymouth.ignore-serial-consoles rd.driver.pre=btrfs rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_THEME="/boot/grub2/themes/qubes/theme.txt"
GRUB_CMDLINE_XEN_DEFAULT="console=none dom0_mem=min:1024M dom0_mem=max:4096M ucode=scan smt=off gnttab_max_frames=2048 gnttab_max_maptrack_frames=4096"
GRUB_DISABLE_OS_PROBER="true"

copy above text to your /etc/default/grub then run 
grub2-mkconfig /mnt/efi/EFI/BOOT/BOOTX64.cfg

umount /mnt and /mnt/efi
poweroff

Note: you can check your disk uuid with ```ls -l /dev/disk/by-uuid/
if you just have 1 disk, delete additional "rd.luks.uuid=luks- in /etc/default/grub
if you have 2 disk, the first uuid is nvme0n1p3, second is nvme1n1p1 or sda3 and sdb1

everything should be work now.

1 Like

So after doing some deep digging and researching countless articles all over the internet, I found the solution right on the Qubes OS’s UEFI troubleshooting page and I was finally able to successfully boot the system. So I followed the guide to create a xen.cfg file and fill it with the current values. Then using this guide which was also suggested by you, I got to the point where the boot entry was visible in the boot menu, but after starting it ended up with a no kernel image found error. So I copied the vmlinuz kernel and initramfs files to mnt/efi/EFI/BOOT. And when I rebooted it started to load the OS. So then I decided to make an efi entry for the grub bootloader (since grub.efi, grub.cfg where in the BOOT folder) and to my surprise grub did show up and loaded by default. Interesting thing is if I decide to remove BOOTX64.efi entry with efibootmgr -b <boot order number> -B and its related files, grub doesn’t work. So I have to keep both the entries in order to start QubesOS.
I might try your latest suggestion to check if I can start with just the grub entry. Thanks for your help and you have been a great!

1 Like

On stable release, after installation i just have to copy the files and it’s ok. But now trying this new version I’m having problems, could you show me where I can find the correct values for xen.cfg, I’m having the same problem and I don’t know where I can find the correct one, I made the install on my Lenovo thinkpadt480 and the directory efi/EFI/qubes/ don’t have the .cfg file and I have no idea where i can find the current values for the r4.1.0-rc1(downloaded today) to create the cfg.

I followed the guide without the .cfg file

But in my case I need the .cfg to complete the steps and then I can enable mapbs and noexitboot on it and fix this boot problem

Where can I find the current values to create the cfg file, can someone past it here?

Just create the file using this command echo > xen.cfg. Then fill the file with the content mentioned in this guide. I’ve summarized it below. Just replace the kernel version (vmlinuz and initramfs file names) with the current installed version. Use the command uname -r to get your kernel version info. If your current kernel is 5.10.71-1.fc32.qubes.x86_64 then the content should be like this

[global]
default=5.10.71-1.fc32.qubes.x86_64

[5.10.71-1.fc32.qubes.x86_64]
options=loglvl=all dom0_men=min:1024M dom0_mem=max:4096M
kernel=vmlinuz-5.10.71-1.fc32.qubes.x86_64 root=/dev/mapper/qubes_dom0-root rd.lvm.lv=qubes_dom0/root rd.lvm.lv=qubes_dom0/swap i915.preliminary_hw_support=1 rhgb quiet
ramdisk=initramfs-5.10.71-1.fc32.qubes.x86_64.img