[HowTo] Install a vnc server on the Raspberry pi

hmmm no idea then…maybe an expert can take this ?

How about trying the solutions described here: apt - Package system is broken. How to fix it? - Ask Ubuntu

Maybe something like…:
sudo apt-get clean
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get update

Unfortunately I am still getting the same error:

The following packages have unmet dependencies:
 libvncserver-dev : Depends: libgnutls28-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tried it on a second raspi and it worked without any problem. On the one which is causing problems I have RetroPie running with OSMC. Could that be a problem?

Thanks for your support!

How about trying:
sudo apt-get dist-upgrade

Now, I am not an expert but this is the next step I would have tried after finding the article below. If I depended on that system in any way, I would make sure I had a backup before trying.

Hi All

I went to GitHub - patrikolausson/dispmanx_vnc: VNC Server for Raspberry PI using dispmanx and followed instructions for preparing osmc vnc using:

sudo apt-get install build-essential rbp-userland-dev-osmc libvncserver-dev libconfig+±dev

Everything installed fine but when i try to run program using

sudo ./dispmanx_vncserver

i get the following

sudo: ./dispmanx_vncserver: command not found

It seems it hasnt created any dispmanx folders during the installation.

This is the output

osmc@osmc:~$ sudo apt-get install build-essential rbp-userland-dev-osmc libvncserver-dev libconfig+±dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version.
libconfig+±dev is already the newest version.
libvncserver-dev is already the newest version.
rbp-userland-dev-osmc is already the newest version.
The following packages were automatically installed and are no longer required:
apt-transport-https armv7-libafpclient-osmc libbluray1 libcurl3-gnutls libflac8 rbp2-image-4.3.3-2-osmc
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Did i miss a step?
Any info be appreciated thanks.

EDIT: Solved Thanks Sandbird & ActionA

Read the posts around this one above to get context.

1 Like

Hi, thanks for all this info. I hope this isn’t considered a hijack.

I’m running osmc 2016.01-1 and have built dispmanx vnc according to the instructions on the GitHub - patrikolausson/dispmanx_vnc: VNC Server for Raspberry PI using dispmanx page. It seems to run well.

I’d love to get it running as a service at start up though. I’m looking at this page you recommended:

So, I’m looking at this code example from that page.


#! /bin/sh
# /etc/init.d/vncboot

### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
 start)
  echo "Starting VNC Server"
  #Insert your favoured settings for a VNC session
  su - $USER -c "/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565"
  ;;

 stop)
  echo "Stopping VNC Server"
  /usr/bin/vncserver -kill :1
  ;;

 *)
  echo "Usage: /etc/init.d/vncboot {start|stop}"
  exit 1
  ;;
esac

exit 0

I’m assuming it’s referring to a different vnc server but that the principles are the same.
So my questions about the script are:

  1. “USER=pi” should this user be “osmc” for my purposes? Also the same user for “HOME=”?
  2. In the “start” section should I use the command “sudo PATH-TO-MY-SHELLSCRIPT”?
  3. In the “stop” section can I pass a “-kill :1” argument to a shellscript?

Is there anything else in the “vncboot” script that I would need to change in order to make this work?

Thanks anyone who can spare a little time to help.

Hi, yeah, you are right, that thing was for my old instructions. For the new github guide do this:
First of all lets create a basic config file (passwords, fps etc) and copy the server to the /bin folder for easy execution.
Go inside your dispmanx_vncserver folder that was compiled and do

cp dispmanx_vncserver /usr/bin
chmod +x /usr/bin/dispmanx_vncserver
cp dispmanx_vncserver.conf.sample /etc/dispmanx_vncserver.conf
vi /etc/dispmanx_vncserver.conf

You can use nano if you want…Then copy paste this and change the password inside the quotes:

relative = false;
port = 0;
screen = 0;
unsafe = false;
fullscreen = false;
multi-threaded = false;
password = "mypassword";
frame-rate = 23;
downscale = false;

Then do
vi /etc/systemd/system/dispmanx_vncserver.service

and paste this inside:

[Unit]
Description=VNC Server
After=network-online.target mediacenter.service
Requires=mediacenter.service

[Service]
Restart=on-failure
RestartSec=30
Nice=15
User=root
Group=root
Type=simple
ExecStartPre=/sbin/modprobe evdev
ExecStart=/usr/bin/dispmanx_vncserver
KillMode=process

[Install]
WantedBy=multi-user.target

After that start the service and make it load or reboot

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

That should do it :slight_smile:

Thank you very much. That has worked without a hitch.

Awesome, thanks for the confirmation, i updated the 1st post with the info :slight_smile:

One more question if you don’t mind?
I’m using tightvnc client (don’t know if this is relevant) and my mouse pointers are often misaligned. Sometimes not a problem but sometimes I can’t get at some parts of screen easily.

Any clues?

hmmm, i am using the normal VNC Viewer and dont have that problem. What type of compression are you using ? It works better with 256 colors.Maybe because you’ve set it to truecolor or something like that you get that ‘extra’ lag ? Try with fewer colors. Less colors, better response.

I had some troubles finding all there is needed to install ist, so here a brief all-in one steps you need:

2 Likes

adding --password=osmc also helped me to use the internal screen sharing of OSX to connect to OSMC.

Thnx @Sandbird for the extensive information and help in this topic!

1 Like

Hi the_bo,

