Running windows Desktop GUI-based Application inside containers - windows

I want to containerize one of my Windows desktop application(GUI). But i want to use the GUI outside the containers, ( i.e) in the machine where the containers are hosted.
Is there any possible way to share the display inside the container to the host(Only the application display)?
Or is there any way to view the application in the host browser. Are there any display exporters available?

Related

Is there a way to trick GUI applications in docker to think their window loaded?

I try to run an windows 10 application inside a windows servercore container.
The app can run without user input via COM-Interface (and without visible GUI), but it seems that it needs to load a hidden window in the background. When I start it on docker, the application log file indicates that it's stuck on starting this window.
Is there a way to make the app assume it successfully loaded the window?
All information I found so far was about users who want to see the GUI or about Linux/Windows combinations. None of that helped me.

Windows Containers - Is it possible to interact with desktop apps running in a container using the Desktop Sharing API?

I understand that desktop/GUI apps are not supported in Windows containers. They do run but there's no built-in way to interact with them. I had the following idea - maybe I could use the Desktop Sharing API (https://learn.microsoft.com/en-us/windows/win32/api/_rdp/) for this purpose, the idea is to run a desktop app, then run a sharing program that uses the Desktop Sharing API, and connect to it using a Desktop Sharing API viewing program from the host.
I had to do some recap about window stations and desktops, and I noticed that when starting the container with cmd in interactive mode, I'm logged with ContainerAdministrator as a service (logon type 5). I tried running some WinAPI functions that deal with desktops and winstation and got some access denied results, so I switched to running cmd as system.
The window station of the cmd process (and other child processes) is not the interactive WinSta0, but instead some other service window station, which makes sense since I'm logged on as a service, and I figured that I can't use this window station, so I used a little program I wrote to run notepad in Winsta0 in the Default desktop. Afterwards I ran another program that enumerates the windows on WinSta0\Default, and the notepad window does get enumerated and I also get it's title, so it's running somewhere.
So now I tried running the desktop sharing API program (also on WinSta0\Default). It runs and I can connect from the host, but I only get a black screen without anything on it. I also tried running a program that takes a screenshot of the windows but I get an empty bitmap.
So I thought maybe the Default desktop is not the active desktop, and by using the OpenInputDesktop function I could confirm it - the current desktop was the Winlogon desktop, so I used the SwitchDesktop function to switch to the Default desktop (I used OpenInputDesktop again to verify that it actually worked).
Unfortunately, this didn't change anything, I still get an empty screen and empty bitmaps.
I know that containers are built for micro services and are not supposed to run GUI apps and so, but still - is there a way to make this work? Or any ideas of what else I can check? Alternatively, if you know that it can't work - I would also be happy to hear a good technical explanation of why it doesn't work.

Is it possible to run GUI apps in headless Windows containers?

This question is similar to but different from Is it possible to run GUI apps in windows containers? in the following way: I do not wish to login and see the GUI. Instead, I would like to know if is possible to start a winforms or wpf application from the commandline inside of a Windows container. If it runs at all, what are the window/screen implications for the GUI application?
Perhaps I have an GUI application that starts listening on a port when a user clicks a button. And perhaps I want to test this application in an automated way, both with a script that triggers a GUI button click also running in the container, and a script that creates and runs a container with both the GUI app and the button clicker.

TomEE Service will not allow to access the application from another LAN Machine

I have deployed my webapps in apache-tomee-plus-1.5.1 and start the server using startup.bat in a windows VM. It's working fine and accessible from any other LAN machine using VM's ip, i.e., 192.168.1.236:8080/archiva.
Now, I want to install the server as a service. For that I have install a service using "service.bat install Archiva" command. When I start the service the application is working fine using localhost/192.168.1.236 from the VM. But not accessible from other LAN machine.
FYI, when I start the service the tomcat home page is shown after hitting 192.168.1.236:8080.
Please help.
Go to Windows Start --> Control Panel
Open Windows Firewall(If not showing, please search it and open).
Click on Allow a Program or Feature through windows firewall
see image...
Click on Change settings and then Allow another program...
Then add all the TomEE.*.exe and press ok.
see image...
Restart your service and application is available from LAN.

How can I detect graphic server presence?

I am developing a small console application with graphic capabilities.
I want to run this application on a remote windows session without graphic.
How can my application discover that it needs to run in console mode?

Resources