Closed GrabbenD closed 3 years ago
Yes, using the VNC version.
@jviotti knows how to setup the auto boot to correct disk, I'm not sure how.
You can write a an xdotool script to format the disk first too or can use hfsprogs to make the disks
@sickcodes @xRiot The trick is to create a custom OpenCore image (https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Catalina/OpenCore.qcow2) that boots in the way you want it to boot. Docker-OSX loads this image here: https://github.com/sickcodes/Docker-OSX/blob/master/Dockerfile#L156-L157
&& tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2 \' \
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
You can tweak OpenCore's config.plist
(https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Catalina/config.plist) and re-build it using this script: https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Catalina/opencore-image-ng.sh.
These are some of the settings you might be interested in: https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Catalina/config.plist#L520-L529
<key>PickerMode</key>
<string>External</string>
<key>PollAppleHotKeys</key>
<true/>
<key>ShowPicker</key>
<true/>
<key>TakeoffDelay</key>
<integer>0</integer>
<key>Timeout</key>
<integer>0</integer>
You can find the docs here: https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/Configuration.pdf
Thanks a lot for the information @jviotti @sickcodes!
I can see that there's a display being exported in the VNC version. Would it be possible to entirely drop rendering of the desktop to save resources? I'm looking into only using SSH to access the container post installation.
Maybe try booting into the recovery disk, it has a terminal, I haven't tried automating it tho.
@jviotti Thanks for uploading that mate! I will add that second auto-booter next week unless someone wants to do a PR 😛
Thanks for the insights @sickcodes!
At the moment the VNC container boots into boot disk selection menu, is there a way to automatically boot into the (predefined/right) disk?
Yes there is, @jviotti just explained above that you need to build a custom OpenCore qcow boot disk.
Hello @sickcodes, have you released the auto-booter option yet? Thanks @jviotti for the tips !!
I think this is it:
https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Catalina/OpenCore-nopicker.qcow2
Will have a look later this week
I think this is it:
https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Catalina/OpenCore-nopicker.qcow2
Will have a look later this week
This is working ! It would be great if you add an option to choose the OpenCore version :)
Thanks for the great work with this tool @sickcodes !
Sure, unless someone would like to submit a PR:
docker exec id sed -i -e opencore.qcow
to the new version
Will work in both VNC and regular containers btw
Thanks for your amazing efforts @sickcodes, I am running this on a VM on the cloud and wanted to make it boot autmatically, so I tried these two commands but did not work yet!
docker exec 260b77373875 mv ./Launch-nopicker.sh ./Launch.sh
# This one didn't work as well
docker exec 260b77373875 bash -c "grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh
chmod +x ./Launch-nopicker.sh
sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
"
sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true
sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true
exec qemu-system-x86_64 -m ${RAM:-8}000 \
-cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \
-machine q35,accel=kvm:tcg \
-smp ${SMP:-4},cores=${CORES:-4} \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \
-drive if=pflash,format=raw,readonly,file=/home/arch/OSX-KVM/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \
-device ich9-ahci,id=sata \
#============>This seems okay! <===========
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900, -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:09:49:17 \
-monitor stdio \
-vga vmware \
I am not sure putting container run logs would help here.
@jviotti could you please elaborate more on how to do your approach, I couldn't understand the "create a custom OpenCore image" part. Thanks
Edit
Running process monitor htop
shows that docker or maybe arch-linux didn't update the image yet, I am still trying to figure out how to update it.
Edit 2
I found the issue, I am using vnc-version docker which uses Launch_custom.sh file
instead of Launch.sh
docker exec 260b77373875 bash -c "grep -v InstallMedia ./Launch-nopicker.sh > ./Launch_custom.sh
chmod +x ./Launch_custom.sh
sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch_custom.sh
"
@sickcodes maybe adding this to the readme so others won't fall into the same mistake I did, thanks.
Is there any way to build/perform a full installation of the container with no display to make it fully automated?
Thanks in advance for any help with this.