Difficulty running GUI applications in a container with a windows host

Hey all,
I’ve recently gotten into playing around with docker, and all the concepts seem simple enough, but I’ve been having some trouble as I attempt to run Firefox in a container on my windows machine.

Currently, I’ve got a very simple Dockerfile set up in a dedicated folder, with the following commands:
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y firefox
CMD /usr/bin/firefox

From what I’ve found, I need an xorg x11 display server set up on the host machine to be able to display the UI, not problem. So I have Xlaunch installed, and I have it set up to Disable access control and with all other options left as default. I build my image using “docker build -t firefox .”, and I’m trying to run it using “docker run -ti --rm -e DISPLAY=$DISPLAY firefox”. I also configured my environemnt DISPLAY variable using “set-variable -name DISPLAY -value YOUR-IP:0.0”, with YOUR-IP subsituted for the IP of my machines Wireless LAN adapter - “WiFi”, but I’ve also experimented with all the other IP’s of my other adapters shown when I use ipconfig to no avail.

With this setup, I continually get the error:
error: XDG_RUNTIME_DIR not set in the environment.
Error: cannot open display: YOUR-IP:0.0

I’ve checked everywhere for the solution for this, but to no avail. Here’s the link to the main tutorial I used for the commands and process:

Host:
Windows 11
Lenovo Yoga L390

Client:
Fedora 41 with Firefox browser

Does anyone know how to fix this issue? I haven’t been able to solve it even after looking at multiple other posts on different forums, I’d be grateful for the help. If there’s any more info I need to supply, let me know and I’ll append it.

When a tutorial is 6 years old (which is forever in I.T.), it is always beter to look for a more recent guide. You can have many problems with an old Ubuntu with a probably old firefox. I guess you use an old one because new firefox versions from an apt repository are actually snap packages if I remember corre tly. At least I had problems with that and tried to install firefox without snap which I found somewhere on the firefox website.

If you only need firefox, I can recommend images that contain firefox and a remote desktop which can be used from a web browser

https://hub.docker.com/r/linuxserver/firefox

I know it is possible the way you try, but don’t have quick answer to that right now