Changing the resolution of a VNC session in linux
Real VNC server 4.4 includes support for Xrandr, which allows resizing the VNC. Start the server with:
vncserver -geometry 1600x1200 -randr 1600x1200,1440x900,1024x768
Then resize with:
xrandr -s 1600x1200
xrandr -s 1440x900
xrandr -s 1024x768
Found out that the vnc4server (4.1.1) shipped with Ubuntu (10.04) is patched to also support changing the resolution on the fly via xrandr. Unfortunately the feature was hard to find because it is undocumented. So here it is...
Start the server with multiple 'geometry' instances, like:
vnc4server -geometry 1280x1024 -geometry 800x600
From a terminal in a vncviewer (with: 'allow dymanic desktop resizing' enabled) use xrandr to view the available modes:
xrandr
to change the resulution, for example use:
xrandr -s 800x600
Thats it.
I'm running TigerVNC on my Linux server, which has basic randr support. I just start vncserver without any -randr or multiple -geometry options.
When I run xrandr in a terminal, it displays all the available screen resolutions:
bash> xrandr
SZ: Pixels Physical Refresh
0 1920 x 1200 ( 271mm x 203mm ) 60
1 1920 x 1080 ( 271mm x 203mm ) 60
2 1600 x 1200 ( 271mm x 203mm ) 60
3 1680 x 1050 ( 271mm x 203mm ) 60
4 1400 x 1050 ( 271mm x 203mm ) 60
5 1360 x 768 ( 271mm x 203mm ) 60
6 1280 x 1024 ( 271mm x 203mm ) 60
7 1280 x 960 ( 271mm x 203mm ) 60
8 1280 x 800 ( 271mm x 203mm ) 60
9 1280 x 720 ( 271mm x 203mm ) 60
*10 1024 x 768 ( 271mm x 203mm ) *60
11 800 x 600 ( 271mm x 203mm ) 60
12 640 x 480 ( 271mm x 203mm ) 60
Current rotation - normal
Current reflection - none
Rotations possible - normal
Reflections possible - none
I can then easily switch to another resolution (f.e. switch to 1360x768):
bash> xrandr -s 5
I'm using TightVnc viewer as the client and it automatically adapts to the new resolution.