Question: 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.

Answer: 
Interestingly no one answered this. In TigerVNC, when you are logged into the session. Go to `System > Preference > Display` from the top menu bar ( I was using Cent OS as my remote Server). Click on the resolution drop down, there are various settings available including 1080p. Select the one that you like. It will change on the fly.

![enter image description here](https://i.stack.imgur.com/UUAgd.png)

**Make sure you Apply the new setting when a dialog is prompted. Otherwise it will revert back to the previous setting just like in Windows**
Solution by @omiday worked for me in Xvnc TigerVNC 1.1.0, so I condensed it into a single bash function **vncsize x y**. Use it like this: **vncsize 1400 1000**. It works for any VNC output name, "default" or "VNC-0".

```
function vncsize {
    local x=$1 y=$2
    local mode
    if mode=$(cvt "$x" "$y" 2>/dev/null)
    then
        if [[ $mode =~ "Modeline (.*)$" ]]
        then
            local newMode=${BASH_REMATCH[1]//\"/}
            local modeName=${newMode%% *}
            local newSize=( ${modeName//[\"x_]/ } )
            local screen=$(xrandr -q|grep connected|cut -d' ' -f1)
            xrandr --newmode $newMode
            xrandr --addmode "$screen" "$modeName"
            xrandr --size "${newSize[0]}x${newSize[1]}" &&
                return 0
        else
            echo "Unable to parse modeline for ($x $y) from $mode"
            return 2
        fi
    else
        echo "\`$x $y' is not a valid X Y pair"
        return 1
    fi
}

```