views:

320

answers:

3

In virtualbox, the screen resolution can be anything - even something strange like 993x451, etc. I tried changing it using pywin32 but I failed::

>>> dm = win32api.EnumDisplaySettings(None, 0)
>>> dm.PelsHeight = 451
>>> dm.PelsWidth = 950
>>> win32api.ChangeDisplaySettings(dm, 0)
-2L

which ends up being:

DISP_CHANGE_BADMODE

any help?

A: 

Do you have VirtualBox set to automatically set the client window? that could cause some issues.

Kenneth Reitz
I just tried both ways, and no luck.
Claudiu
+1  A: 

Have you configured the virtual machine to actually advertise this mode to the OS?

edit: VirtualBox automatically sets new resolutions if you change the size of the window. You can set video mode hints from the host OS I believe (look for it in the documentation), but you need guest additions installed. You can also add VESA modes when using the fallback VESA driver. Either way, it seems this all needs to happen from the host OS for the guest OS to be able to make use of it. And it doesn't look like there's an easy (non cmdline possibly not persistent) way to configure it, though YMMV.

I haven't tested it but the command should be: VBoxManage controlvm

You can also set the maximum guest OS screen size, found this while looking into it a bit deeper: VBoxManage setextradata global GUI/MaxGuestResolution xres,yres

HTH

wds
No - do you know how I'd go about doing that?
Claudiu
kinda, see above
wds
A: 

The way I found to do this is to enable the automatic client resizing from the Guest OS. Then, in the host OS, programatically resize the VM window. This will cause the resolution to change.

Claudiu