Issues following installation of Qubes R4.1.1 on MacbookPro

I’ve been trying to instal Qubes on my old Macbook Pro 14,1 13" 2017.
Didn’t have any problem during the installation, was able to boot properly and install, touchpad and keyboard both worked.

Post installation however, I’m unable to start any VM.

PVH VMs, start and shut down instantly.

HVM (sys-net and sys-usb) start, but are blocked on
Probing EDD (edd=off to disable!... ok.
I followed the instruction on the troubleshooting guide and set kernel to “”, which does solve the issue.

However, after that, the VM just get stuck during boot phase.
Message is the following for fedora-36 based VM:

fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb2

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>
...
Mounting sysroot.mount - /sysroot...
mount: /sysroot: wrong fs type, bad option, bad superblock on /dev/xvda...

The debian-11 based HVM VM gives the following error message:

piix4_smbus: 0000:00:01.3: SMBus Host controller bus not enabled!

I tried to install Fedora 37 on my hardware and it works fine. Not sure how to solve these issues, would really appreciate some help.

Also, the keyboard backlight doesn’t work. It’s obviously not that big of a deal compared to previous issues but still would appreciate any pointer on how to fix it.

Qubes runs Fedora 32 in dom0, which might be too old for your hardware. Did you try the latest kernel?
https://qubes.notset.fr/iso/

After a lot of tuning Macbook Pro 13" (2014) works almost 100% with Qubes OS for me.
The only major drawback is weak CPU, that cannot play youtube videos (vp9 codec) without frame drops with 720p+ quality. But it can play 1080p 20GiB-size files with x264 codec without frame drops.
Another drawback - it has only one USB Controller, like Purism Librem, I would prefer 2-3.

That’s great but how does that relate to my situation? Also you didn’t mention any of tuning you’ve done so…

My point - the version is not that different, maybe your device should work (no HCL reports to prove it though). So, not very useful information, I agree.

Also you didn’t mention any of tuning you’ve done so…

Well, I don’t remember that good, at least I had to struggle a lot with wifi (broadcom model), but it is beyond the point. Keyboard backlight worked for me out of the box.

I just tested the Qubes-4.1.20221224-kernel-latest-x86_64.iso on a Macbook Pro (A1708) and has issues like the OP – dom0 seems to be fine, but after running the

sudo /usr/libexec/initial-setup/initial-setup-graphical

VMs (like sys-net) fails at startup. Since it only has 8G memory, I’ll take a look at

1 Like

Looks like both

sudo qvm-template install /var/lib/qubes/template-packages/qubes-template-fedora-36-4.0.6-202205270243.noarch.rpm

and

sudo qvm-template install /var/lib/qubes/template-packages/qubes-template-debian-11-4.0.6-20220117156.noarch.rpm

fails to produce a running Qube – time to learn more about qvm-template

I assume the interesting part from guest-debian-11.log is:

[2022-12-26 19:57:51] Waiting for /dev/xvda* devices...
[2022-12-26 19:57:51] Qubes: Doing R/W setup for TemplateVM...
[2022-12-26 19:57:52] [    1.131265]  xvdc: xvdc1 xvdc3
[2022-12-26 19:57:52] Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
[2022-12-26 19:57:52] no label, UUID=c8a3f903-5288-4f64-bcdd-36b8876ea664
[2022-12-26 19:57:52] Qubes: done.
[2022-12-26 19:57:52] mount: /sysroot: wrong fs type, bad option, bad superblock on /dev/xvda, missing codepage or helper program, or other error.
[2022-12-26 19:57:52] Waiting for /dev/xvdd device...
[2022-12-26 19:57:52] [    1.175270] /dev/xvdd: Can't open blockdev
[2022-12-26 19:57:52] [    1.175512] EXT4-fs (xvdd): mounting ext3 file system using the ext4 subsystem
[2022-12-26 19:57:52] [    1.180595] EXT4-fs (xvdd): mounted filesystem with ordered data mode. Quota mode: none.
[2022-12-26 19:57:52] mount: /tmp/modules: WARNING: device write-protected, mounted read-only.
[2022-12-26 19:57:52] mount: /sysroot/lib/modules: mount point does not exist.
[2022-12-26 19:57:52] [    1.189724] EXT4-fs (xvdd): unmounting filesystem.
[2022-12-26 19:57:52] mount: /sysroot: mount point not mounted or bad option.
[2022-12-26 19:57:52] switch_root: failed to mount moving /sysroot to /: Invalid argument
[2022-12-26 19:57:52] switch_root: failed. Sorry.
[2022-12-26 19:57:52] [    1.193636] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

For guest-fedora-36.log it looks the same:

[2022-12-26 18:08:16] Waiting for /dev/xvda* devices...
[2022-12-26 18:08:16] Qubes: Doing R/W setup for TemplateVM...
[2022-12-26 18:08:17] [    3.529340]  xvdc: xvdc1 xvdc3
[2022-12-26 18:08:17] Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
[2022-12-26 18:08:17] no label, UUID=19d25f43-94c7-46f6-bb0d-97a4805f3e03
[2022-12-26 18:08:17] Qubes: done.
[2022-12-26 18:08:17] mount: /sysroot: wrong fs type, bad option, bad superblock on /dev/xvda, missing codepage or helper program, or other error.
[2022-12-26 18:08:17] Waiting for /dev/xvdd device...
[2022-12-26 18:08:17] [    3.576419] EXT4-fs (xvdd): mounting ext3 file system using the ext4 subsystem
[2022-12-26 18:08:17] [    3.581232] EXT4-fs (xvdd): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[2022-12-26 18:08:17] mount: /tmp/modules: WARNING: device write-protected, mounted read-only.
[2022-12-26 18:08:17] mount: /sysroot/lib/modules: mount point does not exist.
[2022-12-26 18:08:17] mount: /sysroot: mount point not mounted or bad option.
[2022-12-26 18:08:17] switch_root: failed to mount moving /sysroot to /: Invalid argument
[2022-12-26 18:08:17] switch_root: failed. Sorry.
[2022-12-26 18:08:17] [    3.592894] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

Okay – a wild guess:

The disk image (root.img) inside qubes-template-fedora-36-4.0.6-202205270243.noarch.rpm and qubes-template-debian-11-4.0.6-20220117156.noarch.rpm, uses a block size of 512 … and the logical volume they are imported into (via import_data_with_size) uses a block size of 4096 …

Edit: dang - the forum software does not allow me to post a [partial] solution in it’s own post (“You have posted 3 times - wait for someone else to write something”), so I have to edit this one - and miss the people that uses mail to interact with the forum :-/

Okay - I’m now closer to get Qubes OS running on the Macbook Pro (A1708) - with just a little help, the initial setup completes and installs running cubes … but it’s a hack!!

The main issue seems to be the 512 vs 4096 block size - the image from the rpm files needs a new partition table to work.

To do this, I added a input(" .. ") to /usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template_postprocess.py to have time to recreate the partition table:

$ cat /media/sdb1/Qubes/patch.txt
--- /usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template_postprocess.py.orig  2022-11-29 01:00:00.000000000 +0100
+++ /usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template_postprocess.py       2022-12-28 16:29:24.421991360 +0100
@@ -96,6 +96,27 @@
     root_size = get_root_img_size(source_dir)
 
     root_path = os.path.join(source_dir, 'root.img')
+
+    print("Go to the files in:")
+    print(root_path)
+    print("fdisk root.img")
+    print("fdisk -b 4096 root.img")
+    print("  g")
+    print("  w")
+    print("fdisk -b 4096 root.img")
+    print("  n")
+    print("  size: +200M")
+    print("  n")
+    print("  size: +2M")
+    print("  n")
+    print("  <use defaults> -- do *not* change the data")
+    print("  t")
+    print("  part: 1 -- type 1")
+    print("  t")
+    print("  part: 2 -- type 4")
+
+    input("Press enter, when ready")
+
     if os.path.exists(root_path + '.part.00'):
         input_files = glob.glob(root_path + '.part.*')
         with subprocess.Popen(['cat'] + sorted(input_files),
$

(the print("...") is just there to remind myself what needs to be done).

Eg: To install debian-11-minimal will require 2 terminals - one that will look like:

[root@dom0 ~]# qvm-template install qubes-template-debian-11-minimal-0\:4.0.6-202108191622.rpm 
Installing template 'debian-11-minimal'...
debian-11-minimal: Importing data
Go to the files in:
/var/tmp/tmpxkm5fw9m/var/lib/qubes/vm-templates/debian-11-minimal/root.img
fdisk root.img
fdisk -b 4096 root.img
  g
  w
fdisk -b 4096 root.img
  n
  size: +200M
  n
  size: +2M
  n
  <use defaults> -- do *not* change the data
  t
  part: 1 -- type 1
  t
  part: 2 -- type 4
Press enter, when ready

and the second where the root.img is manipulated:

[root@dom0 ~]# cd /var/tmp/tmpxkm5fw9m/var/lib/qubes/vm-templates/debian-11-minimal/
[root@dom0 debian-11-minimal]# mv root.img.part.00 _root.img.part.00 
[root@dom0 debian-11-minimal]# cat _root.img.part.00 | tar xf -
[root@dom0 debian-11-minimal]# fdisk root.img 

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk root.img: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F4796A2A-E377-45BD-B539-D6D49E569055

Device      Start      End  Sectors  Size Type
root.img1    2048   411647   409600  200M EFI System
root.img2  411648   415743     4096    2M BIOS boot
root.img3  415744 20971486 20555743  9.8G Linux filesystem

Command (m for help): q

[root@dom0 debian-11-minimal]# fdisk -b 4096 root.img 

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

GPT PMBR size mismatch (20971519 != 2621439) will be corrected by write.

Command (m for help): g

Created a new GPT disklabel (GUID: 6F6FA40B-9D5E-E742-9845-331182635433).
The device contains 'gpt' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.

Command (m for help): w

The partition table has been altered.
Syncing disks.

[root@dom0 debian-11-minimal]# fdisk -b 4096 root.img 

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition number (1-128, default 1): 
First sector (256-2621434, default 256): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (256-2621434, default 2621434): +200M

Created a new partition 1 of type 'Linux filesystem' and of size 200 MiB.

Command (m for help): n
Partition number (2-128, default 2): 
First sector (51456-2621434, default 51456): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (51456-2621434, default 2621434): +2M

Created a new partition 2 of type 'Linux filesystem' and of size 2 MiB.

Command (m for help): n
Partition number (3-128, default 3): 
First sector (51968-2621434, default 51968): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (51968-2621434, default 2621434): 

Created a new partition 3 of type 'Linux filesystem' and of size 9.8 GiB.
Partition #3 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: n

Command (m for help): t
Partition number (1-3, default 3): 1
Partition type (type L to list all types): 1

Changed type of partition 'Linux filesystem' to 'EFI System'.

Command (m for help): t
Partition number (1-3, default 3): 2
Partition type (type L to list all types): 4

Changed type of partition 'Linux filesystem' to 'BIOS boot'.

Command (m for help): w
The partition table has been altered.
Syncing disks.

[root@dom0 debian-11-minimal]# 

After this, the image root.img should work and the installer can import it (so press “Enter” in the first terminal).

The hack also allowed me to install fedora-36, whonix-gw-16 and whonix-ws-16 from the Qubes-4.1.20221224-kernel-latest-x86_64.iso image. The steps were:

  1. Run the installer
  2. After the reboot, quit the initial setup without changing anything
  3. Patch /usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template_postprocess.py in a terminal from dom0.
  4. Open a second terminal in dom0 and run sudo /usr/libexec/initial-setup/initial-setup-graphical

When the second termnial asks you to fix root.img files, do so in the first terminal. Note:

If there is several root.img.part.0X files in the folder, rename all of them, and cat them in order:

# mv root.img.part.00 _root.img.part.00
# mv root.img.part.01 _root.img.part.01
# mv root.img.part.02 _root.img.part.02
# mv root.img.part.03 _root.img.part.03
# cat _root.img.part.0{0,1,2,3} | tar xf -

I’ve probably missed a simple solution somewhere (and totally b0rked something) with this Frankenstein
approach … so any hints/suggestions will be appreciated!

Now I need to figure out how to get the WiFi going … :slight_smile: