The estimated reading time for this post is 70 seconds

Time for another Linux related guide, this trick is probably useful to those running “headless” linux boxes, or without a screen, so the only way to access them is using remote control tools like ssh or vnc.

One problem that I have encountered while setting up one of these computers to use as a server is that the VNC sessions were forced into the mere resolution of 1024×768, with no way to change it. I tried a few tricks on the Internet, but none of them seemed to do anything.

At last I figured that I have to manually edit the xorg.conf file in order to force the system into outputting in a specific resolution. For your information, I am doing this under Ubuntu 11.10, although I believe the trick will work on any Linux system running X.

First, fire up your preferred terminal program, then type:

sudo gedit /etc/X11/xorg.conf

Of course, you can replace gedit with another text editor like nano.

Now add the following lines into the (usually) blank file:

Section “Device”
Identifier “Default Device”
Option “NoLogo” “True”

Section “Monitor”
Identifier “Configured Monitor”

Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Default Device”
SubSection “Display”
Depth 24
Virtual 1366 768


Virtual 1366 768

With the resolution you want.

Now restart the computer and voilà, VNC connections should now be displayed in the resolution you’ve set it to.

You might also like: