Open sebbekarlsson opened 2 years ago
What you need to do is extract the HDD image and use it when you create a new container, so you always keep the same data.
You can find the image like this:
sudo find /var/lib/docker -size +10G | grep mac_hdd_ng.img
Move it somewhere you want to have it accessible. Then start a new container with the parameter.
-v "the-location-you-pick/mac_hdd_ng.img:/image" \
perhaps there are some use cases where avoiding docker and using osx-kvm directly makes more sense..
Yes for a simple persisten setup, osx-kvm can be enough. But I think Docker-OSX is easier to setup these days. Up to him to decide :slightly_smiling_face:
For those trying to do this with the High Sierra image, this is what I had to do:
#!/bin/bash
docker run \
--privileged -i \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /LOCAL_PERSISTENT_PATH/mac_hdd_ng.img:/home/arch/OSX-KVM/mac_hdd_ng.img \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
-v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
sickcodes/docker-osx:high-sierra
Some background: I'm using this to work on an IOS app in XCode.
I really need my setup to be persistent so that I don't need to re-install OSX everytime. Do I understand things correctly, I need to run "docker commit" everytime before I shut down the OSX machine in order to save the state?
Cheers, Sebastian