Docker Tip #70: Gain Access to the MobyLinux VM on Windows or MacOS
You can't just load up your hypervisor's management app and log into the VM that Docker created, but you can check it out. Here's how.
This tip applies to anyone running Docker for Windows or Docker for Mac in 2021+.
Access the MobyLinux VM’s file system:
docker container run --rm -it --privileged \
--pid=host alpine:edge nsenter -t 1 -m -u -n -i sh
And BLAMO, you’re inside of the MobyLinux VM’s file system (aka Docker Desktop).
Now if you run
ls -la you’ll see all sorts of things, such as your mounts. In Docker Tip #69 I talked about protecting against Docker’s container logs from eating up all of your disk space. This was how I figured how much space was being used on my Windows system.
du -chs /var/lib/docker/containers/*/*json.log inside of the container we’re in now, which tallies up the total disk space used by all container logs.
When you’re done looking around you can hit
CTRL + D or type
exit to quit.