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
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).
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
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.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.