MacOS guest on Mac host

Ebatte

New Member
Jan 11, 2017
10
0
1
54
im running proxmox on a Mac Pro host so the hardware is native apple hardware. However, when running a MacOS guest in proxmox I get really poor network performance. I've attempted to install the virtio drivers for Mac but I haven't gotten the guest to recognize a virtio adapter. The other vnic I have setup is manually changed to an e1000-82545em adapter which is reportedly supported by macOS.

Maybe there is another vnic spec I should be using?
Maybe there is a way to pass-through the physical nic to the guest?

If anyone has any experience with this I'd appreciate some suggestions.

Thanks
 
Thanks Q-wulf. However, I'm having issues getting this to work. I've followed the instructions as best I can.

My ethernet adapters are:
03:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
03:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
09:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
0a:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

So I added the following line to /etc/pve/qemu-server/100.conf
hostpci0: 03:00.0

Attempting to start the vm gives me: TASK ERROR: Cannot open iommu_group: No such file or directory
 
03:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
03:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)

09:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
0a:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection


Afaik (and its been a minute since i've done this) you can either pass through 03:00.0 & 03:00.1 (as in 03:00) or 09:00 or 0a:00.

The reason for this is that the first 2 nics sit on the same iommu group, while the last 2 nics sit on seperate ones.

Any chance these are a dual port nic and 2 single port nics physically present inside the server ?
 
Any chance these are a dual port nic and 2 single port nics physically present inside the server ?

Yes, that is the case. The Mac Pro has 2 ports built-in and I added an intel card with 2 ports.
 
I'd verify that the card you added is in fact the "Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)"

I'd then use that one for Proxmox and pass one of the other two which most likely are single Port onboard nics (or just present them self that way) through to the VM. (since these are Nics used in a Mac there should be minimal performance problems when passing it to a macos VM)

or just pass both of these newly added nics (as in 03:00) through to your virtual machine
 
I guess I'm still missing something. Adding any of the following lines individually to the conf prevents the VM from booting:

hostpci0: 03:00.0
hostpci0: 03:00
hostpci0: 0a:00
hostpci0: 0a:00.0

Is it necessary to reboot the host after editing grub and /etc/modules? My cpu is a xeon which supports iommu mapping according to
 
Adding any of the following lines individually to the conf prevents the VM from booting:

hostpci0: 03:00.0
hostpci0: 03:00
hostpci0: 0a:00
hostpci0: 0a:00.0

Afaik the last time i did this, i was following this example:
https://pve.proxmox.com/wiki/Pci_pa...our_PCI_card_address.2C_and_configure_your_VM


So I'd add this to your vm-config:
Code:
hostpci0: 03:00

or I'd add:
Code:
hostpci0: 0a:00

AFAIR (and I might be wrong here) you should reboot your system once before starting the VM.

if that does not work, can you please post the output of
Code:
find /sys/kernel/iommu_groups/ -type l
 
Yes, apparently a reboot is required. When I added 0a:00 this time it immediately took proxmox and all vms down when I started the vm- so at least I know it worked and which interface 0a:00 is! ;)

