MacOS VM on qubes

Strangely enough… kholia’s macOS-libvirt-Catalina.xml gets validated

[user@dom0 osx]$ sudo virt-xml-validate libvirt.xml 
libvirt.xml validates

and mine .xml fails to validate

[user@dom0 by-name]# virt-xml-validate /etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:92: namespace error : Namespace prefix qemu on commandline is not defined
  <qemu:commandline>
                   ^
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:93: namespace error : Namespace prefix qemu on arg is not defined
    <qemu:arg value='-device'/>
                             ^
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:94: namespace error : Namespace prefix qemu on arg is not defined
a-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'
                                                                               ^
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:95: namespace error : Namespace prefix qemu on arg is not defined
    <qemu:arg value='-smbios'/>
                             ^
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:96: namespace error : Namespace prefix qemu on arg is not defined
    <qemu:arg value='type=2'/>
                            ^
Relax-NG validity error : Extra element devices in interleave
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:44: element devices: Relax-NG validity error : Element domain failed to validate content
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml fails to validate

I copied&pasted those 6 lines. I don’t get it.

Try to change:
<domain type='xen'>
to
<domain type='xen' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

libvirt: QEMU command-line passthrough

1 Like

works! thanks again!

I still got

Relax-NG validity error : Extra element devices in interleave
/etc/qubes/templates/libvirt/xen/by-name/hvm-mac.xml:44: element devices: Relax-NG validity

Google hints to a typo. I have got that kind of stuff in python-scripts with indendation or forgetting a closing charakter or something like that, gave me an error in one of the following lines after the actual mistake.

Paste the whole file, I don’t know what’s there on the line 44.

Just a visual progress report… this is the EFI loader:


This is OpenCore:

And this is BaseSystem.img starting and getting stuck:

1 Like

I’m going to get help from the Hackintosh-Community. Before I continue I need to know which components of the qemu-config are essential and which are not.

Some features are not supported by qubes’ qemu (i.e. the clock settings and the usb-model which kholia’s libvirt.xml uses), but it might be possible to install them in dom0 in case that is a must.

https://dortania.github.io/OpenCore-Install-Guide/config.plist/penryn.html

This looks like the best source for OpenCore-Hackintoshes I have found so far.

Where’s the download link of this thing?

What “thing” do you want to download?

I couldn’t get MacOS to work on Qubes, but on XEN/Qemu it should be similiar doable as on KVM/Qemu. Certainly that takes some time and effort.

1 Like

I mean the MacOS testing ISO file, did you saved or busted?

Have a look at this script:

2 Likes

hi ckN6QwSZ,
I’m also trying the same thing as you.
you can share your start configuration?
If You can create a recap post with all the configuration i can start from that to help you!

I’m intrested aswell on runing macos on qubes.

Were you able to get a working OSX qube?

Hi @Emily, long time no see.

I haven’t invested any more time into this project. Somewhere I have read a post, that KVM-based Hackintoshes (and I think that’s from where I started) need several minutes to boot the first time and I have had situations like that before (lost patience and killed the qube) only to get the HVM running a few days later.

However, in case of intel-based macOS I assume that one has to mimic Apples hardware as close as possible.

@unman has written down some stuff on how-to mimic non-virtual harddisks:

If you want to continue the above project that might be a good start.

Have you got any success with it? Trying to run OSX-KVM in similar way and looks like there is no way to passthrough osk in libvirt xml configuration rather than use arbitrary qemu commands which of course not supported as well in xen emulator.

  <qemu:commandline>
    <qemu:arg value='-newarg'/>
    <qemu:env name='QEMU_ENV' value='VAL'/>
  </qemu:commandline>

I believe I have tried that but that is quite some time ago. I think I tried to preserve everything defined in this .xml file:

That’s why I came to believe it makes a difference if /dev/xvda or /dev/sda is presented to macOS’ installer.

Just in case somebody has time and patience to try intel-based macOS on Xen/Qubes: @Xuni found a way to present SATA-disks instead of IDE-disks (virtual disks) to macOS installer inside the HVM:

This seems easier than @unman’s solution or patches for Android. I haven’t tried neither.

Hello everyone,

I’m excited to inform you that I have successfully managed to get macOS operating on Xen. This task was not straightforward and required using a non-official version of Xen. Additionally, I had to make certain alterations in Opencore. I’ve already submitted a pull request for these modifications, but it’s still pending approval. I’ll be releasing the instructions on how to do this soon. Stay tuned!

3 Likes

Thanks for that link. Going through the comments it looks like the biggest challenge is the GPU.

This recent comment suggests the RaynOS project as an alternative to macOS