QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
535 stars 47 forks source link

Macbook Pro (Retina, 13-inch, Early 2015): QubesOS R4.0 installer doesn't use existing /dev/sda1 EFI System Partition #3823

Closed pruflyos closed 1 year ago

pruflyos commented 6 years ago

Qubes OS version:

R4.0

Affected component(s):

Qubes OS R4.0 Installer


Steps to reproduce the behavior:

Expected behavior:

Actual behavior:

For some reason the Qubes installer creates a new 200MB EFI partion (/dev/sda6 in my case) and creates a Qubes entry in this partition:

INFO program: Running... efibootmgr -c -w -L Qubes -d /dev/sda -p 6 -l \EFI\qubes\xen.efi

Of course, my Macbook isn't able to boot Qubes after I finish installation and hold down the Option key, because the Macbook EFI manager looks in /dev/sda1 for available systems, but Qubes was added to /dev/sda6.

And that's exactly what's happening, after qubes installation is complete and I reboot my Macbook while holding down the Option key, Qubes is not shown as an option. I can't boot the installed Qubes 4.0.

General notes:


Related issues:

elaine-jackson commented 6 years ago

Does this bug affect people erasing the entire disk and starting anew? Or just if you want to dual boot with macOS and keep your existing EFI partition?

CC: @andrewdavidwong @pruflyos

pruflyos commented 6 years ago

Does this bug affect people erasing the entire disk and starting anew?

When you erase the entire disk, Qubes 4.0 doesn't boot after installation. I guess the issue is the following: Qubes installer creates a 200MB partition for UEFI of type Standard Partition with Linux HFS+ ESP as the file system. Ubuntu 18.04 on the other hand (which boots fine after installation) creates a 512MB partition using EFI System Partition as the file system. If I try to replicate the Ubuntu layout using manual partitioning in the Qubes 4.0 installer, it won't let me install and complains with:

Error checking storage configuration.

No vaild boot loader target device found. See below for details.
For a UEFI installation, you must include and EFI System Partition an a GPT-formatted disk, mounted at /boot/efi.

So I guess this is a bug. Although I manually created a partition of type EFI System Partition and set the mount point to /boot/efi I get the above error and can't install. And the automatic partitioning uses the wrong file system type so Qubes 4.0 installs but won't boot.

So neither automatic partitioning nor manual partitioning lead to a bootable Qubes on a Macbook Pro 2015.

eduncan911 commented 5 years ago

Of course, my Macbook isn't able to boot Qubes after I finish installation and hold down the Option key, because the Macbook EFI manager looks in /dev/sda1 for available systems, but Qubes was added to /dev/sda6.

I don't think that is correct. With Sierra and High Sierra, macOS scans all HFS+ partitions on the system for EFI files that have been blessed, and displays them. I have actually tested a system with 3 USB bootsticks (some "blessed", others not) along with a dual boot system - all 5 EFI partitions across 4 drives all showed up under "OPTION" key hold.

As far as Qubes creating the proper partitioning schema, R4.0rc5 and confirmed with R4.0 RTM both default to creating a new EFI partition for macos (according to the Anaconda python installer). Not the most efficient; but, we didn't want to re-invent the wheel so late into the RC releases to get it RTM.

But I think this is normal for all of Qubes as Qubes does not support dual-booting and highly advises against it (as booting another OS can compromise the rest of the system, hardware, firmware, etc). So the want of installing to an existing /dev/sda1 is not valid here. Instead, Qubes just creates another EFI partition. @andrewdavidwong perhaps we can close the issue since that is out of scope?

For all of my tests, I never have wiped the local disk nor have I tried installing it as dual-boot - I left it intact and always wiped an external USB HDD to install Qubes on.

I've since shelled out the change for a Thinkpad and no longer spend time on Qubes with Apple devices.

If anyone would like to help, I can help give pointers as to where to start. NOTE: This discussion really belongs on the qubes-users mailing list - not here in an issue. Feel free to copy-n-paste my info below onto the mailing list for others to chime in.

To make changes (which is the most time consuming part):

Rinse and repeat, but every change. Yeah, it's a PITA. The only other option is to build a new ISO each and every time after a modification - and burn that one over and over. I preferred to the manual copy as it didn't kill my USB sticks, like burning an ISO would dozens of times over.

Technically, we still need the macOS detection part - but only for the bless commands for the HSF+ partition. I wanted to remove a lot of the duplicate EFI code and merge it with other EFI patterns in this file.

Lastly, there is a lot of hardcoding here that I wanted to abstract to values.

andrewdavidwong commented 5 years ago

But I think this is normal for all of Qubes as Qubes does not support dual-booting and highly advises against it (as booting another OS can compromise the rest of the system, hardware, firmware, etc). So the want of installing to an existing /dev/sda1 is not valid here. Instead, Qubes just creates another EFI partition. @andrewdavidwong perhaps we can close the issue since that is out of scope?

@marmarek, can you confirm that this is working as intended?

marmarek commented 5 years ago

While it indeed isn't advisable to dual-boot Qubes and something else, it is supported configuration. And it should be possible to make Qubes use existing EFI partition. Just the installed doesn't do that by default (I think). The behavior @pruflyos describe indeed sounds like a bug. It's interesting that this happens specifically on Mac devices, as on other machines EFI partition is correctly created as EFI System partition. @pruflyos can you provide full fdisk -l /dev/sda and/or gdisk -l /dev/sda output?

github-actions[bot] commented 1 year ago

This issue is being closed because:

If anyone believes that this issue should be reopened and reassigned to an active milestone, please leave a brief comment. (For example, if a bug still affects Qubes OS 4.1, then the comment "Affects 4.1" will suffice.)