Barry4679
Posts: 4
Joined: Wed Oct 05, 2016 8:48 am

Re: Pixel and RealVNC

Thu Oct 06, 2016 7:00 am

sconemad wrote:
Barry4679 wrote: Sorry, I meant the Raspberry Pi Configuration app (from the preferences menu on the desktop). If you can't get to the desktop, you can use the command line raspi-config (which you need to run with sudo). Go to Advanced Options > VNC to enable the VNC Service mode server.

If you are using this, you don't need to run vncserver - this will start another VNC Server (and a virtual desktop), which you don't need.
Thanks, that worked for me.

Just to finally clear up one last thing.

I have no display attached to the RPi, but I don't want a virtual desktop? Why is that? It sounds like what I would want. What's it for?

Is a virtual desktop an *additional* desktop, ie. there is the overhead to run normal desktop (even though there is nothing plugged in), plus the overhead to run an additional virtual session?

Am liking RealVNC btw. I like the fact that cross platform cut & paste is enabled by default, and I like the way it goes into a retry loop when I reboot the RPi.

User avatar
altosack
Posts: 21
Joined: Wed Feb 24, 2016 12:48 am
Location: Blue Springs, MO, USA

Re: Pixel and RealVNC

Thu Oct 06, 2016 7:34 am

Barry4679 wrote:I have no display attached to the RPi, but I don't want a virtual desktop? Why is that? It sounds like what I would want. What's it for?

Is a virtual desktop an *additional* desktop, ie. there is the overhead to run normal desktop (even though there is nothing plugged in), plus the overhead to run an additional virtual session?
A virtual desktop is an additional desktop, but if you don't set the pi to boot to a desktop, the virtual desktop will be the only desktop. There shouldn't be a big resource difference between these two, except that driving the HDMI output may use slightly more power.

To me, it's easier to adjust the resolution (if you ever want to) with the virtual desktop, since there's no reboot required, and you could even have multiple connections with their own separate logins and/or resolutions.

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Thu Oct 06, 2016 9:46 am

Barry4679 wrote: I have no display attached to the RPi, but I don't want a virtual desktop? Why is that? It sounds like what I would want. What's it for?

Is a virtual desktop an *additional* desktop, ie. there is the overhead to run normal desktop (even though there is nothing plugged in), plus the overhead to run an additional virtual session?
You can use either, and they both have their advantages and disadvantages depending on what you're doing. I would pick one or the other, but not both.

As altosack mentioned, it's easier to set the resolution for a virtual mode desktop via the geometry parameter. With service mode, the resolution is fixed to that of the monitor (or values set in /boot/config.txt).

However, some programs will not run in a virtual desktop - typically ones that required direct access to the graphics hardware, such as Minecraft and Kodi. You'll only see these if you access them via a VNC Service mode server. The service mode server also had the advantage of being able to use hardware acceleration for some encodings, which should result in lower CPU usage.
Barry4679 wrote: Am liking RealVNC btw. I like the fact that cross platform cut & paste is enabled by default, and I like the way it goes into a retry loop when I reboot the RPi.
Thanks!

Barry4679
Posts: 4
Joined: Wed Oct 05, 2016 8:48 am

Re: Pixel and RealVNC

Thu Oct 06, 2016 11:21 am

thanks altosack & sconemad. It all makes sense now. :D

DisasterArea
Posts: 13
Joined: Wed Dec 19, 2012 8:20 am

Re: Pixel and RealVNC

Wed Oct 12, 2016 6:50 pm

Hello,

I still have problems running RealVNC in Pixel. I started with a fresh raspbian from september, did apt-get update and upgrade yesterday and followed a lot advices that where posted in this thread.

