re: Run GUI app in linux docker container on windows host VIEW POST


Hi Robin,

Thanks for the tutorial. When I run docker run -ti --rm -e DISPLAY=$DISPLAY firefox I get the following error. I have set my $DISPLAY variable equal to (note this is a fake IP I just made up, I'm using my actual IP in the script). Here's the error.

error: XDG_RUNTIME_DIR not set in the environment.
Error: cannot open display: $DISPLAY

Any thoughts?


Got it! I was running everything in CMD instead of PowerShell. That was dumb.


Glad you figured it out by yourself, my first idea would have been to ask if you're using powershell or cmd :)

I get the above error also through PowerShell

Rauno, did you try running your PowerShell in elevated mode?

Yes, I tried both. I suspect my issue has something to do with Windows Firewall (and corporate antivirus software which has taken control of that).

Hi Rauno,
Did you fix this issues?
I had the same issue and I solve it just adding the :0.0 after my IP

funSkill, could this comment solve it?

I notice that windows firewall can block the connection to the container.

You can allow this access via firewall settings for "VcXsrv windows xserver".

Also, if you only want to give your xserver private network access, you can use:

Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private


Hi Robin,
I tried it to but issue solved after adding the :0.0 after my IP

Thanks for article. It' very helpful for me!

Good you figured it out, you're welcome :)


Got it! I was running in CMD shell vs Powershell. That fixed the issue.

code of conduct - report abuse