I recently moved my Long standing Linux box running Ubuntu 8.04 as a headless server which needs X running because of Mythtv. Once it was in place I remoted into the box running Remote Desktop on Linux and VNC client on the PC. When I got it the screen was squished to 800×600 resolution.
Ubuntu tried to be too helpful in this scenario. It limited the resolution to 800×600 max with a smaller resolution. There was no option to increase it. I did not want to plug in a monitor so it could detect the correct screen resolution every time it started up. I knew this would lie in the Xorg configuration.
After some Google searches I found the solution which requires adding some entries into xorg.conf.
First create a backup:
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
To restore the config use the following command:
$ cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
Edit the file /etc/X11/xorg.conf
and find the section Section "Screen"
. My default config looked like this:
Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Configured Video Device”
Defaultdepth 24
EndSection
Add a sub section to the end with the resolution you want e.g:
Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Configured Video Device”
Defaultdepth 24
SubSection “Display”
Modes “1024×768” “1024×1280”
Virtual 1024 768
Virtual 12804 1024
EndSubSection
EndSection
I’m not sure how it handles which resolution is default on start up but once it’s in you can remove change it via Gnome or only add one screen resolution to force it to boot into that resolution.
Edit: It takes the last virtual resolution defined in the sub section and does not allow users to pick and choose if more than one are defined.
screen resolution in remote desktop Ubuntu Forum Post