Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to containerize a Windows GUI application on a Windows host?

Tags:

docker

windows

I have a rather difficult to manage Windows closed-source Windows GUI application. It's messy (leaves files all over the place) and has a convoluted installation process.

It has been proposed that we containerize the application, but can this be done?

For UNIX applications there's an easy pattern - just give the app access to the port of the X11 server, and allow the app to write to that, but is there a Windows equivalent? Is there any way at all to containerize a Windows application but allow it to generate windows in the host Operating System's desktop?

If this is possible, are there any handy recipes to get started with this?

like image 701
Salim Fadhley Avatar asked Jan 21 '19 14:01

Salim Fadhley


People also ask

Is it possible to run a GUI application in a container?

Currently, It's not possible to containerized Windows GUI application on a windows host. Lars Iwer [MSFT] writes in the comments below the article: "In the container image as it is right now, GUI elements will be rendered in session 0. UI automation should work with that (e.g. programmatically searching for a window etc.)."

Is it possible to display a GUI in a docker container?

It seems that to display the GUI I would have to use a server (like in this case: Windows 10 Docker Host - Display GUI application from Linux Container) but because I'm not using a linux container but rather a windows container the stuff about X11 server doesn't seem relevant.

Can We containerize a Unix application?

It's messy (leaves files all over the place) and has a convoluted installation process. It has been proposed that we containerize the application, but can this be done? For UNIX applications there's an easy pattern - just give the app access to the port of the X11 server, and allow the app to write to that, but is there a Windows equivalent?

Are Windows Containers applicable to cloud-optimized applications?

Deployments that are based on Windows Containers are applicable to Cloud-Optimized applications and Cloud-Native applications. However, in this guide and especially in the following sections, it mostly focuses on using Windows Containers for Cloud-Optimized applications where you don't need to rearchitect your application. What are containers?


1 Answers

Currently, It's not possible to containerized Windows GUI application on a windows host.

From the blog Insider preview: Windows container image

Lars Iwer [MSFT] writes in the comments below the article: "In the container image as it is right now, GUI elements will be rendered in session 0. UI automation should work with that (e.g. programmatically searching for a window etc.)."

So according to my understanding, you can run GUI apps but the rendered elements are not shown on any desktop which will only work for UI automation work but not for user interactive application.

Session 0:

Session 0 is reserved exclusively for services and other non-interactive user applications. Users who are logged on to Windows and their user applications must run in Session 1 or higher. - User interfaces in Session 0 are not supported. Processes running in Session 0 have no access to the graphics hardware thus user interfaces cannot be directly displayed on the monitor.

like image 105
vivek jain Avatar answered Oct 17 '22 07:10

vivek jain