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
36.13k stars 1.78k forks source link

Define display memory (VRAM) #11

Closed antoineraulin closed 4 years ago

antoineraulin commented 4 years ago

Hi, I noticed that macos runs with 7~9 MB of vram on this project, which doesn't seem like much even if the system works properly anyway. I looked up how to increase the vram of a virtualized system with qemu-kvm, but most of the answers say to add a vga device with the desired vram size as an option, but this creates a conflict with the vga vmware option of qemu. Does anyone have an idea how to increase the vram for the current configuration?

sickcodes commented 4 years ago

Some notes here: https://github.com/kholia/OSX-KVM/blob/037a3edc8ddffb28940e59a54553ab5408276383/notes.md

If you can figure it out, write the additional qemu options here and I (or anyone who wants to contribute) can submit a pull request

antoineraulin commented 4 years ago

It seems to be related to the "Accelerated Graphics" paragraph of the file you're talking about, the document only mentions the Clover bootloader which is not used here. But I'll look into it more tomorrow, thank you !

sickcodes commented 4 years ago

You can use the clover boot loader actually it’s in directory /home/arch/OSX-KVM

docker run --privileged v /tmp/.X11-unix:/tmp/.X11-unix -it sickcodes/docker-osx /bin/bash

Run the Perl script to change the networking from tap to user mode on boot-macOS-NG.sh

Also change the ./backup to ./ on the ovmf line

I used to use the clover method but the new open boot one launches 1920x1080

antoineraulin commented 4 years ago

I'm having trouble getting clover to work, whether I'm using the clover from the Mojave folder or the Catalina folder (knowing that I upgraded from Mojave to Catalina my main disk) I always have this message appearing there osx

sickcodes commented 4 years ago

Download OSX-KVM from the upstream source https://github.com/kholia/OSX-KVM,

Import the Catalina xml into virt-manager and change the networking to user mode (see the Perl line in my Dockerfile)

Replace the .img with the one you have made in your container (stored in /var/lib/docker/....). Instructions regarding how to find the img in the readme.

Let me know if that helps

sickcodes commented 4 years ago

I’ll upload my virt manager xml shortly so anyone who wants to undockerize it can. They would have to install the packages, however.

antoineraulin commented 4 years ago

I've tried several things to try to increase the vram:

I still couldn't get clover to work. And with the virt-manager my keyboard and mouse aren't transmitted.

When your libvirt config file will be available I’ll try again.

sickcodes commented 4 years ago

My libvirt one was OpenCore-Boot actually but here's the one I used to boot, first thing you'll notice is it starts in 1000x1000

MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"

OVMF="./"

qemu-system-x86_64 -enable-kvm -m 5500 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=4 \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/CloverNG.qcow2' \
-device ide-hd,bus=sata.2,drive=Clover \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 \
-monitor stdio \
-vga vmware
antoineraulin commented 4 years ago

thanks for your config, actually it looks pretty much like the one I came up with after multiple small adjustments, I feel like one of the only ways to get more vram would be to do a gpu-passthrought. Anyway, thanks for the effort you put into this project, it's wonderful. Feel free to close this issue if you want.

sickcodes commented 4 years ago

Thanks dude! Will be following upstream developments and make appropriate changes if they come through.