11 KiB
layout | title | permalink |
---|---|---|
doc | UEFI Troubleshooting | /doc/uefi-troubleshooting/ |
Troubleshooting UEFI related problems
Change installer kernel parameters in UEFI
If you've installed successfully in legacy mode but had to change some kernel parameters for it to work, you should try installing in UEFI mode with the same parameters.
Change the xen configuration on a USB media
- Attach the usb disk, mount the EFI partition (second partition available on the disk)
- As
su
, edit your xen config (EFI/BOOT/BOOTX64.cfg
) changing thekernel
key to add your kernel parameters on the boot entry of your choice - Install using your modified boot entry
Change xen configuration directly in an iso image
- Get EFI partition boundaries
parted Qubes-R4.0-rc4-x86_64.iso unit B print
- Using the start address and the size of the EFI partition, setup a loop device for it
sudo losetup -o 524288 --sizelimit 30562304 /dev/loop0 Qubes-R4.0-rc4-x86_64.iso
- Mount the loop device
sudo mount /dev/loop0 /mnt
- Edit
EFI/BOOT/BOOTX64.cfg
to add your params to thekernel
configuration key - Save your changes, unmount and dd to usb device
Installation freezes before displaying installer
Some systems can freeze with the default UEFI install options.
You can try the following to remove noexitboot
and mapbs
.
If you have an Nvidia card, see also Nvidia Troubleshooting.
-
Follow the steps here to edit the
[qubes-verbose]
section of your installer'sBOOTX64.cfg
. You want to comment out themapbs
andnoexitboot
lines. The end result should look like this:[qubes-verbose] options=console=vga efi=attr=uc # noexitboot=1 # mapbs=1 kernel=vmlinuz inst.stage2=hd:LABEL=Qubes-R4.0-x86_64 i915.alpha_support=1 ramdisk=initrd.img
-
Boot the installer and continue to install as normal, but don't reboot the system at the end when prompted.
-
Go to
tty2
(Ctrl-Alt-F2). -
Use your preferred text editor (
nano
works) to edit/mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
, verifying thenoexitboot
andmapbs
lines are not present. This is also a good time to make permanent any other changes needed to get the installer to work, such asnouveau.modeset=0
. For example:[4.14.18-1.pvops.qubes.x86_64] options=loglvl=all dom0_mem=min:1024M dom0_mem=max:4096M iommu=no-igfx ucode=scan efi=attr=uc
-
Go back to
tty6
(Ctrl-Alt-F6) and clickReboot
. -
Continue with setting up default templates and logging in to Qubes.
Installation freezes before displaying installer / disable EFI runtime services
On some early, buggy UEFI implementations, you may need to disable EFI under Qubes completely.
This can sometimes be done by switching to legacy mode in your BIOS/UEFI configuration.
If that's not an option there, or legacy mode does not work either, you can try the following to add efi=no-rs
.
Consider this approach as a last resort, because it will make every Xen update a manual process.
-
Follow the steps here to edit the
[qubes-verbose]
section of your installer'sxen.cfg
. You want to modify theefi=attr=uc
setting and comment out themapbs
andnoexitboot
lines. The end result should look like this:[qubes-verbose] options=console=vga efi=no-rs # noexitboot=1 # mapbs=1 kernel=vmlinuz inst.stage2=hd:LABEL=Qubes-R4.0-x86_64 i915.alpha_support=1 ramdisk=initrd.img
-
Boot the installer and continue to install as normal, until towards the end when you will receive a warning about being unable to create the EFI boot entry. Click continue, but don't reboot the system at the end when prompted.
-
Go to
tty2
(Ctrl-Alt-F2). -
Use your preferred text editor (
nano
works) to edit/mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
, adding theefi=no-rs
option to the end of theoptions=
line. For example:[4.14.18-1.pvops.qubes.x86_64] options=loglvl=all dom0_mem=min:1024M dom0_mem=max:4096M iommu=no-igfx ucode=scan efi=no-rs
-
Execute the following commands:
cp -R /mnt/sysimage/boot/efi/EFI/qubes /mnt/sysimage/boot/efi/EFI/BOOT mv /mnt/sysimage/boot/efi/EFI/BOOT/xen-*.efi /mnt/sysimage/boot/efi/EFI/BOOT/BOOTX64.efi mv /mnt/sysimage/boot/efi/EFI/BOOT/xen.cfg /mnt/sysimage/boot/efi/EFI/BOOT/BOOTX64.cfg
-
Go back to
tty6
(Ctrl-Alt-F6) and clickReboot
. -
Continue with setting up default templates and logging in to Qubes.
Whenever there is a kernel or Xen update for Qubes, you will need to follow these steps because your system is using the fallback UEFI bootloader in [...]/EFI/BOOT
instead of directly booting to the Qubes entry under [...]/EFI/qubes
.
Installation completes successfully but then boot loops or hangs on black screen
There is a common bug in UEFI implementation affecting mostly Lenovo systems, but probably some others too.
While some systems need mapbs
and/or noexitboot
disabled to boot, others require them enabled at all times.
Although these are enabled by default in the installer, they are disabled after the first stage of a successful install.
You can re-enable them either as part of the install process:
-
Perform installation normally, but don't reboot the system at the end yet.
-
Go to
tty2
(Ctrl-Alt-F2). -
Enable
mapbs
and/ornoexitboot
on the just installed system. Edit/mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
(you can usevi
ornano
editor) and add to every kernel section:mapbs=1 noexitboot=1
Note: You must add these parameters on two separate new lines (one parameter on each line) at the end of each section that includes a kernel line (i.e., all sections except the first one, since it doesn't have a kernel line).
-
Go back to
tty6
(Ctrl-Alt-F6) and clickReboot
. -
Continue with setting up default templates and logging in to Qubes.
Or if you have already rebooted after the first stage install and have encountered this issue, by:
-
Boot into rescue mode.
-
Enable
mapbs
and/ornoexitboot
on the just installed system. Edit/mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
(you can usevi
ornano
editor) and add to every kernel section:mapbs=1 noexitboot=1
Note: You must add these parameters on two separate new lines (one parameter on each line) at the end of each section that includes a kernel line (i.e., all sections except the first one, since it doesn't have a kernel line).
-
Type
reboot
. -
Continue with setting up default templates and logging in to Qubes.
Installation completes successfully but then system crash/restarts on next boot
Some Dell systems and probably others have another bug in UEFI firmware.
These systems need efi=attr=uc
enabled at all times.
Although this is enabled by default in the installer, it is disabled after the first stage of a successful install.
You can re-enable it either as part of the install process:
-
Perform installation normally, but don't reboot the system at the end yet.
-
Go to
tty2
(Ctrl-Alt-F2). -
Execute:
sed -i -e 's/^options=.*/\0 efi=attr=uc/' /mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
-
Go back to
tty6
(Ctrl-Alt-F6) and clickReboot
. -
Continue with setting up default templates and logging in to Qubes.
Or if you have already rebooted after the first stage install and have encountered this issue, by:
-
Boot into rescue mode.
-
Execute:
sed -i -e 's/^options=.*/\0 efi=attr=uc/' /mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
-
Type
reboot
. -
Continue with setting up default templates and logging in to Qubes.
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.
-
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
-
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
-
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
Installation finished but "Qubes" boot option is missing and xen.cfg is empty
In some cases installer fails to finish EFI setup and leave the system without a Qubes-specific EFI configuration.
In such a case you need to finish those parts manually.
You can do that just after installation (switch to tty2
with Ctrl-Alt-F2), or by booting from installation media in rescue mode.
-
Examine
/boot/efi/EFI/qubes
(if using Qubes installation media, it's in/mnt/sysimage/boot/efi/EFI/qubes
). You should see 4 files there:- xen.cfg (empty, size 0)
- xen-(xen-version).efi
- vmlinuz-(kernel-version)
- initramfs-(kernel-version).img
-
Copy
xen-(xen-version).efi
toxen.efi
:cd /mnt/sysimage/boot/efi/EFI/qubes cp xen-*.efi xen.efi
-
Create xen.cfg with this content (adjust kernel version, and filesystem locations, below values are based on default installation of Qubes 3.2):
[global] default=4.4.14-11.pvops.qubes.x86_64 [4.4.14-11.pvops.qubes.x86_64] options=loglvl=all dom0_mem=min:1024M dom0_mem=max:4096M kernel=vmlinuz-4.4.14-11.pvops.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-4.4.14-11.pvops.qubes.x86_64.img
-
Create boot entry in EFI firmware (replace
/dev/sda
with your disk name and-p 1
with/boot/efi
partition number):efibootmgr -v -c -u -L Qubes -l /EFI/qubes/xen.efi -d /dev/sda -p 1 "placeholder /mapbs /noexitboot"
Accessing installer Rescue mode on UEFI
In UEFI mode, the installer does not have a boot menu, but boots directly into the installation wizard. To get into Rescue mode, you need to switch to tty2 (Ctrl+Alt+F2) and then execute:
pkill -9 anaconda
anaconda --rescue