[HowTo] Install a vnc server on the Raspberry pi


Thanks for the fast reply. I did the first part but then I get this error (there seems to be a file missing?)

osmc@osmc:~$ sudo rm /etc/systemd/system/multi-user.target.wants/dispmanx_vncserver.service
rm: cannot remove '/etc/systemd/system/multi-user.target.wants/dispmanx_vncserver.service': No such file or directory
osmc@osmc:~$ ls /etc/systemd/system/multi-user.target.wants/
avahi-daemon.service  http-time.service    openvpn.service      rpcbind.service
bt-firmware.path      irqbalance.service   performance.service  sonarr.service
connman.service       mediacenter.service  radarr.service       ssh.service
eventlircd.service    nfs-client.target    remote-fs.target     udisks-glue.service


Thats good then :slight_smile: no leftover files, we got them all, continue with the service setup again :slight_smile:


I tried again - making sure that I pasted all of the text into nano: https://i.imgur.com/ibzevbD.png

I get a different error this time: https://i.imgur.com/4SPwVtx.png

Should I maybe change the user in the service file from root to osmc?


no we want the root to start the service, not your user account…hmmm
This is weird…are you sure when you did the make command there were no errors?
I mean what happens when you execute the vnc server manually ? Does it run ? can you connect to the pi remotely ?

Try to connect after doing this:

sudo systemctl stop dispmanx_vncserver.service
sudo /usr/bin/dispmanx_vncserver

(Ctrl+C after to stop it)


I think the server wasnt copied in the /usr/bin folder…thats why there was a 203 error

Try this: sudo whereis dispmanx_vncserver
and give me the output.
You should see something like that.
dispmanx_vncserver: /usr/bin/dispmanx_vncserver /etc/dispmanx_vncserver.conf


I tried running it manually but the file is missing.

osmc@osmc:~$ sudo whereis dispmanx_vncserver
dispmanx_vncserver: /etc/dispmanx_vncserver.conf

I started again from scratch (well not from scratch - from the beginning of the tutorial), but when I get to “make”, I get this message:
osmc@osmc:~/dispmanx_vnc-master$ make
make: Nothing to be done for ‘all’.

I looked back in the terminal and found these lines from the first time I ran the make command: https://i.imgur.com/9JbUlqo.png


This could go easier if you look at the file with winscp or filezilla or something make sure the executable is there, but do this…this should work:

cd /home/osmc/dispmanx_vnc-master
sudo cp dispmanx_vncserver /usr/bin
sudo chmod +x /usr/bin/dispmanx_vncserver

then when you do sudo whereis dispmanx_vncserver again you SHOULD see that there is something in the /usr/bin folder as well. If it is you are done…just start the service with

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


Worst case scenario, do : sudo passwd root and set up a password for the root account.
Then download Winscp and log in to your osmc with the local ip address, root (for username) and your new password, then go to /home/osmc/dispmanx_vnc-master and find the dispmanx_vncserver file and copy it to your desktop. (drag and drop to the left panel)
Then go to folder /usr/bin/ and drag the file from your desktop to that folder (from left side to right side).
Then do : sudo chmod +x /usr/bin/dispmanx_vncserver
and finally start the service…This should work 100% :slight_smile:


I copied the file and I can see it is in the /usr/bin folder. When starting the service I get this error: https://i.imgur.com/0jRQ7kg.png

If I run the vnc server manually it works now and I can connect through VNC.

Just need to sort out the “autorun” now …


hmmm now thats something different…
try this before running the service:

sudo modprobe evdev

If no errors appear after when you start the service, then maybe you can skip pulling your hair out by just doing:
sudo nano /etc/modules
and add
alone on a separate line there under the ones with the # sign infront of them.

This guide works 100% on a pi2, maybe the pi3 has something different about it ? I dont know…but so far you are 2nd with this kind of problem, and 1st time it was a case of wrong copy/paste :slight_smile:


sudo modprobe evdev returns no errors. /etc/modules was missing evdev so I added it.

Tried restarting the service but I get this error again: https://i.imgur.com/IsLFp5n.png

Again - manually starting the VNC server works fine.

Well this should meet my needs for now. I won’t be needing VNC all the time when I connect the Pi with my TV (I hope), but if I do, I’ll just run it manually from the terminal.

I just wanted to thank you! This has been really great user support and I really appreciate it. If you wish to pursue this issue further, just let me know and I’ll do what I can from my side :slight_smile:


Sorry i couldnt help any further with this :confused: maybe someone with more knowledge on this will reply. (it usually happens very fast :slight_smile: great support team here).
You are welcome :slight_smile:


Hi tRoller,

First off I must point out I don’t use vnc server, but being as this seems to be a systemd issue now (as it runs manually); I thought I’d see if I could help.

Could you please issue the following command:

journalctl -xe | paste-log

Provide the url given.

Also could you please post the output of the following:

cat /etc/systemd/system/dispmanx_vncserver.service

Thanks Tom.


I was just writing to let you all know I have solved it by redoing the service file again. I’m not sure what but there seems to have been an issue there.

It now runs the VNC server on reboot so all is well.

Thanks again for the great support here!


See ? if you used vi instead of nano this wouldn’t happen. ahahahahaha. jk


glad to hear it sorted


May make a script that ask some questions and make the rest it self? Is dialog or whiptail part of osmc?


Dialog is, no idea what whiptail is




nahh, they use dialog, blue windows :slight_smile:
If you can make a script i’d be happy to add it up in the thread since some people have problems doing it manually.
I also thought about making a shell script, but the whole thing takes 20 seconds to do. kinda pointless