- 1 year ago
X11 forwarding applications from docker containers on Windows without using DISPLAY=host.docker.internal:0
To run X11 forwarding applications from Docker containers on Windows without using DISPLAY=host.docker.internal:0, you can try the following steps:
Install an X11 server on your Windows machine. Two popular options are Xming and VcXsrv.
Start the X11 server and set the DISPLAY environment variable to the IP address of your Windows machine. You can find the IP address by running the command
ipconfig
in a Command Prompt window.In your Dockerfile, install the X11 client libraries and set the DISPLAY environment variable to the IP address of your Windows machine.
When running your Docker container, map the X11 socket to the container using the
-v
option. The command should look something like this:
arduinodocker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=<your Windows IP>:0 <your image name>
This command maps the X11 socket from the host to the container and sets the DISPLAY environment variable to the IP address of your Windows machine.
- Inside the Docker container, install the X11 application you want to run and launch it as you normally would.
With these steps, you should be able to run X11 forwarding applications from Docker containers on Windows without using DISPLAY=host.docker.internal:0.