DEV Community

Discussion on: Run GUI app in linux docker container on windows host

Collapse
 
pbrady32 profile image
pbrady32

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 10.17.12.01:0.0 (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?

Collapse
 
pbrady32 profile image
pbrady32

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

Collapse
 
pbrady32 profile image
pbrady32

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

Collapse
 
darksmile92 profile image
Robin Kretzschmar

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

Thread Thread
 
rots profile image
Rauno Ots

I get the above error also through PowerShell

Thread Thread
 
darksmile92 profile image
Robin Kretzschmar

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

Thread Thread
 
rots profile image
Rauno Ots

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).

Thread Thread
 
funskill profile image
funSkill • Edited

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

Thread Thread
 
darksmile92 profile image
Robin Kretzschmar

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

src

Thread Thread
 
funskill profile image
funSkill • Edited

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!

Thread Thread
 
darksmile92 profile image
Robin Kretzschmar

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