Notes based on this help doc: https://www.qubes-os.org/doc/macbook-troubleshooting/#macbook-pro-retina-15-inch-mid-2015-macbookpro-115
The above notes helped me 99% of the way there. Considering this is new territory for me though, that last 1% was rough and took learning a lot of things I was hoping to have been able to skip.
So here are some additional notes to that help doc...
I didn't have any changes here, but I repartioned without rebooting in recovery mode using Disk Utility.
Having no clue what rEFInd was, nor EFI booting, nor how to possibly change your bootloader on a Mac, this was confisuing to me. I ended following the steps here for Elementary, which are the same for rEFInd: https://github.com/aroman/elementary-on-a-mac#install-refind-boot-manager
Basic steps were:
- Download rEFInd ZIP file
- Unzip it someplace
- Reboot in recovery mode
- Mount drive if needed from Disk Utility
- Use Terminal to navigate to unzipped folder and run installer
./refind-install
I skipped the crsutil disable
step that was in the Qubes doc (wasn't in the Elementary doc). Install was quick, and worked immediately on reboot.
Steps listed were straightforward and worked great.
Ignore the part about skipping this section, you need it later on.
chroot /mnt/sysimage
- The second command here was hard to copy and pointed to the wrong file. Just edit
/etc/grub.d/20_linux_xen
and replace the single instances ofmultiboot
withchainloader
,module --nounzip
withinitrdefi
, andmodule
withlinuxefi
. - Skip the rest and go to step 5
Edit /boot/efi/EFI/qubes/xen.cfg
, the file will be empty. Use the following however, the notes had typoes and were missing the root
which is a problem (including other stuff). This is taken from the UEFI Troubleshooting Doc
[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
Use lsblk
to find the right partion of your new Qubes install. For me, this was 5 on /dev/sda
Use the following to look back through cmds that were run that you will need to rerun.
grep Running /var/log/anaconda/program.log | tail -n 20
All of these cmds are based on the grep above:
- Wipe out existing Qubes loader
efibootmgr -b 0000 -B
- Fix EFI location and use the correct partion number for your install:
efibootmgr -c -w -L Qubes -d /dev/sda -p 5 -l \\EFI\\qubes\\xen-4.6.1.efi
- Think we run this to be safe
/usr/libexec/mactel-boot-setup
- Regenerate grub config:
grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg
- Think this is ran to be safe too (takes a minute)
kernel-install add 4.4.14-11.pvops.qubes.x86_64 /boot/vmlinuz-4.4.14-11.pvops.qubes.x86_64
- This seems to have no effect, but I ran it anyway:
systemctl disable qubes-netvm
- This also breaks rEFInd being the bootloader, so you need to change the boot order to put the Mac being first so that rEFInd is used to start up. Use
efibootmgr -v
to see the details (and see refind is on the Mac) and then set the order to Mac then Qubes, for me this wasefibootmgr -o 0080,0000
exit
andreboot
- You should be at rEFInd boot screen again, pick the
EFI/qubes/xen-4.6.1.efi
- Qubes installer should startup, use defaults and expect to crash during network setup because of wifi card.
I skipped this as I never had any audio issues.
- Force reboot and Hold Option after the chime
- Pick your installed Qubes Partition to boot using grub
- run
configfile /EFI/qubes/grub.cfg
- Once screen starts, hit
e
to edit config - Change
set root=hd0;gpt4
toset root=hd1;gpt4
- Hit Fn+CNTL+F2
- Once you get back to setup screen hit
Fn+CNTL+F4
and log in with your user account - Disable netvm
sudo su -
andsystemctl disable qubes-netvm
- Finish setup
- sys-net should not be running
- launch termial in dom0
- Increase swiotlb size
qvm-prefs -s sys-net kernelopts "nopat iommu=soft swiotlb=8192"
- Prep PCI card as described in steps
Good info here: https://joshtronic.com/2017/03/13/getting-suspend-in-linux-working-on-a-macbook-pro/ Basically, the mac would never go to sleep and burn the battery down because it was trying to wake back up. Those steps fixed it for me.
WIFI card would stick freeze on resume. This was fixed by adding the wifi module to the suspend/resume load list on sys-net as described here: https://www.qubes-os.org/doc/wireless-troubleshooting/#automatically-reloading-drivers-on-suspendresume
Specifically, add brcmfmac
to the /rm/config/suspend-module-blacklist
on sys-net
The MacbookPro backtick key was printing out <
instead, needed to remap it. Found fix here: https://ubuntuforums.org/showthread.php?t=1486995&p=11297689#post11297689
*NOTE: This is WIP and so far does not work at all... Basically Macbook has all USB (including mouse/keyboard) on a single USB controller. Have gotten around boot/login issues with the below steps, however simply assigning the controller to the USB-VM locks up (doesn't crash, just seems to lock up keyboard expect power button and trackpad). Note that this is still with allowing the qube policy of passing this through to dom0. I haven't dug too far into this yet, but it will eventually be a critical issue I'm guessing...
First enable sys-usb
sudo qubesctl top.enable qvm.sys-usb
sudo qubesctl state.highstate
Now, unhide it from dom0 so you can still boot up:
sudo vi /boot/efi/EFI/qubes/xen.cfg
And remove rd.hide.usb
(or whatever it was called at the end of the kernel line)
Allow dom0 access to Keyboard and Mouse:
edit /etc/qubes-rpc/policy/qubes.InputMouse
and /etc/qubes-rpc/policy/qubes.InputKeyboard
and add at the TOP:
sys-usb dom0 allow,user=root
Finally, disable sys-usb autostart so you can still boot into dom0 for now.
rm -f /etc/systemd/system/multi-user.target.wants/[email protected]
For now, I just run the attached boot.sh script when I boot up the machine. It handles everything for me. Eventually I'll move this to a systemd service...
- Move boot.sh to be a systemd services, just haven't gotten around to it
- Annoying AppVm display resolution sometimes gets wonky. Haven't found root cause or fix. Killing VMs and running
qubes-monitor-layout-notify
repeatedly eventually solves it for me. - Thunderbolt display hot plugging doesn't work, apparently Linux Kernel has resolved hot plugging for everything in thunderbolt Except for display (eg, ethernet works via thunderbolt hot-plug)
- No USB-VM means no proxying USB to VMs, only can do USB Drives for now
- Sometimes backtick keyboard change stops working in AppVMs and only works in dom0. I'm assuming this has to do with a suspend/resume issue, but it has only happened to me a couple times so far. Reboot fixes.