With the release of a new Raspbian version (2016-09-23) RealVNC have ported their VNC server and viewer applications to Pi, and they are now integrated with the system and PIXEL desktop. With raspi-config, one can enable start of RealVNC at boot time. This is particularly useful, if you’re running your Pi headless a (without monitor), but still want to access the LXDE desktop. RealVNC usually works out of the box, but …
… it doesn’t, when you connect a non-standard display. I recently upgraded one of my Raspberry Pi’s with a 3.5” LCD touch screen, which connects through the GPIO header and has a resolution of 320×480 pixels. Unfortunately, with the display attached, VNCviewer’s desktop size also shrinks to 340×480 pixels which is very inconvenient to read when it is displayed on a 1920×1080 HDMI monitor. Scaling of the window makes its contents very blurry.
However, with some special settings, one can circumvent this problem:
A HDMI monitor directly attached to your Pi is configured in /etc/config.txt. If you want 1920×1080 resolution, the settings are:
hdmi_force_hotplug=1 hdmi_ignore_edid=0xa5000080 hdmi_group=2 hdmi_mode=82
These settings will be used by XServer during startup – with and without a HDMI monitor connected. With a touch screen, the 3.5” display driver will override these settings, so that 320×480 resolution is being used instead, both by X11 and RealVNC.
However, by switching RealVNC into virtual mode, it is possible to start a virtual desktop at a higher resolution:
vncserver-virtual VNC(R) Server 5.3.2 (RasPi) (r22607) ARMv6 (Oct 4 2016 11:26:16) Copyright (C) 2002-2016 RealVNC Ltd. RealVNC and VNC are trademarks of RealVNC Ltd and are protected by trademark registrations and/or pending trademark applications in the European Union, United States of America and other jurisdictions. Protected by UK patent 2481870; US patent 8760366. See http://www.realvnc.com for information on VNC. For third party acknowledgements see: http://www.realvnc.com/products/vnc/documentation/5.3/acknowledgements.txt Generating private key... done If a desktop environment fails to load for this virtual desktop, please see: http://www.realvnc.com/doclink/kb-345?version=188.8.131.5207 Running applications in /home/pi/.vnc/xstartup VNC Server catchphrase: "Voice cartel cycle. Tic-tac grand cake." signature: 5a-53-77-ab-2c-18-d8-0e Log file is /home/pi/.vnc/raspi5:1.log New desktop is raspberry:1</code><code id="57fa57d53cc24">(192.168.188.36:1)
Desktop resolution can be configured in /home/pi/.vnc/config, such as:
The virtual desktop can be reached with hostname:1, where ‘1’ is the number of virtual desktop.
In case that LXDE doesn’t start correctly after login, you must create a /etc/vnc/custom.startup file:
#!/bin/sh DESKTOP_SESSION=LXDE export DESKTOP_SESSION startlxde vncserver-virtual -kill $DISPLAY
If you purchase a RealVNC licence, it is possible to permanently enable the virtual server,
which can be reached at hostname:99.
systemctl enable vncserver-virtuald.service