2016-03-05 18:12:01 -05:00
---
2021-03-13 13:06:18 -05:00
lang: en
2016-03-05 18:12:01 -05:00
layout: doc
2021-06-16 22:56:25 -04:00
permalink: /doc/uefi-troubleshooting/
2021-03-13 13:06:18 -05:00
ref: 177
2023-04-24 22:07:22 -04:00
title: UEFI Troubleshooting
2016-03-05 18:12:01 -05:00
---
2018-01-13 06:00:04 -05:00
2023-04-24 22:07:22 -04:00
## Successfully installed in legacy mode, but had to change some xen parameters
**Note**: If you make changes, you must boot from "Partition 1" explicitly from UEFI boot menu.
2018-01-13 06:00:04 -05:00
2018-01-31 17:44:03 -05:00
**Change the xen configuration on a USB media**
2021-03-13 12:03:23 -05:00
01. Attach the usb disk, mount the EFI partition (second partition available on the disk)
2023-04-24 22:07:22 -04:00
02. Open a terminal and enter the command `sudo su -` . Use your preferred text editor (e.g `vi` ) to edit your xen config (`EFI/BOOT/grub.cfg`):
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
vi EFI/BOOT/grub.cfg
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
03. Change the `multiboot2 /images/pxeboot/xen.gz` line to add your xen parameters on the boot entry of your choice
2020-10-05 11:12:26 -04:00
04. Install using your modified boot entry
2018-01-13 06:00:04 -05:00
2018-01-31 17:44:03 -05:00
**Change xen configuration directly in an iso image**
2021-03-15 18:14:10 -04:00
01. Set up a loop device (replacing `X` with your ISO's version name): `losetup -P /dev/loop0 Qubes-RX-x86_64.iso`
02. Mount the loop device: `sudo mount /dev/loop0p2 /mnt`
2023-04-24 22:07:22 -04:00
03. Edit `EFI/BOOT/grub.cfg` to add your params to the `multiboot2 /images/pxeboot/xen.gz` line
2021-03-15 18:14:10 -04:00
04. Save your changes, unmount and dd to usb device
2018-01-13 06:00:04 -05:00
2021-03-13 12:03:23 -05:00
## Installation freezes before displaying installer
2020-10-02 04:15:32 -04:00
2023-04-24 22:07:22 -04:00
If you have an Nvidia card, see [Nvidia Troubleshooting ](https://github.com/Qubes-Community/Contents/blob/master/docs/troubleshooting/nvidia-troubleshooting.md#disabling-nouveau ).
2021-03-13 12:03:23 -05:00
2019-08-24 02:27:36 -04:00
2021-03-13 12:03:23 -05:00
## Installation from USB stick hangs on black screen
2020-06-03 06:12:41 -04:00
2021-03-13 12:03:23 -05:00
Some laptops cannot read from an external boot device larger than 8GB. If you encounter a black screen when performing an installation from a USB stick, ensure you are using a USB drive less than 8GB, or a partition on that USB lesser than 8GB and of format FAT32.
2019-08-24 02:27:36 -04:00
2021-03-13 12:03:23 -05:00
## Installation completes successfully but then system crash/restarts on next boot
2016-03-05 18:12:01 -05:00
2019-08-24 03:19:32 -04:00
Some Dell systems and probably others have [another bug in UEFI firmware ](http://markmail.org/message/amw5336otwhdxi76 ).
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:
1. Perform installation normally, but don't reboot the system at the end yet.
2. Go to `tty2` (Ctrl-Alt-F2).
3. Execute:
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
sed -i -e 's/ucode=scan/\0 efi=attr=uc/' /mnt/sysimage/boot/efi/EFI/qubes/grub.cfg
2021-03-13 12:03:23 -05:00
```
2019-08-24 03:19:32 -04:00
4. Go back to `tty6` (Ctrl-Alt-F6) and click `Reboot` .
5. Continue with setting up default templates and logging in to Qubes.
2016-03-05 18:12:01 -05:00
2019-08-24 03:19:32 -04:00
Or if you have already rebooted after the first stage install and have encountered this issue, by:
2016-03-05 18:12:01 -05:00
2023-04-24 22:07:22 -04:00
1. Boot Qubes OS install media into [rescue mode ](/doc/uefi-troubleshooting/#accessing-installer-rescue-mode-on-uefi )
2016-03-05 18:12:01 -05:00
2023-04-24 22:07:22 -04:00
2. Press '3' to go to the shell
3. Find and mount the EFI system partition. (replace `/dev/sda` with your disk name. If unsure, use the `lsblk` command to display a list of disks):
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
fdisk -l /dev/sda | grep EFI
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
The output should look like this:
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
/dev/sda1 2048 1230847 1228800 600M EFI System
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
Then mount it:
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
mkdir -p /mnt/sysimage/boot/efi
mount /dev/sda1 /mnt/sysimage/boot/efi
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
4. Execute:
2018-05-23 23:50:55 -04:00
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
sed -i -e 's/ucode=scan/\0 efi=attr=uc/' /mnt/sysimage/boot/efi/EFI/qubes/grub.cfg
2021-03-13 12:03:23 -05:00
```
2019-08-24 02:27:36 -04:00
2023-04-24 22:07:22 -04:00
5. Type `reboot` .
6. Continue with setting up default templates and logging in to Qubes.
2017-04-18 15:27:26 -04:00
2023-04-24 22:07:22 -04:00
## Boot device not recognized after installing
2017-04-18 15:27:26 -04:00
2023-04-24 22:07:22 -04:00
Some firmware will not recognize the default Qubes EFI configuration.
As such, it will have to be manually edited to be bootable.
2017-04-18 15:27:26 -04:00
2023-04-24 22:07:22 -04:00
1. Boot Qubes OS install media into [rescue mode ](/doc/uefi-troubleshooting/#accessing-installer-rescue-mode-on-uefi )
2017-04-18 15:27:26 -04:00
2023-04-24 22:07:22 -04:00
2. Press '3' to go to the shell
2017-04-18 15:27:26 -04:00
2023-04-24 22:07:22 -04:00
3. Find and mount the EFI system partition. (replace `/dev/sda` with your disk name. If unsure, use the `lsblk` command to display a list of disks):
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
fdisk -l /dev/sda | grep EFI
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
The output should look like this:
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
/dev/sda1 2048 1230847 1228800 600M EFI System
```
Then mount it:
```
mkdir -p /mnt/sysimage/boot/efi
mount /dev/sda1 /mnt/sysimage/boot/efi
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
4. Copy `grubx64.efi` to the fallback path:
```
cp /mnt/sysimage/boot/efi/EFI/qubes/grubx64.efi /mnt/sysimage/boot/efi/EFI/BOOT/bootx64.efi
```
5. Type `reboot`
2017-04-18 15:27:26 -04:00
2023-04-24 22:07:22 -04:00
## "Qubes" boot option is missing after removing / attaching a disk or updating the BIOS
1. Boot Qubes OS install media into [rescue mode ](/doc/uefi-troubleshooting/#accessing-installer-rescue-mode-on-uefi )
2. Press '3' to go to the shell
3. Create boot entry in EFI firmware (replace `/dev/sda` with your disk name and `-p 1` with `/boot/efi` partition number):
2017-04-18 15:27:26 -04:00
2021-03-13 12:03:23 -05:00
```
2023-04-24 22:07:22 -04:00
efibootmgr -v -c -u -L Qubes -l /EFI/qubes/grubx64.efi -d /dev/sda -p 1
2021-03-13 12:03:23 -05:00
```
2018-05-06 11:43:08 -04:00
2021-03-13 12:03:23 -05:00
## Accessing installer Rescue mode on UEFI
2019-02-15 16:21:02 -05:00
2023-04-24 22:07:22 -04:00
Choose "Rescue a Qubes OS system" from grub2 boot menu.