So I rebooted again and added 03:00. When I start the vm I get these errors:
kvm: warning: Unknown firmware file in legacy mode: genroms/multiboot.bin
kvm: -device vfio-pci,host=03:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on: vfio: failed to set iommu for container: Operation not permitted
kvm: -device vfio-pci,host=03:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on: vfio: failed to setup container for group 20
kvm: -device vfio-pci,host=03:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on: vfio: failed to get group 20
kvm: -device vfio-pci,host=03:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on: Device initialization failed
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=1bb0f6da-0cb7-402c-8c93-f62e0dd28bc0' -drive 'if=pflash,unit=0,format=raw,readonly,file=/usr/share/kvm/OVMF_CODE-pure-efi.fd' -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/var/lib/vz/images/100/vm-100-disk-3.raw' -name MacOS -smp '4,sockets=2,cores=2,maxcpus=4' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga std -vnc unix:/var/run/qemu-server/100.vnc,x509,password -cpu host,+kvm_pv_unhalt,+kvm_pv_eoi -m 4096 -k en-us -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -smbios 'type=2' -kernel /var/lib/vz/template/qemu/enoch_rev2839_boot -cpu 'Penryn,kvm=off' -readconfig /usr/share/qemu-server/pve-q35.cfg -device 'vfio-pci,host=03:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on' -device 'vfio-pci,host=03:00.1,id=hostpci0.1,bus=pci.0,addr=0x10.1' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:1ee95c57b253' -device 'ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7' -drive 'file=/var/lib/vz/images/100/vm-100-disk-1.vmdk,if=none,id=drive-sata0,format=vmdk,cache=none,aio=native,detect-zeroes=on' -device 'ide-drive,bus=ahci0.0,drive=drive-sata0,id=sata0' -drive 'file=/var/lib/vz/images/100/vm-100-disk-2.raw,if=none,id=drive-sata1,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'ide-drive,bus=ahci0.1,drive=drive-sata1,id=sata1,bootindex=101' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown' -device 'e1000,mac=BA:4A:EB:BD:6C:B3,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' -machine 'type=pc-q35-2.4'' failed: exit code 1





Also here is the output of the iommu groups:

root@pve:~# find /sys/kernel/iommu_groups/ -type l

/sys/kernel/iommu_groups/0/devices/0000:00:00.0

/sys/kernel/iommu_groups/1/devices/0000:00:01.0

/sys/kernel/iommu_groups/2/devices/0000:00:03.0

/sys/kernel/iommu_groups/3/devices/0000:00:07.0

/sys/kernel/iommu_groups/4/devices/0000:00:0d.0

/sys/kernel/iommu_groups/4/devices/0000:00:0d.1

/sys/kernel/iommu_groups/4/devices/0000:00:0d.2

/sys/kernel/iommu_groups/4/devices/0000:00:0d.3

/sys/kernel/iommu_groups/4/devices/0000:00:0d.4

/sys/kernel/iommu_groups/4/devices/0000:00:0d.5

/sys/kernel/iommu_groups/4/devices/0000:00:0d.6

/sys/kernel/iommu_groups/4/devices/0000:00:0d.7

/sys/kernel/iommu_groups/5/devices/0000:00:0e.0

/sys/kernel/iommu_groups/5/devices/0000:00:0e.1

/sys/kernel/iommu_groups/5/devices/0000:00:0e.2

/sys/kernel/iommu_groups/5/devices/0000:00:0e.3

/sys/kernel/iommu_groups/5/devices/0000:00:0e.4

/sys/kernel/iommu_groups/6/devices/0000:00:0f.0

/sys/kernel/iommu_groups/7/devices/0000:00:10.0

/sys/kernel/iommu_groups/7/devices/0000:00:10.1

/sys/kernel/iommu_groups/8/devices/0000:00:11.0

/sys/kernel/iommu_groups/8/devices/0000:00:11.1

/sys/kernel/iommu_groups/9/devices/0000:00:13.0

/sys/kernel/iommu_groups/10/devices/0000:00:14.0

/sys/kernel/iommu_groups/10/devices/0000:00:14.1

/sys/kernel/iommu_groups/10/devices/0000:00:14.2

/sys/kernel/iommu_groups/10/devices/0000:00:14.3

/sys/kernel/iommu_groups/11/devices/0000:00:15.0

/sys/kernel/iommu_groups/12/devices/0000:00:16.0

/sys/kernel/iommu_groups/12/devices/0000:00:16.1

/sys/kernel/iommu_groups/12/devices/0000:00:16.2

/sys/kernel/iommu_groups/12/devices/0000:00:16.3

/sys/kernel/iommu_groups/12/devices/0000:00:16.4

/sys/kernel/iommu_groups/12/devices/0000:00:16.5

/sys/kernel/iommu_groups/12/devices/0000:00:16.6