Still it is not working. In the /var/log/daemon.log there are still the following lines after each reboot:
Oct 12 18:29:34 raspberrypi systemd[1]: Starting VNC Server in Service Mode daemon...
Oct 12 18:29:35 raspberrypi systemd[1]: Started VNC Server in Service Mode daemon.
Oct 12 18:29:35 raspberrypi systemd[1]: vncserver-x11-serviced.service: main process exited, code=exited, status=1/FAILURE
Oct 12 18:29:35 raspberrypi systemd[1]: Unit vncserver-x11-serviced.service entered failed state.
Oct 12 18:29:35 raspberrypi systemd[1]: vncserver-x11-serviced.service holdoff time over, scheduling restart.
Oct 12 18:29:35 raspberrypi systemd[1]: Stopping VNC Server in Service Mode daemon...
This lines are repeated 2 to 4 times.

I didn't find any other logs that would give me detailed information about the error. How to fix this?
DisasterArea:
A mid aged Oracle Certified Associate, SAL, .NET. PHP, PL/SQL programmer, RasPi and Linux newbie and guitar player. Excuse my poor English.

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Fri Oct 14, 2016 10:09 am

DisasterArea wrote:Hello,

I still have problems running RealVNC in Pixel. I started with a fresh raspbian from september, did apt-get update and upgrade yesterday and followed a lot advices that where posted in this thread.

Still it is not working. In the /var/log/daemon.log there are still the following lines after each reboot:
Oct 12 18:29:34 raspberrypi systemd[1]: Starting VNC Server in Service Mode daemon...
Oct 12 18:29:35 raspberrypi systemd[1]: Started VNC Server in Service Mode daemon.
Oct 12 18:29:35 raspberrypi systemd[1]: vncserver-x11-serviced.service: main process exited, code=exited, status=1/FAILURE
Oct 12 18:29:35 raspberrypi systemd[1]: Unit vncserver-x11-serviced.service entered failed state.
Oct 12 18:29:35 raspberrypi systemd[1]: vncserver-x11-serviced.service holdoff time over, scheduling restart.
Oct 12 18:29:35 raspberrypi systemd[1]: Stopping VNC Server in Service Mode daemon...
This lines are repeated 2 to 4 times.

I didn't find any other logs that would give me detailed information about the error. How to fix this?
Hi,

Does this only happen at boot time? i.e. are you able to start the server once the system is booted (you can do this by enabling VNC in raspi-config, or by doing "sudo systemctl start vncserver-x11-serviced.service").

You can enable full logging for the VNC Service mode server by editing the file /root/.vnc/config.d/vncserver-x11 and add the following line (or edit as necessary):

Code: Select all

Log=*:file:100
It should then write more logging information to /var/log/vncserver-x11.log.

If you prefer, you can go to http://www.realvnc.com and submit a support ticket (mentioning this forum thread), and they should be able to help you directly.

DisasterArea
Posts: 13
Joined: Wed Dec 19, 2012 8:20 am

Re: Pixel and RealVNC

Fri Oct 14, 2016 7:16 pm

Thx sconemad,

I fixed it (and run into another problem):

The server does this error always (while rebooting or "sudo systemctl start vncserver-x11-serviced.service") but your advice to add

Code: Select all

Log=*:file:100
does the trick. In the new generated file /var/log/vncserver-x11.log I found the following line:

Code: Select all

main: Error getting private key from /root/.vnc/private.key: End of stream
So I found no further advice in the web and did the following:
After entering vnc and TAB I get a list of vnc executables. So I decided to enter "vncserver --help" and found the "--list" command. I entered "vncserver --list" and got a long description. Here is the relevant extract:
Usage: Xvnc [OPTION...]
Xvnc [OPTION...] COMMAND

Commands are used to perform auxiliary operations. The DISPLAY environment
variable is used to determine which instance to control for commands affecting
an existing VNC Server. The available commands are:
-stop Stop an existing VNC Server.
-reload Reload license keys and parameters for an existing
VNC Server.
-showexistingstatus Display the status dialog of an existing VNC Server.
-disconnect Disconnect all users from an existing VNC Server.
-connect HOST[::PORT] Connect an existing VNC Server to Listening VNC
Viewer at HOST on PORT (default 5500).
-generatekeys [force] Generate and store an RSA private key; "force"
overwrites an existing key. Rsa* parameters may be
specified first (in particular RsaModulusBits).
In my case there was an empty private.key file in /root/.vnc. Here is the magic trick

