[HowTo] Install a vnc server on the Raspberry pi



I had initially tried just setting up VNC how I did it with the AppleTV/CrystalBuntu but apparently OSMC on Pi uses the xorg/display stuff differently and I didn’t want to fiddle with that stuff. At least that’s what I gathered from about 10 minutes of research before just moving on.

This worked perfectly, thought! Thanks!


Merci beaucoup Sanbird!
It works great, and it took me less than 10 minutes!



If you want to make the vnc server a bit faster, then edit main.c inside the dispmanx_vnc-master folder and search for:
#define PICTURE_TIMEOUT (1.0/15.0)
change it to:
#define PICTURE_TIMEOUT (1.0/25.0)

There’s no such file.
And there’s not this instruction in “main.o” or “main.cpp”.


I guess you are mixing the two different versions of VNC that were addressed in here


Don’t get you.


Current/New solution https://github.com/patrikolausson/dispmanx_vnc

Previous solution https://github.com/hanzelpeter/dispmanx_vnc

The solution you linked to was related to the solution from Hanzelpeter


Got it now.
Where can this change in the current “new” solution?


Ask patrikolausson I guess…


Where are you?


This can be controlled by the frame-rate setting either in the config file or command line switch. No need to change the code and rebuild to adjust this anymore. Check README.md and/or the dispmanx_vncserver.conf.sample - file.


Thanks Patrik.
I got my answer.


Many thanks @Sandbird for this HowTo.
Works pretty well, even with RealVNC viewer on Android phone using 4g network.
My only issue is some screen freeze related to fps in config file, it was first at 16 when installed and I changed it to 23 to match your file but I think I’ll revert to 16.

Thanks again :slight_smile:


yeah the FPS are a bit iffy…I wouldnt go above 24…I guess it depends on your wifi and what the pi is doing at that time…Play around with the value a bit.


It’s a Rpi 3 which has both network interfaces connected to a Netgear 300Mbps wifi range extender (WN3000RP). Its ethernet interface has a static ip and is wired to the range extender. The wifi interface is using DHCP and is also connected to the same wifi extender which is about 5 meters from my router (ZTE zhxn v2.5).
I’ve changed the frame-rate to 16 and restarted dispmanx_vncserver service but it’s still freezing a bit.
Also I’m using Amber, I’ll give a try to OSMC skin.
By the way, don’t need to start dispmanx_vncserver with parameter --password in order to use OS X Screen Sharing app.

Thanks again. :slight_smile:


So grateful that after a year, these instructions still work.


Any chance this would work on Vero2?


No idea…i dont even know what kind of OS it has.
Maybe you should wait for a mod to write an answer.
But if you are any bit like me (cant wait)…i would backup the SD card, then give it a try…if it doesnt work…just restore :slight_smile:


One more reason I’d stick with RPi … install on Vero2 did obviously failed because dependency rbp-userland-dev-osmc couldn’t install and without it, make also fails.



Searching the forum told me I could use dependency armv7-libplatform-dev-osmc and vero2-userland-dev-osmc … but still this error:

g++ -Wall -std=c++11 -O3 -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -c main.cpp -o main.o
In file included from main.cpp:22:0:
DMXResource.hh:4:22: fatal error: bcm_host.h: No such file or directory
 #include "bcm_host.h"
compilation terminated.
Makefile:26: recipe for target 'main.o' failed
make: *** [main.o] Error 1

Seems bit logic als bcm is some kinda chipset in RPi …

VNC server not installing / compiling / dispmanx_vncserver

Which gcc library did you get ?
I was running into errors like this when i was trying to install vnc with the ‘old method’ that i mentioned.
Especially with the gcc-4.7.
Check my 1st post again where it says : Old instructions on how to setup a vnc server…Deprecated method…(dont use it)
and try to do that instead. If i am not mistaken any gcc above 4.7 was causing me problems. Just try my default values.

sudo apt-get install gcc libvncserver-dev vero2-userland-dev-osmc