MacOs in Docker


Recommended Posts

Not much of a guide, more of a sharing info on this project. Easiest way to create a MacOs vm in a docker container.

 

For unraid I've used the vnc-version. Simply download the project, go into vnc-version and create a Catalina with this 2 commands:

 

Create your own image with 

docker build -t docker-osx-vnc .

 

Run container with 

docker run --device /dev/kvm --device /dev/snd -p 8888:5999 -p 50922:10022 -d --privileged docker-osx-vnc:latest

 

Access vnc with password extracted with 

docker ps
# copy container ID and then 
docker exec abc123fgh456 tail vncpasswd_file

 

Video at 

 

Edited by juan11perez
  • Like 1
Link to comment
  • 1 month later...

Thanks for this, Juan. You set me on the right path. I also saw your comment on the Github issues page for the vnc-version only working with Catalina.

 

I dug around a bit and have a working docker run command that seems to be working. I'm currently installing Ventura using VNC without having to manually build the image. This looks to have done it for me.

 

docker run -i \
    --device /dev/kvm \
    --device /dev/snd \	
    -p 50922:10022 \
    -p 8888:5999 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e EXTRA="-display none -vnc 0.0.0.0:99,password=on" \
    -d --privileged \
    sickcodes/docker-osx:ventura

 

 

 

Edited by matt4542
  • Like 2
Link to comment
  • 2 weeks later...
On 1/15/2023 at 7:17 PM, matt4542 said:

Thanks for this, Juan. You set me on the right path. I also saw your comment on the Github issues page for the vnc-version only working with Catalina.

 

I dug around a bit and have a working docker run command that seems to be working. I'm currently installing Ventura using VNC without having to manually build the image. This looks to have done it for me.

 

docker run -i \
    --device /dev/kvm \
    --device /dev/snd \	
    -p 50922:10022 \
    -p 8888:5999 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e EXTRA="-display none -vnc 0.0.0.0:99,password=on" \
    -d --privileged \
    sickcodes/docker-osx:ventura

 

 

 

 

Matt,

 

I used your docker run command and everything builds fine, however I cannot for the life of me figure out how to connect via VNC. How did you find the password?

 

Edit: For anyone who finds this thread and has the same question, the answer was out there, I just didn't understand. Once the docker is installed and visible in your docker tab as started do the following:

 

Stop the docker by clicking the docker name and choosing stop.

Open a terminal and run "docker ps" to get a list of your docker images.

Start the docker from the terminal by typing "docker start -i 123abc456def"

The docker should start and probably end on the line "audio: Failed to create voice 'adc'" - hit enter to come to the (qemu) prompt.

Type "vnc password xxxxxxxx" where xxxxxxxx is the password you wish to set. Now you should be able to connect via VNC.

 

This password process has to be done every time you start the docker and if you close the terminal the docker will stop. Instead of trying to figure out how to script or automate this process I just installed Teamviewer once the OS installation completed and I no longer use VNC.

Edited by letum00
Link to comment
On 1/15/2023 at 4:17 PM, matt4542 said:

Thanks for this, Juan. You set me on the right path. I also saw your comment on the Github issues page for the vnc-version only working with Catalina.

 

I dug around a bit and have a working docker run command that seems to be working. I'm currently installing Ventura using VNC without having to manually build the image. This looks to have done it for me.

 

docker run -i \
    --device /dev/kvm \
    --device /dev/snd \	
    -p 50922:10022 \
    -p 8888:5999 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e EXTRA="-display none -vnc 0.0.0.0:99,password=on" \
    -d --privileged \
    sickcodes/docker-osx:ventura

 

 

 

Can you expand on this command? When I run it in terminal I get this

eII7JTz.png

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.