Code: Select all

pi@raspberrypi:~ $ sudo Xvnc -generatekeys force
Generating private key... done
That's all. After rebooting the server is running. :D

But :? I run in another problem. On my window pc I installed UltraVNC Viewer and tried to connect to my raspberry but I get the error "No supported authentication methods". So any advice on how to solve this? Do I really have to use RealVNC Viewer?

mattmiller
Posts: 2243
Joined: Thu Feb 05, 2015 11:25 pm

Re: Pixel and RealVNC

Fri Oct 14, 2016 8:24 pm

Try configuring the server to not do encryption maybe?

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Sat Oct 15, 2016 1:54 pm

Hi, glad you managed to sort out the private key issue. Looks like the file had got corrupted somehow, I've certainly not seen this before.

In order to connect from another VNC viewer, you need to set the authentication type to vnc authentication, and set a vnc password, since other viewers don't support vnc system authentication.

You should also be aware that the connection won't be encrypted in this case.

DisasterArea
Posts: 13
Joined: Wed Dec 19, 2012 8:20 am

Re: Pixel and RealVNC

Sat Oct 15, 2016 2:42 pm

sconemad wrote:Hi, glad you managed to sort out the private key issue. Looks like the file had got corrupted somehow, I've certainly not seen this before.

In order to connect from another VNC viewer, you need to set the authentication type to vnc authentication, and set a vnc password, since other viewers don't support vnc system authentication.

You should also be aware that the connection won't be encrypted in this case.
Thx for this advice as well. Switching to vnc system authentication did it.

johnestan
Posts: 12
Joined: Thu Sep 15, 2016 7:37 pm

Re: Pixel and RealVNC

Fri Oct 21, 2016 1:58 pm

I was previously using the TightVNC Java Viewer, but it didn't work on a fresh install of pixel. RealVNC works great though.

iain1940
Posts: 16
Joined: Sat Dec 22, 2012 8:53 pm

Re: Pixel and RealVNC

Fri Oct 28, 2016 10:58 am

I hope that this is the place to post a query on Pixel and RealVNV running headless with the desktop on an IMac G5 running OSX 10.5.8.

pi is a model B rev 000e
I installed Pixel via NOOBS and ran 'update' 'upgrade-dist' 2 days ago

I've installed the RealVNC viewer for 10.5.8 (E4.6.3) ok and I've got the Pi workspace working OK when I had a monitor/keyboard/mouse attached. Now running headless I can only get an 640x480 window.
'Display Settings' just gives option of '640x480) or 'Auto' (the same).

Since the idea was to make best use of the beautiful G5 screen, not sure what to do next or where to look.

I'm booting to 'Desktop' ('CLI' didn't seem to work)

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Fri Oct 28, 2016 11:37 am

Without a monitor attached, the display defaults to SDTV resolution (I think this is 720x480).

You can change this by editing /boot/config.txt and forcing a particular resolution, the following page explains how to do it:
https://support.realvnc.com/knowledgeba ... e/View/523

iain1940
Posts: 16
Joined: Sat Dec 22, 2012 8:53 pm

Re: Pixel and RealVNC

Fri Oct 28, 2016 2:01 pm

Thanks Sconemad - I changed config.txt and it worked fine at 1024x768.

I then tried to be clever and disable encryption as suggested on the page (More - Options - Expert Encryption - AlwaysOff)

Now the connection fails - 'VNC has no security types configured - .. check VNC server configuration and try again'

Problem - can't change configuration without connecting.

Can I edit the vnc server configuration on the Pixel SD card ?

sorry to be a pain !

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Fri Oct 28, 2016 6:17 pm