/sys/kernel/iommu_groups/12/devices/0000:00:16.7

/sys/kernel/iommu_groups/13/devices/0000:00:1a.0

/sys/kernel/iommu_groups/13/devices/0000:00:1a.1

/sys/kernel/iommu_groups/13/devices/0000:00:1a.2

/sys/kernel/iommu_groups/13/devices/0000:00:1a.7

/sys/kernel/iommu_groups/14/devices/0000:00:1b.0

/sys/kernel/iommu_groups/15/devices/0000:00:1c.0

/sys/kernel/iommu_groups/15/devices/0000:00:1c.1

/sys/kernel/iommu_groups/15/devices/0000:00:1c.2

/sys/kernel/iommu_groups/15/devices/0000:00:1c.3

/sys/kernel/iommu_groups/15/devices/0000:00:1c.4

/sys/kernel/iommu_groups/15/devices/0000:00:1c.5

/sys/kernel/iommu_groups/15/devices/0000:09:00.0

/sys/kernel/iommu_groups/15/devices/0000:0a:00.0

/sys/kernel/iommu_groups/15/devices/0000:0b:00.0

/sys/kernel/iommu_groups/15/devices/0000:0c:00.0

/sys/kernel/iommu_groups/16/devices/0000:00:1d.0

/sys/kernel/iommu_groups/16/devices/0000:00:1d.1

/sys/kernel/iommu_groups/16/devices/0000:00:1d.2

/sys/kernel/iommu_groups/16/devices/0000:00:1d.7

/sys/kernel/iommu_groups/17/devices/0000:00:1e.0

/sys/kernel/iommu_groups/18/devices/0000:00:1f.0

/sys/kernel/iommu_groups/18/devices/0000:00:1f.2

/sys/kernel/iommu_groups/18/devices/0000:00:1f.3

/sys/kernel/iommu_groups/19/devices/0000:01:00.0

/sys/kernel/iommu_groups/20/devices/0000:02:02.0

/sys/kernel/iommu_groups/20/devices/0000:03:00.0

/sys/kernel/iommu_groups/20/devices/0000:03:00.1

/sys/kernel/iommu_groups/21/devices/0000:02:04.0

/sys/kernel/iommu_groups/22/devices/0000:05:00.0

/sys/kernel/iommu_groups/22/devices/0000:05:00.1

/sys/kernel/iommu_groups/23/devices/0000:ff:00.0

/sys/kernel/iommu_groups/23/devices/0000:ff:00.1

/sys/kernel/iommu_groups/24/devices/0000:ff:02.0

/sys/kernel/iommu_groups/24/devices/0000:ff:02.1

/sys/kernel/iommu_groups/25/devices/0000:ff:03.0

/sys/kernel/iommu_groups/25/devices/0000:ff:03.1

/sys/kernel/iommu_groups/25/devices/0000:ff:03.4

/sys/kernel/iommu_groups/26/devices/0000:ff:04.0

/sys/kernel/iommu_groups/26/devices/0000:ff:04.1

/sys/kernel/iommu_groups/26/devices/0000:ff:04.2

/sys/kernel/iommu_groups/26/devices/0000:ff:04.3

/sys/kernel/iommu_groups/27/devices/0000:ff:05.0

/sys/kernel/iommu_groups/27/devices/0000:ff:05.1

/sys/kernel/iommu_groups/27/devices/0000:ff:05.2

/sys/kernel/iommu_groups/27/devices/0000:ff:05.3

/sys/kernel/iommu_groups/28/devices/0000:ff:06.0

/sys/kernel/iommu_groups/28/devices/0000:ff:06.1

/sys/kernel/iommu_groups/28/devices/0000:ff:06.2

/sys/kernel/iommu_groups/28/devices/0000:ff:06.3
 
I assume the error has to do with interrupt mapping. My xeon should support it, but just in case I just allowed unsafe interrupts with:
echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf

Now I have to wait for an opportunity to reboot again...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!