microsoft / Windows-Containers

Welcome to our Windows Containers GitHub community! Ask questions, report bugs, and suggest features -- let's work together.
MIT License
424 stars 64 forks source link

Display Resolution setup in dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 windows server core docker image to 1920X1080 #527

Open RavitejaAmruthapu opened 2 months ago

RavitejaAmruthapu commented 2 months ago

Hi,

How to setup the dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 windows server core docker container display resolution to 1920X1080?

please help me to setup

Thanks & Regards, Raviteja

ntrappe-msft commented 2 months ago

Hi, did you try using the environment variable -e?

Example:

docker run -it -e DISPLAY_WIDTH=1920 -e DISPLAY_HEIGHT=1080 mcr.microsoft.com/windows/servercore:ltsc2022
RavitejaAmruthapu commented 2 months ago

Thanks for replay.

tried with above env variables and it is not setting the resolution.

docker run -it -e DISPLAY_WIDTH=1920 -e DISPLAY_HEIGHT=1080 mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 powershell

image
ntrappe-msft commented 2 months ago

Hi, I dug a little deeper and it looks like setting the display resolution in a Windows Container is not supported. Could we learn more about your use case or why this would be beneficial?

RavitejaAmruthapu commented 2 months ago

Hi, we are running automation testcases on dotnet based web app which will launch browser and access the application. Automation test framework is executing seamlessly when we run in windows server VM of 5 with resolution 1920X1080 but where as failing in windows server container as we are unable to set display resolution. we can parallelize the tests case execution in windows server containers instead of running in VM's.

vrapolinario commented 2 months ago

I'm not sure this will work, but can you try the same with the Server image? You will need to install the .Net components in it as there's not native .Net image for Server, but since that image has the GUI APIs, it might work.

RavitejaAmruthapu commented 2 months ago

thanks for replay. will try there and let you know the status

ntrappe-msft commented 2 months ago

Using the PowerShell command, Set-DisplayResolution, inside of a container won't work. There's a check that compares the session desktop vs calling thread desktop and it'll always fail. (I don't know whether the GUI APIs help us go around this desktop check though).

microsoft-github-policy-service[bot] commented 3 days ago

This issue has been open for 30 days with no updates. @ntrappe-msft, please provide an update or close this issue.