First, as root, make a copy of your WebVNC webpage configuration in your user folder for EACH desired resolution, with the following commands:
{{Code|cd /var/hda/web-apps/webvnc/html cp index.html /home/%USER%/.amahi.webvnc.800x600.index.html cp index.html /home/%USER%/.amahi.webvnc.1024x768.index.html cp index.html /home/%USER%/.amahi.webvnc.1280x1024.index.html}}
You will need to edit each of these files to change the size of the VNC window inside the web page. The width of the window should match the width of your desktop, however the height of the window should have 22px added to the height of the desktop in order to account for the WebVNC menu. For example, for the resolution 800x600, the html file will look like this:
Next, remove the original index.html file and create a symlink to the appropriate new file:
{{Code|rm index.html ln -s /home/%USER%/.amahi.webvnc.800x600.index.html index.html}}
Now you need a script in order to change the resolution of the desktop AND update the symlink to the correct configuration. Create a file in /home/%USER%/Scripts/ for each desired resolution, for example, amahi.webvnc.reschange.800x600.sh containing the following, making sure to enter your sudo password and the desired resolution: