Question about persistent setup and docker commit #333

Open
opened 2025-12-29 00:24:40 +01:00 by adam · 4 comments
Owner

Originally created by @sebbekarlsson on GitHub (Mar 9, 2022).

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

Originally created by @sebbekarlsson on GitHub (Mar 9, 2022). 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
Author
Owner

@Julioevm commented on GitHub (Mar 11, 2022):

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" \

@Julioevm commented on GitHub (Mar 11, 2022): 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" \`
Author
Owner

@maltegrosse commented on GitHub (Mar 11, 2022):

perhaps there are some use cases where avoiding docker and using osx-kvm directly makes more sense..

@maltegrosse commented on GitHub (Mar 11, 2022): perhaps there are some use cases where avoiding docker and using [osx-kvm](https://github.com/kholia/OSX-KVM) directly makes more sense..
Author
Owner

@Julioevm commented on GitHub (Mar 11, 2022):

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 🙂

@Julioevm commented on GitHub (Mar 11, 2022): 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:
Author
Owner

@satmandu commented on GitHub (Apr 26, 2023):

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
@satmandu commented on GitHub (Apr 26, 2023): 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 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#333