I use VNC to connect to a Linux workstation at work. At work I have a 20" monitor that runs at 1600x1200, while at home I use my laptop with its resolution of 1440x900. If I set the vncserver to run at 1440x900 I miss out on a lot of space on my monitor, whereas if I set it to run at 1600x1200 it doesn't fit on the laptop's screen, and I have to scroll it all the time.

Is there any good way to resize a VNC session on the fly?

My VNC server is RealVNC E4.x (I don't remember the exact version) running on SuSE64.

+2  A: 

As far as I know there's no way to change the client's resolution just using VNC, as it is just a "monitor mirroring" application.

TightVNC however (which is a VNC client and server application) can resize the screen on the client side, i.e. making everything a little smaller (similar to image resizing techniques in graphics programs). That should work if you don't use too small font sizes. VNC should theoretically be compatible between different VNC applications.


I think that depends on your window manager.

I'm a windows user, so this might be a wrong guess, but: Isn't there something called X-Server running on linux machines - at least on ones that might be interesting targets for VNC - that you can connect to with "X-Clients"?

VNC just takes everything that's on the screen and "tunnels it through your network". If I'm not totally wrong then the "X" protocol should give you the chance to use your client's desktop resolution.

Give X-Server on Wikipedia a try, that might give you a rough overview.

+1  A: 

I think your best best is to run the VNC server with a different geometry on a different port. I would try based on the man page

$vncserver :0 -geometry 1600x1200
$vncserver :1 -geometry 1440x900

Then you can connect from work to one port and from home to another.

Edit: Then use xmove to move windows between the two x-servers.

@Pat, the problem with your solution is that I can't easily move a window from one VNC session to another. If I'm in the middle of some debug when I have to leave, I want to be able to pick up where I left off (maybe with the windows moved around a little bit due to resizing).If I have two separate sessions, I won't be able to continue the same as before, because I'll have to close windows from one session and re-open them in another one.On the other hand, if there's a way to move an existing window from one X-server to another, that might solve the problem.
Nathan Fellman
xmove isn't in the current Ubuntu repository; xpra is, which will do the same thing (act as an X proxy).

I'm not sure about linux, but under windows, tightvnc will detect and adapt to resolution changes on the server.

So you should be able to VNC into the workstation, do the equivalent of right-click on desktop, properties, set resolution to whatever, and have your client vnc window resize itself accordingly.


On the other hand, if there's a way to move an existing window from one X-server to another, that might solve the problem.

I think you can use xmove to move windows between two separate x-servers. So if it works, this should at least give you a way to do what you want albeit not as easily as changing the resolution.

do you know if xmove goes by any other name in SuSE Linux?
Nathan Fellman
+3  A: 

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
Nathan Fellman

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:


to change the resulution, for example use:

xrandr -s 800x600

Thats it.