[HowTo] Install a vnc server on the Raspberry pi

As dispman basically takes the video buffer as a source it will work with anything that the Pi displays regardless of Krypton or any other Kodi version

Hello all.
Thank you for a great thread. Install VNC on my pi3 with no problems.
A quick question though:
What would anybody recommend for VNC viewer? Rather an Open Source one.

Thank you in advance.

Regards

I think TightVNC is nice, because it stores your password as well,so you dont have to type it all the time like the regular vncviewer. Download TightVNC

But i use the normal vnc viewer.I dont connect to my pi that much and the interaction is minimal to want something better.
Plus the vnc server doesnt support full colors and its a bit picky with compression algorithms as well.

Thank you @Sandbird for your reply.
I donā€™t need it to be fancy either. What VNC viewer do you use?
Thank you.

This one here:

I think it should work as a standaloneā€¦If i am not mistaken i just copy it around every time i format my HD.

Thank you. Appreciated.

External links are bad, because they can change.

Please upload on our forum instead and remove the link.

No need to use a third tier app on mac. Iā€™m still running under mavericks (10.9) and it works perfectly well with Screen Sharing app which come bundles with OS X.

Are you trying to remote control the pi from outside your network or from inside ?

If itā€™s from inside your network, the ip address you typed seems not good (class A IP address), in most cases it will be something like 192.168ā€¦
By the way, why not setting a static internal ip for your pi and configuring the DNS so the static ip always point to a hostname, something like osmc, so when you try to connect from inside your network, you only have to type vnc://osmc ?

If you are trying to control it from the outside, youā€™ll need to configure port forwarding on your router and youā€™ll need anyway to set a internal static IP for the Pi, it is mandatory.
Further more If your ISP use Dynamic IP addressing (meaning your external IP change everytime the router restart) you will need to configure Dynamic DNS on your router, and configure a client on your router or pi to update the IP address with the DynDNS service.

Perm link:
VNC-Viewer-5.3.0-Windows-64bit.zip (2.1 MB)

@Cornelius: Itā€™s was a while ago since I was struggling with getting VNC to work. As I recall, I got it working just fine using the Screen Sharing on the Mac side. On the Raspberry Pi side I found [HowTo] Install a vnc server on the Raspberry pi and wrote a bash script based on this tutorial and which painlessly installs the VNC server on osmc.

For some unknown reason dispmanx_vnc server has completely stopped working for me.

I get this main error:

$ dispmanx_vncserver
trying: /etc/dispmanx_vncserver.conf
Read config file: /etc/dispmanx_vncserver.conf
Running vnc server with the following settings
  frame-rate = 15
  downscale = false
  fullscreen = false
  multi-threaded = false
  password = ***
  port = 0
  relative = false
  screen = 0
  unsafe = false
Open display[0]...
info: 1920, 1080, 0, 0
Display is 1920 x 1080
Server bpp:16
Server bigEndian:0
Server redShift:0
Server blueShift:10
Server greeShift:5
05/11/2016 09:43:50 Listening for VNC connections on TCP port 5900
05/11/2016 09:43:50 rfbListenOnTCP6Port: error in bind IPv6 socket: Address family not supported by protocol
open /dev/uinput returned -1.
First write returned -1.
ioctl UI_DEV_CREATE returned -1.
Exception: Error create uinput device %d.

Has anyone come across this before. Iā€™ve tried removing it the config files and /usr/bin files and then rebuilding the package. But the same error persists.

Try this before you start dispmanx

Still no success. I thought those commands only needed to be executed if youā€™re not using the github install method?

$ sudo modprobe uinput
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.16-6-osmc/modules.dep.bin'
$ sudo chmod 666 /dev/uinput
chmod: cannot access ā€˜/dev/uinputā€™: No such file or directory

Iā€™ve solved it.

Iā€™d done a apt-get dist-upgrade and it has instructed me I had an un-used kernel module installed. So Iā€™ve executed apt-get clean && apt-get autoremove and in doing so it had removed some module files which dispmanx had depended upon.

[SOLUTION]

Searched apt for the missing kernel modules, reinstalled them and then re-ran the modprobe and chmod commands.

For anyone who has the same issue, youā€™ll need to replace the version number / pacakge depending on your device and version number.

apt-cache search '4.4.16-6-osmc'
apt-get install rbp2-image-4.4.16-6-osmc
modprobe uinput
chmod 666 /dev/uinput
1 Like

Yeah sorry mate. Forget about it.

Nope, This doesnā€™t work for my out-of-the-box OSMC on NOOBs. Several issues:

  1. In step 1 all goes well until I get (see bold print)
    ā€¦
    osmc@osmc:~$ unzip master.zip -d /home/osmc/
    Archive: master.zip
    78e66736ce0f94358143b0a30595643912126869
    creating: /home/osmc/dispmanx_vnc-master/
    inflating: /home/osmc/dispmanx_vnc-master/BCMHost.hh
    inflating: /home/osmc/dispmanx_vnc-master/DMXDisplay.cpp
    inflating: /home/osmc/dispmanx_vnc-master/DMXDisplay.hh
    inflating: /home/osmc/dispmanx_vnc-master/DMXResource.cpp
    inflating: /home/osmc/dispmanx_vnc-master/DMXResource.hh
    inflating: /home/osmc/dispmanx_vnc-master/DMXVNCServer.cpp
    inflating: /home/osmc/dispmanx_vnc-master/DMXVNCServer.hh
    inflating: /home/osmc/dispmanx_vnc-master/Exception.hh
    inflating: /home/osmc/dispmanx_vnc-master/Makefile
    inflating: /home/osmc/dispmanx_vnc-master/README.md
    inflating: /home/osmc/dispmanx_vnc-master/UFile.cpp
    inflating: /home/osmc/dispmanx_vnc-master/UFile.hh
    inflating: /home/osmc/dispmanx_vnc-master/dispmanx_vncserver.conf.sample
    inflating: /home/osmc/dispmanx_vnc-master/main.cpp
    osmc@osmc:~$ rm master.zip
    rm: remove write-protected regular file ā€˜master.zipā€™? y
    osmc@osmc:~$ rm master.zip
    rm: cannot remove ā€˜master.zipā€™: No such file or directory
    osmc@osmc:~$ cd dispmanx_vncserver-master
    -bash: cd: dispmanx_vncserver-master: No such file or directory

  2. Then, after I realise Iā€™m already in right directory, the file editing goes well (I use Nano) but then I get:

osmc@osmc:~$ systemctl start dispmanx_vncserver.service
Failed to start dispmanx_vncserver.service: Access denied
osmc@osmc:~$ systemctl enable dispmanx_vncserver.service
Failed to execute operation: Access denied
osmc@osmc:~$ systemctl daemon-reload
Failed to execute operation: Access denied
osmc@osmc:~$

What have I done wrong?

Well to run systemctl you would need to put sudo in front
But did you already compiled dispmanx?
Also first would try to start it at the command line (instead of systemctl) to ensure the binary working fine

This how-to is great and worked almost out-of-the-box for me, except for two things:

needs to have sudo, like so:

sudo systemctl start dispmanx_vncserver.service
sudo systemctl enable dispmanx_vncserver.service
sudo systemctl daemon-reload
1 Like

You are right, sorry, fixed the 1st post.
I used root account to do thisā€¦i always forget the sudo part for regular users :slight_smile:

1 Like

Thanks for this guide - it worked perfectly for me on my Pi3. There is one slight mistake in the instructions though:

should be:

1 Like