[Support] SpaceinvaderOne - Macinabox


1936 posts in this topic Last Reply

Recommended Posts

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

PLEASE - PLEASE - PLEASE EVERYONE POSTING IN THIS THREAD IF YOU POST YOUR XML FOR THE VM HERE PLEASE REMOVE/OBSCURE THE OSK KEY AT THE BOTTOM. IT IS AGAINST THE RULES OF THE FORUM FOR OSK K

09 Dec 2020   Basic usage instructions.   Macinabox needs the following other apps to be installed. CA User Scripts (macinabox will inject a user script. This is what fixes th

Sure is. When Big Sur is released officially a new Macinabox will be out. With a bunch of new features and choice between opencore and clover bootloaders.

Posted Images

Just now, rorton said:

should be ok then, i have a 2700 (non x) 

 

do you have all your HVM and IOMMU stuff set to enable VMs - you have VMs working already (other windows/linux)

 

whats your CPU mode say it is in the template/xml?

I have nvme baremetal, usb, and gpu passthrough to 2 windows vms for gaming.  Both work perfect!  I powered off one vm to free resources for this vm to test.  

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' id='2' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>MacinaboxMojave</name>
  <uuid>3fc97ade-48bb-436b-8205-7a9bbd524aa6</uuid>
  <description>MacOS Mojave</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="MacOS" icon="/mnt/user/domains/MacinaboxMojave/icon/mojave.png" os="Catalina"/>
  </metadata>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-3.1'>hvm</type>
    <loader readonly='yes' type='pflash'>/mnt/user/domains/MacinaboxMojave/ovmf/OVMF_CODE.fd</loader>
    <nvram>/mnt/user/domains/MacinaboxMojave/ovmf/OVMF_VARS.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='2' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/mnt/user/domains/MacinaboxMojave/Clover.qcow2'/>
      <backingStore/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <alias name='sata0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/MacinaboxMojave/Mojave-install.img'/>
      <backingStore/>
      <target dev='hdd' bus='sata'/>
      <alias name='sata0-0-3'/>
      <address type='drive' controller='0' bus='0' target='0' unit='3'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/mnt/user/domains/MacinaboxMojave/macos_disk.qcow2'/>
      <backingStore/>
      <target dev='hde' bus='sata'/>
      <alias name='sata0-0-4'/>
      <address type='drive' controller='0' bus='0' target='0' unit='4'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <alias name='pci.3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <alias name='pci.4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:5a:ef:7d'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='vmxnet3'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-2-MacinaboxMojave/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
  <qemu:commandline>
    <qemu:arg value='-usb'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-mouse,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-kbd,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-applesmc,osk=00000000000000000-Obscured-00000000000l(c)AppleComputerInc'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check'/>
  </qemu:commandline>
</domain>
 

Link to post

i think the error is a non error - i did a google for it, and it happens on other systems - ive just looked in my VM log and i have it in mine alsoi think the error is a non error - i did a google for it, and it happens on other systems - ive just looked in my VM log and i have it in mine also

 

You say you get an error after the OS installs - what happens on screen, does it just freeze - does it get to a mac login screen

Link to post
14 minutes ago, MortalMonkey said:

This is my third attempt at installing macos using the utility and I get the same error each time after the os installs.   I did not modify any settings.   This is installed on a Ryzen 7 2700x system if that makes a difference.  error.thumb.jpg.271cda68deeb1f73b6711e0818c2bd86.jpg

Should work fine on Ryzen 2700x i am using similar.

So you are getting through the install and set everything up (country -timezone etc) and you reach the macOS desktop then you get the question mark on the screen after reboot?

Or is this after the first reboot after the installer has downloaded the install

Link to post

A few tips from my own experience:

  • Use VNC Viewer to connect to the VM for setup. It will save you a lot of gripes over timeout and such with Clover.
  • There are 2 install steps. The first after diskutil and then it would restart, you have to make sure to boot into your newly formatted disk to complete the install. Otherwise Clover will boot back into the install media.
  • You can edit the xml to change things such as number of CPU cores. But I have found 6 cores to cause boot issues. 4 cores is ok.

 

Link to post
3 minutes ago, MortalMonkey said:

@SpaceInvaderOne  This is after the first reboot.  

Other than just force stopping the vm and rebooting 

please try this.

open terminal from the webui on Unraid

rm -r /mnt/user/domains/MacinaboxMojave/

then delete the vm template. Unraid will say it cant delete the template due to the OVMF_VARS. So remove this line from the xml (on line 25) update then the template can be removed

 <nvram>/mnt/user/domains/MacinaboxMojave/ovmf/OVMF_VARS.fd</nvram>

Then retry the installation but in the docker template select disk type to raw. This helped someone else here, it shouldnt make a difference really but worth trying.

Link to post
1 minute ago, 1812 said:

Just to report I was successful in creating a Catalina vm on the first attempt, though Mac screen sharing seems buggy (may be an issue between high Sierra and Catalina), not a big deal.

 

Nicely done @SpaceInvaderOne!

Hey there @1812 great glad to hear its working. Did it take a long time to download the image during install? Also what disk type did you use. Raw or qcow2 and what file system format did you use, apfs or macos extended? Just interested as some people have an issue on first reboot. 

Link to post

@SpaceInvaderOne: When I connect remotely to the Mac VM, I noticed that there are 2 cursors (tried both NoMachine and VNC). The one underneath is offset very slightly to the upper left. When I move the mouse around, the underneath cursor would trail the the other one to the next location. I have tested that the one above is the actual cursor so I'm not sure what's up with the underneath one. Do you know how to fix that?

Link to post
3 minutes ago, rorton said:

just a question on disk image - aren you using the automated backup script - as i tried it, and out doesn't like the qcow2

Im using APFS

 

I dont use auto backup script myself. I manually backup my vdisks when needed which is probably not often as i should as i accidentally formatted an unassigned drive whilst tired that had a few vms i hadnt backed up for a while! 😪

Link to post
3 minutes ago, testdasi said:

@SpaceInvaderOne: When I connect remotely to the Mac VM, I noticed that there are 2 cursors (tried both NoMachine and VNC). The one underneath is offset very slightly to the upper left. When I move the mouse around, the underneath cursor would trail the the other one to the next location. I have tested that the one above is the actual cursor so I'm not sure what's up with the underneath one. Do you know how to fix that?

I had the same issue last night with both vnc viewer and vnc within unraid.  The first two times it was offset pretty bad.  This morning I am having no issues.  I found that shaking the mouse and activating the mac supersized mouse pointer the mouse offset corrected itself temporarily.  Web search produced no results.  *shrug*

Edited by MortalMonkey
Link to post
8 minutes ago, MortalMonkey said:

I can so far report the download of mojave is much faster this morning.  Not sure if its the servers or switching to raw.  20 minutes compared to 1h 20m. 

Hmmm could it be network issue on your end? On my gigabit, it took seconds.

Link to post
4 minutes ago, testdasi said:

Hmmm could it be network issue on your end? On my gigabit, it took seconds.

I have a 500Mbps down connection and solid gigabit thoughout the house.  Heck.  It could be my ISP acting up.  So many variables.  

Edited by MortalMonkey
Link to post
30 minutes ago, testdasi said:

@SpaceInvaderOne: When I connect remotely to the Mac VM, I noticed that there are 2 cursors (tried both NoMachine and VNC). The one underneath is offset very slightly to the upper left. When I move the mouse around, the underneath cursor would trail the the other one to the next location. I have tested that the one above is the actual cursor so I'm not sure what's up with the underneath one. Do you know how to fix that?

I dont use vnc at all for my macos just gpu and usb controller passed through. So havent really looked until just now.

I did notice the bad performance of the vnc mouse generally though.

 I noticed while playing around with the xml the mouse performance in the webui is greatly improved by doing the following.

In the xml change remove the mouse part from below (must leave the keyboard part) 

 <qemu:commandline>
    <qemu:arg value='-usb'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-mouse,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-kbd,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-applesmc,osk=??????????????????????????????????'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check'/>
  </qemu:commandline>
</domain>

 

So to like this 

 <qemu:commandline>
    <qemu:arg value='-usb'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-kbd,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-applesmc,osk=?????????????????????????APPLE OSK goes here????????????????????'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check'/>
  </qemu:commandline>
</domain>

 

I will change this in the default templates that the container uses to reflect this. But everyone who has already downloaded and installed i would suggest making this change.

Link to post
19 minutes ago, SpaceInvaderOne said:

Hey there @1812 great glad to hear its working. Did it take a long time to download the image during install? Also what disk type did you use. Raw or qcow2 and what file system format did you use, apfs or macos extended? Just interested as some people have an issue on first reboot. 

I have a gigabit connection but it looked like it was only downloading about 40mbps (per unRaid dashboard). Additionally a quick speedtest from fast.com after the vm was created, I was only showing 30-60mbps download, so possibly an issue with using vmxnet3 as the starting virtual Nic.

 

As a test, I tried switching that for e1000-82545em in the vm but kept getting spinning beach balls, the vm wouldn't appear on the network for apple screen sharing, and I couldn't even load network settings in the vm (had to force shutdown.) There is a thread on here about the e1000-82545em causing issues with the apple store. The suggested fix is to use e1000e but when I booted with that, it didn't find it in the network control panel. Booting with 2 virtual nics, first as vmxnet and the other the e1000-82545em resulted in network control panel showing a cable unplugged for the e1000-82545em but network utilities refused to open. Safari also refused to launch and the vm hung while shutting down. Returning this to a single vmxnet 3 resolved the issues, but slow speed tests still continued. 

 

For disk type I used qcow2 and apfs.

Link to post

@1812  I found that you must use vmxnet3 for the initial download and install. It didnt work at all for me without that.

However after install of Catalina I shutdown and swapped back to e1000-82545em (only a single nic - will try dual later)

This worked fine for me and i was able to access the apple store and update a few programmes that were not supported in Catalina.

Link to post
7 minutes ago, SpaceInvaderOne said:

@1812  I found that you must use vmxnet3 for the initial download and install. It didnt work at all for me without that.

However after install of Catalina I shutdown and swapped back to e1000-82545em (only a single nic - will try dual later)

This worked fine for me and i was able to access the apple store and update a few programmes that were not supported in Catalina.

I'm planning on running it again to build a new vm image this afternoon on another server. Maybe something went wonky for me during install, even though it "worked" first time through!

 

Again, many thanks for this, it's pretty awesome!

Link to post
41 minutes ago, MortalMonkey said:

SUCCESS!!!!   Changing the disk type to RAW in the template fixed my issue.   Now what? Can I change the number of cpu cores / ram without causing issues?  Willing to try gpu and usb passthrough also.  

yep you can change core numbers etc. Just make sure to add the custom parts at the bottom of the xml back in.

Also if passing through a large amount of cores or or a non Apple stand such as 6 cores then remove topology line in xml.

for example here

  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='14' threads='1'/>
  </cpu>

would change to

  <cpu mode='host-passthrough' check='none'>
  </cpu>

Otherwise macOS wont boot with 14 cores assigned

 

Also the gpu that you have makes a difference. Nvidia gpus are good in upto high sierra.

For mojave and above you will need an AMD gpu. I am using a saphire rx 570 4gb

Also to get sound working correctly from an amd card you need to put the sound part on the same bus as a multi function bit.

I will explain this in a future video that i will make. But basically heres how mine looks in case you or anyone reading this wants to see.

  <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
      </source>
      <rom file='/mnt/disk1/domains/vbios/Sapphire.RX570.4096.180105.rom'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x1'/>
    </hostdev>

 

  • Like 1
  • Thanks 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.