Docker Community Forums

Share and learn in the Docker community.

Windows GUI support in Docker

I’ve a windows application with both UI written in C# and C++. They are written with WPF and Winforms etc.
Can I create a docker container for this?
So, I could only find UI support with a browser but not anything on GUI support for windows application in a container.

As of now I created a c++ console exe and displaying a messagebox…and when a image/container is created and run the messagebox does not show up and the the container is stuck.

Any help is highly appreciated?

Thanks in advance,

1 Like

Docker currently does not support Windows GUI applications at all.

But through X11 connection with the DISPLAY env. variable is it not possible? like its done in the linux OS for GUI apps…

I’m afraid not. Windows does not use X11.

Thanks rajchaudhuri for your prompt response.
Do you know if Docker’s team plans to have this feature in the future?

Thank you.

I don’t know, and I suspect something like this would require work by Microsoft, not just the Docker team.

Just wanted to confirm, if this feature is still not possible or with newer releases this is possible now? Most of the threads, I am reading are a year old, so wanted to confirm.

This is just sad. There are SO many Windows developers who need WinForms support and it seems impossible to get a definitive, up-to-date, YES/NO. I asked the same question and received no reply.

Is it possible to run WinForms applications and interact with them, in a Docker container?
(No, it hasn’t been, but has anything changed or is anything likely to change?)

If so, how?
If not, can you give us any idea if this is likely to happen, and when it might be possible, please?

We have a large amount of legacy applications we would LOVE to containerize but we are just wasting time with Docker if it cannot and never will do this. If it is being looked at and is slated for the future, an estimate of when it might be available would help us to forward plan.

I don’t understand why this is so hard… Is it because it is Open Source and nobody is actually responsible for it?

There are a few different options to run GUI applications inside a Docker container like using SSH with X11 forwarding, or VNC but the simplest one that I figured out was to share my X11 socket with the container and use it directly. If all goes well you should see Firefox running from within a Docker container.

Thanks for the response, lewish95. I have done some checking and the latest releases of Windows 10 now contain both SSH and X11 support. I want to run a Windows container running a small Winforms application written in C#, as a test, before moving to more ambitious stuff. Currently, I can use a Windows core image container and load the application into it but, of course when I start it, nothing happens…Apparently, all of the code to support the GUI is in the image but it simply can’t work…

I haven’t used SSH before so I’d be very interested to see what you did. Are you prepared to share it or is there a link somewhere? Any help would be appreciated.