How to enter Docker VM terminal on MacOS 14?

Im trying to enter in docker VM terminal on MacBook M1 Max, MacOS 14 using command screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty but there is tty file there. Which path is correct?

I talked about it on a Docker Community All hands. The video link can be found here too:

and in the GitHub repository you can find a readme specifically for Docker Desktop for Mac

That was mainly just notes for me for the presentation, but you can find links to Bret Fisher’s gist and other useful sites. You can also find this command:

socat $HOME/Library/Containers/com.docker.docker/Data/debug-shell.sock -,rawer

which still works.
If you have a working Docker cli, then you can also try this command:

docker run -it --rm --privileged --pid=host justincormack/nsenter1

You can then use the ctr command to enter containers that run Docker components.

This is good for debugging, but you should not change anything in the VM and you can’t install anything.

1 Like

Thx very much! But how I can edit vm permanently? For example edit sysctl variable in /etc/sysctl.conf ?

You can’t. On Windows I managed to run sysctl commands in a WSL distribution as the containers are all isolated environments on top of the same kernel, so you could try the same after entering the VM using socat, but the filesystem of Docker Desktop is readonly and you can’t write or install anything in it. So temporarily you can do this for example from the VM:

sysctl -w key=value

and you will get the same value from the containers too.

sysctl -a
1 Like