sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
47.32k stars 2.59k forks source link

Get AppleVirtIONetwork working? #357

Open jpmorrison opened 3 years ago

jpmorrison commented 3 years ago

I changed NETWORKING=virtio-net-pci to try the Apple virtio driver. The kext loads but I don't get an address.

image

Seems to be the same issue as this https://www.insanelymac.com/forum/topic/340797-virtio-net-support-added-in-catalina

sickcodes commented 3 years ago

This is above my head but did anything cool happen?

jpmorrison commented 3 years ago

I wasn't able to test - I think I'll need to switch to virt-manager/virsh so I can hotplug devices and filesystems. @Leoyzen got about 20 Gbps performance out of it though. My vmxnet3 is getting "only" 2 Gbps so I'd like to see if virtIO is better. Maybe it'll work better as a second nic.

I'm not sure if +hypervisor is needed or not for the Apple guest kexts to work. Right now I have CPU=kvm64 and added +hypervisor,+pcid,+pdpe1gb,+pclmulqdq,+vmx,+rdtscp,,+tsc-deadline,+ss. I tried copying as many flags from an old mini that matched my ancient xeon. +vmx-unrestricted-guest seems to figure it out too.

VirtIO disk works too. Performance seems ok. I removed the ich9-ahci,id=sata device and set everything to virtio: -drive id=MacHDD,if=virtio

image

I ran Atto benchmark with the virtio disk - seems OK but I need to redo with the original settings.

One problem with VirtIO disk is that opencore doesn't remember to boot MacHDD so have to select manually. And without the ahci device, there's still a default dvd drive installed - I just click ignore in macOS and it seems fine. If virtio disk is better for anyone there are probably simple fixes/workarounds for this.

image

Qemu has virtio 9P and there's an Apple 9P virtio kext so that seems like a good thing to test next.

jpmorrison commented 3 years ago

Looks like virtio-net and balloon need Big Sur

Lots of good mac settings here: https://github.com/wimpysworld/quickemu

qxl video is integrated with System settings virtio-9p file sharing works

sickcodes commented 2 years ago

Thanks @jpmorrison, I'll check some of the settings on there