sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
48.63k stars 2.71k forks source link

Run Docker-OSX directly in powershell #774

Open KernelInterrupt opened 5 months ago

KernelInterrupt commented 5 months ago

Actually, we can simply run Docker-OSX on WSL2 without getting into distros (just using PowerShell),and it fixed issue #430. Let me explain that: When using Docker Desktop on windows,it created two speical distros called docker-desktop and docker-desktop-data In other distros,Wslg is in /mnt/wslg But in docker-desktop,Wslg is in /mnt/host/wslg What is worse is that the container actually boot in docker-desktop-data,and then /mnt in docker-desktop was mounted to /run/desktop in docker-desktop-data. Therefore,we actually need to mount /run/desktop/mnt/host/wslg/.X11-unix to /tmp/.X11-unix to get video output.

KernelInterrupt commented 5 months ago

Let me explain more: When executing command in Powershell,the existing commands actually mount a non-existent path to /tmp/.X11-unix,which causes errors like gtk initialization failed.By changing the path(/mnt/host/wslg/.X11-unix -> /run/desktop/mnt/host/wslg/.X11-unix),we can mount Wslg in docker-desktop to /tmp/.X11-unix to get video output.