You are actually missing:

  1. Downloading the master.zip from the repository
    wget https://github.com/patrikolausson/dispmanx_vnc/archive/master.zip
  2. Unzipping it
  3. “make”-ing it to compile the server.
  4. Other steps.

That also happened to me in my first try. Finally I followed the full thread and got it. Learning to compile, extrat, download basis.

Thanks to everybody for your work! Althougth it took a while, it is more or less working now. Also, it seems that the Server is not autorunning on boots for me yet.

@Sandbird, I think it would be a good idea to clarify the following two things. They would have saved me several hours:

1.Where the > deprecated method tutorial ends.
2.That the GitHub - patrikolausson/dispmanx_vnc: VNC Server for Raspberry PI using dispmanx method needs another steps: wget, unzip, make.

Is it possible that windows remote desktop is not able to connect via VNC? However, RealVNC is working fine.

I had to take out the password, and also connect using also the port: #.#.#.#:5900.
I didn´t expect that to work like this. Indeed, in the config file of the dispmanx_VNC service it is stated that: “port = 0”.

Has anybody realized that if one accesses by VNC the SHH command stops accepting commands? Does anybody knows how to overcome this? (I mean: I’m through SSH with puty, use VNC, then putty works, but commands don´t).

Regards,

Hi @Lucalobe,
I am mentioning when the Old method starts :slight_smile: , where it says:

End of Guide
=========================================================================
Old instructions on how to setup a vnc server....Deprecated method..(dont use it)

About patrik’s github, you dont really need to get into the linux methods of extraction and downloading. You could just download it, extract it on your pc then upload the folder to your pi via Winscp or Filezilla.

Remote desktop is a totally different thing. Its not working with the VNC protocol. Remote desktop is a Microsoft thing. Vnc works in general with many more systems (win, mac, liunx etc)

Now about your remote ssh that is getting ‘bugged’ (works on port 22). I would suggest you go here: http://portforward.com/english/applications/port_forwarding/RealVNC/default.htm and find your router on that page, and follow the steps to forward port 5900 to your pi’s local ip (ex: 192.168.1.5) (NOT the WAN ip)…then change the config file and do port=5900. Probably something is going wrong with your setup on port 0 and you’ll ‘have to be more specific’ when it comes to vnc. I’ve never had this problem so i got no idea why this is happening…You could try doing the 5900 port trick, since that is the default port of VNC. After you’ve done that try joining your server with : localipofpihere:5900 as the address.

Hello @Sandbird ,
it is true that you indicate where the old tutorial starts. However, as I am new with linux and the RPI stuff, I didn´t know how to proceed with [quote=“Sandbird, post:1, topic:1517”]

[/quote].

It wasn´t untill I read the following part of the old tutorial that I realized some steps I was missing, so I wasn´t able to say if this part was part of the old one or the new one.

I do like your posts and don´t want to seem too critical, but to be a HowTo I thought I would be nice to clarify a few things that may help people save time.

Actually, I didn´t know that is possible. I´m writting everything with a Putty console, so I had to compile. And I am getting every package directly in the PI.

It may be that with Raspbian I could access with Windows Remote Desktop. As now I´m running a different OS, I would be normal that doesn´t work anymore.

It’s a pity, my router doesn’t show in the list. The net I’m currently using has a special configuration for cable-TV which I wouldn’t like to mess with. I would rather wait until I try again in a different net. However, I´ll try setting the port 5900 in the config file and keep you updated.

Thanks!

Hey, @Lucalobe,
Its true this HowTo isnt for beginners. The osmc team had announced that they will add the vnc server in the MyOSMC store around the time this thread was made. Osmc was still in Alpha version and a lot of people were trying to make vnc work…Its just that everyone was expected that when the stable release of osmc would come out, vnc would be an easy click away and this thread would be useless…but that never happened.lol
I promise you this though, i am not that type of person that would blame you with ‘Read the whole thread, its mentioned somewhere…’, if you asked for help on how to install this. Every person was a ‘noob’ once…(i still consider myself one)

I know what type of router you have, and i am 99% sure you are already using port forwarding on your cable-tv, you just dont know it…most tv sets i’ve seen like this had some forwards for the tv-modem. If you look through the menus and you still have some port slots left to use…you can add 5900 in one of them and point it to your Pi’s ip. Any router from the portforward.com site will do…you just want to get the basic info on how it’s done.

Hi there!

I found a way to set the 5900 port to PI’s IP, using the “on-line configurator” of my internet-TV service provider. Indeed, it was quite easy. Reading [quote=“Sandbird, post:118, topic:1517”]
http://portforward.com/english/applications/port_forwarding/RealVNC/default.htm
[/quote] also helpet a lot.

I also had “frame-rate = 24;” and changed it to 23. Finally, I set RealVNC to sign without encryption. And now it seems to be working stable, slow thought. Let’s see if it keeps working. I attach a picture of the error RealVNC was giving to me in case it helps to somebody.

In the other hand, even thought the Putty session gets bugged after manually running dispmanx_vncserver (because it wasn´t running on autoboot), it seems that, after assigning the port 5900 in the router, another different Putty session can be connected to keep controlling the device.

I figured it out: It seems that I made a mistake writting [quote=“Sandbird, post:1, topic:1517”]
Now we’ll create the service file to be able to ‘autoload’ the server on boot:

vi /etc/systemd/system/dispmanx_vncserver.service
[/quote]
I wrote > ExecStart=/user/bin/dispmanx_vncserver. I’ve fixed it, and tried. Now everything runs smoothly, and I can still use a SSH connection.

Lot of thanks.