What do you have the Encryption set to on the viewer (it's underneath where you enter the address). It won't work if you have this set to always on or maximum, since that won't let it use unencrypted connections.

iain1940
Posts: 16
Joined: Sat Dec 22, 2012 8:53 pm

Re: Pixel and RealVNC

Fri Oct 28, 2016 6:59 pm

What do you have the Encryption set to on the viewer (it's underneath where you enter the address). It won't work if you have this set to always on or maximum, since that won't let it use unencrypted connections.
Have tried all 5 options :

'Let VNC Server choose'
'Always Maximum'
'Always On'
'Prefer On'
'Prefer Off'

Always the same result 'VNC Server has no Security types ....'

I can SSH into the pi (on the G5 and my Linux box) and see the server running with 'ps -ef | grep vnc

Code: Select all

root       434     1  2 18:34 ?        00:00:22 /usr/bin/vncserver-x11-core -service -pidFile /var/run/vncserver-x11-serviced.pid
root       533     1  0 18:34 ?        00:00:01 /usr/bin/vncagent service 19
pi         673   434  0 18:34 ?        00:00:01 /usr/bin/vncserverui service 20
pi         740   673  0 18:34 ?        00:00:00 /usr/bin/vncserverui -statusicon 5
but am not sure where the 'corrupted' (ie with encryption = alwaysoff) configuration file(s) is.

hope this sheds a bit more light.

iain1940
Posts: 16
Joined: Sat Dec 22, 2012 8:53 pm

Re: Pixel and RealVNC

Fri Oct 28, 2016 7:16 pm

found it

file /root/.vnc/config.d/vncserver-x11 contains :

Code: Select all

_Edition=Personal
_LastUpdateCheckSuccessTime=int64:01d230f805c5cf40
_LastUpdateCheckTime=int64:01d230f805c5cf40
Encryption=AllwaysOff
edited removing 'Encryption' line.
rebooted & G5 connects

Thanks for your time - hope I haven't wasted too much of it.

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Fri Oct 28, 2016 8:21 pm

No problem, glad you managed to figure it out.

flyingppg
Posts: 1
Joined: Thu Jan 05, 2017 2:32 pm

Re: Pixel and RealVNC

Thu Jan 05, 2017 2:46 pm

iw1 wrote:
Please could you try running:

Code: Select all

sudo vncinitconfig -service-daemon
this will reinstall the init script for the VNC Server. We've found that the server will start more reliably on boot after this.
This command alone did not help, but when followed by

Code: Select all

sudo systemctl enable vncserver-x11-serviced.service
the vnc server succesfully started after a re-boot even when CUPS was installed. The VNC icon appears on the taskbar and the Pi can be accessed remotely with or without a monitor connected.
I now have everything working so thanks.
I have also had this exact issue. New install of Raspian Jessie from noobs (actually the multiboot pi from http://www.multibootpi.com/builds/quad- ... /#more-239
Had RealVNC server working reliably each and every boot. Then installed CUPS and RealVNC would not start at boot regardless of what I set either in raspi-config or Pixel->Preferences->Raspberry pi Configuration.

Have now implemented iw1's fix as above and all is now working again. Thank you. :-)

Texas-Mark
Posts: 100
Joined: Wed Dec 28, 2016 3:30 pm

Re: Pixel and RealVNC

Sun Jan 08, 2017 3:02 am

I have read the whole thread and am having a similar problem (I think). In my case, when I enable RealVNC to auto start from the Raspberry Pi Configuration - Interfaces menu, I get the VNC icon, but the server does not actually auto start even though it says ready for connections. I can still manually start it from the terminal with "vncserver :1" and then it works fine. It's just the auto start that is not working. I have tried some of the fixes in this thread, but nothing seems to work. I have the latest updates for everything and don't really have anything odd installed. Any ideas?

Never mind. It seems that you have to use <ip address>:0 if auto start is on, instead of <ip address>:1 to connect when VNC is manually started.

Note: When I was setting up RealVNC, I had read to use "vncserver :1" and so that is what I had been doing and had set up the viewer to connect to <ip address>:1 so it was failing because auto start expects <ip address>:0
Last edited by Texas-Mark on Mon Jan 09, 2017 6:24 pm, edited 2 times in total.

ismael280373
Posts: 40
Joined: Thu Oct 01, 2015 9:37 am

Re: Pixel and RealVNC

Mon Jan 09, 2017 5:44 pm

Hi, all.

I'm a little bit confused, sorry.

I'm actually running tightvnc not vncserver. Everything runs ok. What I need to do to replace tightvnc by vncserver??

I will run "sudo apt-get install -y vncserver..." Do I need to uninstall tightvnc after vncserver installation or that is not needed??

Thanks in advance.
GOD BLESS THE BLUES!!

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Mon Jan 09, 2017 10:47 pm

Texas-Mark wrote:I have read the whole thread and am having a similar problem (I think). In my case, when I enable RealVNC to auto start from the Raspberry Pi Configuration - Interfaces menu, I get the VNC icon, but the server does not actually auto start even though it says ready for connections. I can still manually start it from the terminal with "vncserver :1" and then it works fine. It's just the auto start that is not working. I have tried some of the fixes in this thread, but nothing seems to work. I have the latest updates for everything and don't really have anything odd installed. Any ideas?

Never mind. It seems that you have to use <ip address>:0 if auto start is on, instead of <ip address>:1 to connect when VNC is manually started.

Note: When I was setting up RealVNC, I had read to use "vncserver :1" and so that is what I had been doing and had set up the viewer to connect to <ip address>:1 so it was failing because auto start expects <ip address>:0
What you have here is two different things.

When you enable VNC from the Raspberry Pi configuration, you're enabling the RealVNC Service mode server. This is designed to allow access to the console display (in other words, what you see on the monitor), and runs on display :0 by default. Hence you use <ip-address>:0 or simply <ip-address> in your viewer to connect to it.

When you run the vncserver command, you're actually staring a new VNC Virtual mode server, which is a separate desktop that you access via VNC. This will use the next available display number, starting with :1 (since you can run multiple virtual desktops).

A lot of tutorials that you'll read online are confusing these two modes, but which one to use really depends on what you are doing. The advantage of service mode is that you can run applications that require the GPU, for example Minecraft or Kodi (assuming you enable "experimental direct capture mode" in the VNC Server options). Virtual mode makes more sense when you only occasionally want to run graphical applications on a headless machine.

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pixel and RealVNC

Mon Jan 09, 2017 10:56 pm

ismael280373 wrote:Hi, all.

I'm a little bit confused, sorry.

I'm actually running tightvnc not vncserver. Everything runs ok. What I need to do to replace tightvnc by vncserver??

I will run "sudo apt-get install -y vncserver..." Do I need to uninstall tightvnc after vncserver installation or that is not needed??

Thanks in advance.
vncserver is the command that you run to start a VNC virtual mode server - see my previous reply to this thread for the difference between virtual and service modes.

There are numerous packages that provide VNC functionality, many of which include their own version of the vncserver command, e.g. tightvncserver, vnc4server, realvnc-vnc-server, etc.

Texas-Mark
Posts: 100
Joined: Wed Dec 28, 2016 3:30 pm

Re: Pixel and RealVNC

Mon Jan 09, 2017 10:59 pm

sconemad wrote:A lot of tutorials that you'll read online are confusing these two modes, ......
Yeah, that is pretty much what happened. I read one tutorial that said to use vncserver:1 which worked fine with the viewer, then when I tried to use the auto start feature, it appeared as if the server was not actually starting. As someone who is not new to computers and microcontrollers, but new to the Pi, it has been a bit frustrating trying to find the correct information as a lot of the info is either outdated, or as you stated "confusing". It was just a fluke that I stumbled on the solution while looking for something else.

Bosse_B
Posts: 993
Joined: Thu Jan 30, 2014 9:53 am

Re: Pixel and RealVNC

Tue Jan 10, 2017 11:25 pm

Another issue I have found after installing Raspbian PIXEL (latest image) yesterday on an RPi3:
I can access the remote desktop fine from my PC using Real VNC Client and it displays a really nice version of the screen.

However, if I go away for a while (lunch, dinner...) then when I come back the session is gone, vanished...
All that is left is the start screen of VNC Viewer and I have to click the connection icon again to show the remote screen.
Why does this happen? I have not found anything in the VNC Viewer settings that deals with a disconnect timeout or such.
Bo Berglund
Sweden

Return to “Raspberry Pi OS”