Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

(I debated between posting this here, ServerFault, and StackOverFlow. Settled for this. Hopefully it's in the right place.)

We run our UI testing suite using Selenium Grid 2 with an Amazon EC2 Windows machine (that is started up in using Amazon's CloudFormation APIs). My question is, how do I change the resolution of that machine?

If I remote into it, I can specify the resolution using Remote Desktop. But obviously that doesn't permanently change the resolution. When we run our tests, the resolution is so small that the browser scrunches the elements together and causes the tests to fail.

Any ideas? Is there something I can put in the CloudFormation recipe? Is there something I can do to the image before creating the AMI?

Screenshot of Device Manager

Thanks.

share|improve this question
1  
Interesting. It must be a standard instance I imagine, so no CUDA graphics cards assigned to the instance. So you are working with a standard virtual graphics card. What does it look like in device manager? Can you post a screenshot? You may be able to force it higher by rdp-ing to the console: mstsc.exe /console –  Paul Apr 19 '12 at 23:59
    
@Paul, I added a screenshot. It is a standard instance. Windows Server R2. Thanks. –  Joel Apr 20 '12 at 14:45
    
@Joel, did you ever resolve this? I've been trying to find ways to do this for several days, including using the answers below, but no luck so far. On reboot, or creation from AMI (even ones that have had the answers applied to them), they still start in 1024x768. –  Sean Aug 14 at 16:36

2 Answers 2

Disclaimer: TightVNC is not secure, so if security is an issue, you may need to find a different approach. The whole process will take only a few minutes, so the security hole is small, but there nonetheless.

  1. Install TightVNC Server on the EC2 instance so you can log into the console
  2. Disconnect all user remote desktop sessions and return the session to console
  3. Use the TightVNC Viewer to log into the EC2 instance console, ensuring port 5900 is open for that connection
    • Right-click on the desktop and select "Screen resolution"
    • Select "Advanced settings"
    • Select "List All Modes"
    • Select a higher resolution
share|improve this answer

You can change the screen resolution by modifying two registry values. These two values are: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Video\GUID\0000\DefaultSettings.XResolution HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Video\GUID\0000\DefaultSettings.YResolution Where GUID is a randomly generated GUID.

You can actually specify any XResolution and YResolution value as long as they are hexadecimal.

Note: In the case of a CRT monitor specifying an absurd resolution might damage your monitor. In the case of a LCD monitor your monitor might not show any user interface anymore. A good way to change your Screen resolution is to write down the amount of pixels you want to fill your screen width with (this is the XResolution) and the amount of pixels you want on your screen height (the YResolution). The Windows calculator (not available in Server Core , you will have to find another computer or a hardware advanced calculator) offers an easy way to convert decimal amounts to hexadecimal amounts. You can then use these values to modify the corresponding registry values. A restart will make your preferred screen resolution meet reality.

The color depth used on your monitor is captured in the following registry value: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Video\GUID\0000\DefaultSettings.BitsPerPel On my box this hexadecimal value was set to 0x00000008 (8) which meant my screen used an 8 bit color depth. (256 colors) Changing it to 16 bits (0x00000010) will show 65536 colors (High Colors) Other values that are typically available are 24 bits (0x00000018) and 32 bits (0x00000020).

Source

share|improve this answer
    
I don't have the DefaultSettings.*Resolution keys in any of the GUID.0000. I think it's because it only has virtual devices. Can I add that key to each of them? Would that work? –  Joel Apr 20 '12 at 14:42
    
@Joel: I doubt it. Isn't there a 'Video' branch at all? I have a Server Core 2008 R2 instance on EC2, so I'll have a look at it this evening. –  paradroid Apr 20 '12 at 15:22
    
Yeah, didn't think so. Thought I'd ask anyway. I'll keep looking for solutions. Let me know if you find anything. Thanks. –  Joel Apr 20 '12 at 16:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.