[HowTo] Install a vnc server on the Raspberry pi

root@vero:~# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 4.9.2 (Debian 4.9.2-10)
Thx for your input btw :slight_smile:

1 Like

I got the 4.9 on my pi2ā€¦but at first i was trying with 4.7.
Here is a post that i made when i was having problems compiling @patrikolausson version:

but thats a totally different error message.
Really no idea about how to make this work with vero2ā€¦Maybe there are some things missing or the architecture is differentā€¦I dont know :confused: ā€¦@sam_nazarko should be able to clear things up.

Hi ā€“ didnā€™t see these posts, apologies.

My long term goal is to get VNC in the App Store. You cannot simply copy the Pi instructions, because Vero 2 uses a different windowing system.

In the interim, I will create a [HowTo] for installing VNC on the Vero 2.

Sam

2 Likes

@Sandbird, Iā€™ve PMā€™d you some instructions for you to try. Let me know how you get on. Iā€™ll make it a HowTo if you have some success.

Sam

1 Like

I have been unsuccessful getting VNC working with my Mac. I have a Raspberry Pi 3 with OSMC installed. Iā€™ve installed dispman_vncserver. On my Mac I try to establish a VNC connection by going to the Connect to Serverā€¦ window and entering vnc://10.0.1.15 as the Server Address. (Iā€™ve assigned 10.0.1.15 as the fixed IP address for the RPi.) Apparently there is some communication between the Mac and the VNC server on the RPi but I never see a window for the RPI and eventually the connection request times out.

Has anyone ever gotten VNC to work using the default VNC client on a Mac and dispmanx?

Did you try that MacOS tip at the guide?
If you want to use OSX tool ā€œscreen sharingā€, start the vnc server with the password option:
Example
osmc@osmc:~/dispmanx_vnc$ ./dispmanx_vncserver --password=osmc

Maybe you need to open port 5900 and forward it to your pi first as well

What MacOS tip at the guide are you referring to, Sandbird? Can you provide a link?

I did try using the password option on the command line, and that didnā€™t have any effect.

I have port 5900 open for VNC already. I use Apple Remote Desktop and am able to use VNC to view/control my Macs. In my attempts to use VNC with the Raspberry Pi I have seen an error log file message reporting that the VNC server was using an outdated software version. (Sorry, I donā€™t remember the details.)

Hereā€™s a screen snap showing the port mapping for my Airport Extreme router:

hmm, i havent used my hackintosh for quite some time nowā€¦so i am a bit rusty when it comes to macsā€¦but in this picture here you are why does it say 10.0.1.3 ? I thought your pi3 was on 10.0.1.15 ?

