virtualbox: setting up 1680×1050 screen resolution

I still cannot believe that I spent 8 hours trying out to setup this screen size under virtualbox …

ok some context first.

I am using vmware for 3 years at work (in my two previous jobs), and I must say it worked flawlessly all this time.

But lately it started to “freeze” when compiling some hot stuff under the vm. It also became more and more a resource hog.

So I started to look for some alternatives, and of course virtualbox from sun showed up. I gave it a try and was hooked up: it is fast, and handled very well the various OS and jobs I throwed at it.

So I thought it is ready to replace vmware at work (and it is, with some more work).

I use a windows box (for corporate reasons etc.), and edit/compile code in virtualbox vm running opensolaris (for efficiency reasons :-)). The changes I make are later on compiled on build machine.

I use a X display fo 1680×1050 32 bpp – and yes took me some time to get this setup on vmware.

I wanted to have the same setup on virtualbox and … At first I failed: virtualbox gfx card did not have the VESA mode I wanted and defaulted to 1280×1024, with a lot of unused space left on my monitor :-(

I finally found a solution, and I am posting it here so I will not forget it later on: I used VBoxManage – read the section “custom VESA modes” in the virtualbox user manual.

On your windows box, lauch the command line prompt and go to the folder where virtualbox has been installed, in my case:

C:\Program Files\Sun\VirtualBox

then add the missing VESA mode fro your vm, in my case the vm is called “adam”:

VBoxManage setextradata "adam" "CustomVideoMode1" "1680x1050x32"

Restart your vm and *magic* my login screen is 1680×1050.

Do not forget to edit your xorg.conf file to actually setup this mode. Here is mine in case you need an example (this is a valid file for samsung monitor model 2243bw, for other monitors you MUST edit the HorizSync/VertRefresh values or comment them out) :

Section "Monitor"
Identifier "samsung-2243bw"
HorizSync 30-81
VertRefresh 50-85
Modeline "1680x1050" 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
EndSection
Section "Screen"
Identifier "Screen 1"
Monitor "samsung-2243bw"
DefaultDepth 24
Subsection "Display"
Depth 8
Modes "1680x1050" "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1680x1050" "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1680x1050" "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 1"
EndSection
Section "InputDevice"
Identifier "VBoxMouse"
Driver "vboxmouse"
Option "CorePointer"
EndSection

Enjoy and share.

Advertisements

About this entry