Export for qemu usage outside docker? #635

Open
opened 2025-12-29 01:24:03 +01:00 by adam · 1 comment
Owner

Originally created by @nreith on GitHub (Dec 14, 2024).

I understand there is a need to manually save/export the docker container as an image, or save the container state in order to continue using docker-osx from where you left off without having to reinstall sonoma or whatever version that takes like 30 minutes, and not lose your work.

Does anyone know once this is all built inside the docker container, is there a way to export it, or copy certain files like the .img outside of the container, and then run those normally with qemu without the docker layer on top?

If that were possible, I imagine it would also be possible then to convert that vm .img to other formats and potentially run it directly in other hypervisors like hyper-v, vmware workstation, or virtualbox?

Thanks

Originally created by @nreith on GitHub (Dec 14, 2024). I understand there is a need to manually save/export the docker container as an image, or save the container state in order to continue using docker-osx from where you left off without having to reinstall sonoma or whatever version that takes like 30 minutes, and not lose your work. Does anyone know once this is all built inside the docker container, is there a way to export it, or copy certain files like the .img outside of the container, and then run those normally with qemu without the docker layer on top? If that were possible, I imagine it would also be possible then to convert that vm .img to other formats and potentially run it directly in other hypervisors like hyper-v, vmware workstation, or virtualbox? Thanks
Author
Owner

@doclongdong commented on GitHub (May 13, 2025):

+1 to this. As someone who has run macos VM in each of these three formats (docker-osx, qemu-kvm alone, VMWare) it seems like it should be possible to do [docker-osx] -> [qemu-kvm alone] by taking the macos_*.img file out of /var/lib/docker, but for me (running under WSL2) this directory did not exist, only /var/lib/docker-desktop with no files save for mount.binds.

Converting it to vmware is possible I think but the problems you can run into depend on the hardware. In setting up a VMWare image of MacOS from scratch on AMD hardware I had to change a bunch of CPU stuff in the vmx which required serious fiddling, and that same kind of thing might be required if you were to actually boot macos in vmware after converting the QEMU img

@doclongdong commented on GitHub (May 13, 2025): +1 to this. As someone who has run macos VM in each of these three formats (docker-osx, qemu-kvm alone, VMWare) it seems like it should be possible to do [docker-osx] -> [qemu-kvm alone] by taking the `macos_*.img` file out of `/var/lib/docker`, but for me (running under WSL2) this directory did not exist, only `/var/lib/docker-desktop` with no files save for `mount.binds`. Converting it to vmware is [possible ](https://community.broadcom.com/vmware-cloud-foundation/discussion/migrating-from-kvm-to-vmware) I think but the problems you can run into depend on the hardware. In setting up a VMWare image of MacOS from scratch on AMD hardware I had to change a bunch of [CPU stuff in the vmx](https://www.insanelymac.com/forum/topic/350387-install-macos-on-vmware-workstation-16-amd-ryzen/) which required serious fiddling, and that same kind of thing might be required if you were to actually boot macos in vmware after converting the QEMU img
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#635