2016-03-05 18:12:01 -05:00
---
layout: doc
title: UEFI Troubleshooting
permalink: /doc/uefi-troubleshooting/
---
Troubleshooting UEFI related problems
========================================
2018-01-13 06:00:04 -05:00
Change installer kernel parameters in UEFI
---------------------
2018-01-31 17:44:03 -05:00
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.
2018-01-13 06:00:04 -05:00
2018-01-31 17:44:03 -05:00
**Change the xen configuration on a USB media**
01. Attach the usb disk, mount the EFI partition (second partition available on the disk)
02. Edit your xen config (`xen.cfg/BOOTX64.cfg`) changing the `kernel` key to add your kernel parameters on the boot entry of your choice
2018-01-13 06:00:04 -05:00
03. Install using your modified boot entry
2018-01-31 17:44:03 -05:00
**Change xen configuration directly in an iso image**
01. Get EFI partition boundaries `parted Qubes-R4.0-rc4-x86_64.iso unit B print`
02. 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`
03. Mount the loop device `sudo mount /dev/loop0 /mnt`
04. Edit `EFI/BOOT/BOOTX64.cfg` to add your params to the `kernel` configuration key
05. Save your changes, unmount and dd to usb device
2018-01-13 06:00:04 -05:00
2016-03-05 18:12:01 -05:00
2016-09-26 16:07:46 -04:00
Cannot start installation, installation completes successfully but then BIOS loops at boot device selection, hangs at four penguins after choosing "Test media and install Qubes OS" in GRUB menu
2016-03-05 18:12:01 -05:00
---------------------
There is some [common bug in UEFI implementation ](http://xen.markmail.org/message/f6lx2ab4o2fch35r ), affecting mostly Lenovo systems, but probably some others too. You can try existing workaround:
2016-08-28 01:28:49 -04:00
01. In GRUB menu< sup id = "a1-1" > [1](#f1)</ sup > , select "Troubleshoot", then "Boot from device", then press `e` .
2016-06-08 11:32:49 -04:00
02. At the end of `chainloader` line add `/mapbs /noexitboot` .
2017-05-11 20:12:02 -04:00
03. Perform installation normally, but don't reboot the system at the end yet.
2016-06-08 11:32:49 -04:00
04. Go to `tty2` (Ctrl-Alt-F2).
05. Enable `/mapbs /noexitboot` on just installed system. This step differs between Qubes releases:
2016-06-07 06:35:11 -04:00
2016-06-08 11:32:49 -04:00
**For Qubes 3.1:**
2016-03-05 18:12:01 -05:00
2016-06-08 11:32:49 -04:00
06. Execute `mount | grep boot/efi` and note device name (first column). It should be something like `/dev/sda1` .
07. Execute `efibootmgr -v` , search for `Qubes` entry and note its number (it should be something like `Boot0001` - `0001` is an entry number).
08. Replace existing `Qubes` entry with modified one. Replace `XXXX` with entry number from previous step, `/dev/sda` with your disk name and `-p 1` with `/boot/efi` partition number):
2016-03-05 18:12:01 -05:00
2016-06-08 11:32:49 -04:00
efibootmgr -b XXXX -B
efibootmgr -v -c -u -L Qubes -l /EFI/qubes/xen.efi -d /dev/sda -p 1 "placeholder /mapbs /noexitboot"
2016-06-07 06:35:11 -04:00
2016-09-27 00:12:05 -04:00
09. Compare new entry with the old one (printed in step 6) - it should only differ in additional options at the end, and look probably something like this:
Boot0001* Qubes HD(1,GPT,partition-guid-here,0x800,0x64000)/File(\EFI\qubes\xen.efi)p.l.a.c.e.h.o.l.d.e.r. ./.m.a.p.b.s. ./.n.o.e.x.i.t.b.o.o.t.
If instead it looks like:
Boot0001* Qubes HD(1,0,00000000...0,0x0,0x0)/File(\EFI\qubes\xen.efi)p.l.a.c.e.h.o.l.d.e.r. ./.m.a.p.b.s. ./.n.o.e.x.i.t.b.o.o.t.
2017-05-11 20:12:02 -04:00
then try passing `/dev/sda1` or `/dev/nvme0n1p1` or whatever your EFI partition is instead of `/dev/sda` and `-p 1` .
2016-09-27 00:12:05 -04:00
2016-06-08 11:32:49 -04:00
10. Now you can reboot the system by issuing `reboot` command.
2016-06-07 06:35:11 -04:00
2016-06-08 11:32:49 -04:00
**For Qubes 3.2 or later:**
2016-06-07 06:35:11 -04:00
2016-06-08 11:32:49 -04:00
11. Edit `/mnt/sysimage/boot/efi/EFI/qubes/xen.cfg` (you can use `vi` editor) and add to every kernel section:
2016-06-07 06:35:11 -04:00
2016-06-08 11:32:49 -04:00
mapbs=1
noexitboot=1
2016-06-07 06:35:11 -04:00
2016-06-27 15:22:42 -04:00
**Note:** You must add these parameters on two separate new lines (one
2017-05-11 20:12:02 -04:00
parameter on each line) at the end of each section that includes a kernel
2016-06-27 15:22:42 -04:00
line (i.e., all sections except the first one, since it doesn't have a
kernel line).
2016-06-08 11:32:49 -04:00
12. Now you can reboot the system by issuing `reboot` command.
2016-03-05 18:12:01 -05:00
System crash/restart when booting installer
-------------------------------------------
Some Dell systems and probably others have [another bug in UEFI firmware ](http://markmail.org/message/amw5336otwhdxi76 ). And there is another workaround for it:
2016-05-18 09:51:02 -04:00
1. In GRUB menu< sup id = "a1-2" > [1](#f1)</ sup > press `e` .
2016-03-05 18:12:01 -05:00
2. At the end of `chainloader` line add `-- efi=attr=uc` .
2017-05-11 20:12:02 -04:00
3. Perform installation normally, but don't reboot the system at the end yet.
2016-03-05 18:12:01 -05:00
4. Go to `tty2` (Ctrl-Alt-F2).
5. Execute:
2016-11-25 02:43:00 -05:00
sed -i -e 's/^options=.*/\0 efi=attr=uc/' /mnt/sysimage/boot/efi/qubes/xen.cfg
2017-01-14 09:30:07 -05:00
or if you're installing 3.2 execute:
sed -i -e 's/^options=.*/\0 efi=attr=uc/' /mnt/sysimage/boot/efi/EFI/qubes/xen.cfg
2016-03-05 18:12:01 -05:00
6. Now you can reboot the system by issuing `reboot` command.
2016-05-18 09:51:02 -04:00
* * *
< b name = "f1" > 1</ b > If you use rEFInd, you can see 3 options regarding the USB installer. Choose "Fallback Boot Loader" to enter the GRUB menu. [↩ ](#a1-1 ) [↩ ](#a1-2 )
2016-12-17 17:00:08 -05:00
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.)
2016-12-17 21:31:06 -05:00
1. Copy `/boot/efi/EFI/qubes/` to `/boot/efi/EFI/BOOT/` .
2. Rename `/boot/efi/EFI/BOOT/xen.efi` to `/boot/efi/EFI/BOOT/BOOTX64.efi` .
3. Rename `/boot/efi/EFI/BOOT/xen.cfg` to `/boot/efi/EFI/BOOT/BOOTX64.cfg` .
2017-04-18 15:27:26 -04:00
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
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 booting from installation media in "Rescue a Qubes system" mode.
2017-05-11 20:12:02 -04:00
1. 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:
2017-04-18 15:27:26 -04:00
- xen.cfg (empty, size 0)
- xen-(xen-version).efi
- vmlinuz-(kernel-version)
- initramfs-(kernel-version).img
2. Copy `xen-(xen-version).efi` to `xen.efi` :
cd /mnt/sysimage/boot/efi/EFI/qubes
cp xen-*.efi xen.efi
3. 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
4. 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"