Lets try a few thingsā€¦Back to the basics:

  1. If you set your pi to get an automatic ip address which address does it take? Is it in the range of 10.0.1ā€¦? Did you try to let it have an automatic ip and try connecting to that first ?
  2. Do you have an iphone ? If yes, can you try downloading Vnc viewer and try connecting from there (before trying with more advanced tools like RD from the mac?
  3. Did you create a service for the vncserver ? I mean are you sure itā€™s running ? IF yes, then do this:
    systemctl stop dispmanx_vncserver
    then manually start the server with : dispmanx_vncserver --password=osmc. You should be seeing this:

    Now try to connectā€¦(so we are sure the vncserver is running and listening for connections.

Why would you do port mapping if all your devices are on the LAN?

1 Like

Thanks, guys, for the replies. With your comments I made some progress.

I installed vnc viewer on my iPhone and was pleasantly surprised to see that I was able to establish a vnc to my Raspberry Pi:

osmc@osmc:~/dispmanx_vnc-master$ ./dispman_vncserver
Open display[0]ā€¦
Display is 720 x 480
Server bpp:16
Server bigEndian:0
Server redShift:0
Server blueShift:10
Server greeShift:5
21/07/2016 16:42:48 Listening for VNC connections on TCP port 5900
21/07/2016 16:42:48 Listening for VNC connections on TCP6 port 5900
open /dev/uinput returned 7.
First write returned 1116.
ioctl UI_DEV_CREATE returned 0.
21/07/2016 16:43:15 Got connection from client 10.0.1.9

My home network has a couple Apple AirPort Extreme routers at 10.0.1.1 and 10.0.1.2. I have a Mac mini running Apple Server at 10.0.1.3. I have a number of devices assigned to IP addresses using their MAC addresses, and one of them is my Raspberry Pi at 10.0.1.15.

The screen snap showing Port Forwarding shows values established when I set up the Server software, and youā€™re right it shows the server IP address (10.0.1.3).

I need to educate myself a bit to see what I need to do to set up port forwarding for the Raspberry Pi. Sorry for my ignorance. Once I have done some reading I may be able to solve the problem on my own or at least be able to ask an intelligent question.

You ONLY need to mess with port forwarding when you are attempting to connect to devices from outside your home LAN.

@ActionA: If you use a Mac, then maybe you can explain why I canā€™t use the VNC client embedded in Mac OS. In the Go menu I select Connect to Serverā€¦ and in the Server Address field I enter ā€œvnc://10.0.1.15ā€. In a Terminal window, logged into the Raspberry Pi via ssh, Iā€™ve started the VNC server and I do see that it responds when I hit the Connect button after Iā€™ve entered ā€œvnc://10.0.1.15ā€ and entered the osmc password (ā€˜osmcā€™):

21/07/2016 17:37:42 Got connection from client 10.0.1.7
21/07/2016 17:37:42 other clients:
21/07/2016 17:37:42 Normal socket connection
21/07/2016 17:37:42 Client Protocol Version 3.3, y1=36
21/07/2016 17:37:42 Protocol version sent 3.3, using 3.3
21/07/2016 17:38:17 rfbProcessClientInitMessage: client gone
21/07/2016 17:38:17 Client 10.0.1.7 gone
21/07/2016 17:38:17 Statistics events Transmit/ RawEquiv ( saved)
21/07/2016 17:38:17 TOTALS : 0 | 0/ 0 ( 0.0%)
21/07/2016 17:38:17 Statistics events Received/ RawEquiv ( saved)
21/07/2016 17:38:17 TOTALS : 0 | 0/ 0 ( 0.0%)
21/07/2016 17:38:17 Got connection from client 10.0.1.7
21/07/2016 17:38:17 other clients:
21/07/2016 17:38:17 Normal socket connection
21/07/2016 17:38:17 Client Protocol Version 3.3, y1=36
21/07/2016 17:38:17 Protocol version sent 3.3, using 3.3
464/480 Picture (025 fps) x0=664, y0=22, x1=673, y1=36

However, the cursor spins with ā€œConnectingā€¦ā€ and I never see an osmc screen":

I just noticed that when I successfully used VNC Viewer on my iPhone I get a message from the VNC Server that it connects using Client Protocol Version 3.8 but trying to connect from my Mac Iā€™m informed that Iā€™m trying to use Client Protocol Version 3.3. Maybe the Mac is using an outdated incompatible protocol to establish the VNC connection?

Yeah could beā€¦i am not that familiar with mac os vnc apps, thats why i wanted to try with the iphone since i know that it works 100%. Well at least now we know where is the problem.
You could always try with : https://www.realvnc.com/download/viewer/macosx/
Realvnc works fine on the pc, so i guess it would work well on the mac as wellā€¦Just need to tweak the ā€˜speedā€™ option firstā€¦Cant go up to million of colorsā€¦basic 256 colors connection will work fineā€¦Anything higher and it the connection breaks. ā€¦ Maybe thats what happens with your current mac app ? does it have any speed settings ? If yes try connecting with the lowest setting first.

ps: I got 4 pcs and 2 piā€™s in my houseā€¦thats why i keep specifying the ports because all of them are running similar servicesā€¦but yeahā€¦you dont really need portforwardning inside your lan, if you only have 1 pc/pi running vnc. Nonetheless when something is going wrong its a necessary step to find the culpritā€¦so you know at least that portforwarding is not to blame here.

@Sandbird: vnc viewer worked on the Mac. It uses RFB protocol version 3.8, so maybe MacOSā€™s use of the older version 3.3 is the problem. Anyway, thanks for the help.

1 Like

I didnā€™t make it very far as shown here. Would someone please advise?

osmc@KublerRPi:~$ 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@KublerRPi:~$ rm master.zip
rm: remove write-protected regular file ā€˜master.zipā€™? y

osmc@KublerRPi:~$ cd dispmanx_vncserver-master
-bash: cd: dispmanx_vncserver-master: No such file or directory

osmc@KublerRPi:~$ mkdir dispmanx_vncserver-master

osmc@KublerRPi:~$ cd dispmanx_vncserver-master

osmc@KublerRPi:~/dispmanx_vncserver-master$ make
make: *** No targets specified and no makefile found. Stop.

osmc@KublerRPi:~$ sudo cp dispmanx_vncserver /usr/bin
cp: cannot stat ā€˜dispmanx_vncserverā€™: No such file or directory

Well looking at this I guess
cd /home/osmc/dispmanx_vnc-master/

Would have done the trick

Hi Lucalobe , how you solve realvnc error ?
assertion failed one ā€¦ its work on tightvnc ā€¦ but i need it on realvnc :S

Works also on OSMC with Krypton without any errors