Setting the screen resolution for a headless VNC connection on a Raspberry pi:
INSTALL X11 VNC AND SET PASSWORD:
sudo apt-get install x11vnc
x11vnc -storepasswd
SET PARAMETERS:
nano ~/.xsessionrc
# Start X11VNC
x11vnc -bg -nevershared -forever -tightfilexfer -usepw -display :0
output (CTRL-O) and exit (CTRL-X)
chmod 775 ~/.xsessionrc
SET SCREEN CONFIGURATION:
sudo nano /boot/config.txt
hdmi_force_hotplug=1
hdmi_group=2
***MODES***
hdmi_mode=9 800x600 60 Hz
hdmi_mode=16 1024x768 60 Hz (SVGA)
hdmi_mode=69 1920x1200 60 Hz (Nexus 7)
hdmi_mode=82 1920x1080 60 Hz (1080p)
hdmi_mode=85 1280x720 60 Hz (720p)
****EXAMPLE****
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=16
REBOOT:
sudo reboot
TA-DA!