User avatar
SyncBerry
Posts: 43
Joined: Sat Sep 21, 2019 11:13 am
Location: France (S-W)

VNC with remmina: desktop cannot be displayed at the moment

Wed Oct 09, 2019 5:05 am

Hi Piple
I set up my Rasbian Buster (up to date) Pi for remote ssh access with keys only.
I'd like I could use it with remmina (3rd party VNC client well known in ubuntu world) so I followed the official doc and downgraded server authentication. This works OK, over ssh too, but only if the pi is booted with the option of mandatory user loggin (fine) + Desktop.
Now trying to disable Desktop to free resources in the Pi for the app it is intended to run (Syncthing), when I VNCoSSH to the Pi I get a beautiful graphical message stating the desktop cannot be displayed at the moment.
The command explained in the doc vncserver returns well

Code: Select all

....
Exécution d'applications dans /etc/vnc/xstartup

Alias VNC Server : "Octavia vodka shampoo. Lark costume Harvard."
       signature : xx-27-9a-xx-xx-bf-xx-xx

Fichier journal : /home/mypiuser/.vnc/SyncBerry:1.log
Nouveau bureau : Pi:1 (192.168.0.148:1)
What's wrong please?
Thank you

User avatar
SyncBerry
Posts: 43
Joined: Sat Sep 21, 2019 11:13 am
Location: France (S-W)

Re: VNC with remmina: desktop cannot be displayed at the moment

Thu Oct 10, 2019 11:16 pm

Here is a capture showing the message meaning "Unable to show the Desktop at the moment"
In the output above from vncserver I see something strange to me : the message refers to mypiuser instead of root (I say this because I know that the VNC creds are stored in /root/.vnc/....)
Good night
Attachments
Capture du 2019-10-11 01-13-34.png
Capture du 2019-10-11 01-13-34.png (42.36 KiB) Viewed 433 times

Andyroo

Re: VNC with remmina: desktop cannot be displayed at the moment

Fri Oct 11, 2019 12:56 am

You say you are disabling the desktop
Now trying to disable Desktop to free resources in the Pi
If you do that then VNC will not run as it needs this to run.

User avatar
SyncBerry
Posts: 43
Joined: Sat Sep 21, 2019 11:13 am
Location: France (S-W)

Re: VNC with remmina: desktop cannot be displayed at the moment

Fri Oct 11, 2019 11:16 am

Hi man, thank you for reply
The official Raspbian doc says we can connect VNC server with desktop disabled (all in the end of dedicated VNC page), but it is not clear about prereqs for this : RealVNC and/or 3rd party server and/or client.
Did I say my Pi is headless and I had to set a résolution with raspi-config to have VNC to work with desktop enabled ?

fruitoftheloom
Posts: 20930
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: VNC with remmina: desktop cannot be displayed at the moment

Fri Oct 11, 2019 11:43 am

SyncBerry wrote:
Fri Oct 11, 2019 11:16 am
Hi man, thank you for reply
The official Raspbian doc says we can connect VNC server with desktop disabled (all in the end of dedicated VNC page), but it is not clear about prereqs for this : RealVNC and/or 3rd party server and/or client.
Did I say my Pi is headless and I had to set a résolution with raspi-config to have VNC to work with desktop enabled ?

RealVNC is supported by RPF / RPT, the RealVNC Developers specifically made a release for Raspbian Operating System.


Any other implementations or RDP / VNC etal are supported by their respective developers.
Retired disgracefully.....

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: VNC with remmina: desktop cannot be displayed at the moment

Fri Oct 11, 2019 2:12 pm

SyncBerry wrote:
Fri Oct 11, 2019 11:16 am
Hi man, thank you for reply
The official Raspbian doc says we can connect VNC server with desktop disabled (all in the end of dedicated VNC page), but it is not clear about prereqs for this : RealVNC and/or 3rd party server and/or client.
Did I say my Pi is headless and I had to set a résolution with raspi-config to have VNC to work with desktop enabled ?
There are 2 modes for RealVNC, Service mode and Virtual mode.
The default Service mode requires desktop running.
VNC must be enabled sudo raspi-config
Service mode shows the actual local desktop.

Virtual mode will work with desktop either enabled or disabled. I believe desktop must be installed on the SD card so it won't work with Raspbian Lite.
There is no need to enable VNC in sudo raspi-config
To start a virtual session(s): (Either at the terminal prompt or over SSH connection).

Code: Select all

vncserver
You will be prompted with the address to use such as:

Code: Select all

new desktop is RPi4B4G:1 (192.168.1.107:1)
Either mode download a viewer client from here: https://www.realvnc.com/en/connect/download/viewer/
I have read that 3rd party viewers can be used if encryption is disabled. Google for that.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
SyncBerry
Posts: 43
Joined: Sat Sep 21, 2019 11:13 am
Location: France (S-W)

Re: VNC with remmina: desktop cannot be displayed at the moment

Sun Oct 13, 2019 9:23 pm

Many thanks klricks for your answer that makes very sense to me as it suits for all my needs.
Although, I still can't connect to vncserver-virtual.
What I did : I moved both ~/.vnc/config.d/Xvnc and vncserver-x11-virtual to the same names with a OLD- prefix, then I ran

Code: Select all

vncpasswd -type AdminPassword -virtual
This time I added the -type option I didn't on my first try.
both files were recreated with a single line inside (AdminPassword=...)

Code: Select all

~/.vnc/config.d $ diff Xvnc vncserver-x11-virtual 
~/.vnc/config.d $ echo $?
0
Then I ran

Code: Select all

~/.vnc/config.d $ vncserver -test :1 -config ~/.vnc/config.d/vncserver-x11-virtual
which prompted me for the password the same way vncpassword did just before... I retyped
The test was OK so I ran vncserver to test but that remmina failed to connect (I used port 5901 and the firewall is opened for any interfaces from 5800 to 5910) asking to retry enabling encryption. I tried again but failed again.
Then, before I killed vncserver and relaunch I edited my vncserver-x11-virtual that is

Code: Select all

~/.vnc/config.d $ cat vncserver-x11-virtual 
AdminPassword=xxxxxxxxxxxx
Authentication=VncAuth
Encryption=AlwaysOff
Password=xxxxxxxxxxxx

Code: Select all

~/.vnc/config.d $ vncserver-virtual -test :1 -config ~/.vnc/config.d/vncserver-x11-virtual 
VNC(R) Server 6.5.0 (r41824) ARMv6 (Aug 16 2019 00:24:44)
Copyright (C) 2002-2019 RealVNC Ltd.
RealVNC et VNC sont des marques de commerce de RealVNC Ltd, déposées et/ou en
cours de dépôt dans l'Union européenne, aux États-Unis et dans d'autres pays.
Protégé par le brevet nº 2481870 au Royaume-Uni ; nº 8760366 aux États-Unis ;
nº 2652951 dans l'UE.
Voir https://www.realvnc.com pour plus d'informations sur VNC.
Pour les avis de propriété intellectuelle d'entreprises tierces, voir :
https://www.realvnc.com/docs/6/foss.html
OS: Raspbian GNU/Linux 10, Linux 4.19.66, armv7l

Sur certaines distributions (Red Hat en particulier), vous obtiendrez peut-être
une meilleure expérience en exécutant vncserver-virtual conjointement avec le
serveur Xorg du système, plutôt que l'ancienne version intégrée à Xvnc. D'autres
environnements de bureau seront probablement compatibles. Pour plus
d'informations sur cette autre implémentation, voir :
https://www.realvnc.com/doclink/kb-546

Exécution d'applications dans /etc/vnc/xstartup

/usr/bin/Xvnc :1 -auth /home/myuser/.Xauthority -pn AdminPassword=xxxxxxxxxxxx Authentication=VncAuth Encryption=AlwaysOff Password=xxxxxxxxxxxx 
... but still fails :?: :?: :?:
At the client side the debug console shows (I translate)

Code: Select all

Welcome to the remmina log window
[VNC]VNC server supports protocol version 5.0 (viewer 3.8)
[VNC]We have 5 security types to read
[VNC]0) Received security type 13
[VNC]1) Received security type 5
[VNC]2) Received security type 6
[VNC]3) Received security type 130
[VNC]4) Received security type 192
[VNC]Authentication method unknown by VNC server : 13, 5, 6, 130, 192. Please retry after enabling encryption for this profile.
[glibsecret] password "ssh_password" deleted for file /home/me/.remmina/group_vnc_piv_piv-5901.remmina
[glibsecret] password "password" saved for file /home/me/.remmina/group_vnc_piv_piv-5901.remmina
Any idea please ?

User avatar
SyncBerry
Posts: 43
Joined: Sat Sep 21, 2019 11:13 am
Location: France (S-W)

Re: VNC with remmina: desktop cannot be displayed at the moment

Tue Oct 15, 2019 7:10 pm

Hi Piple
I finaly got it. Unfortunately, I won't be able to explain a clean elegant way:
I had the idea to fire up my old winXP on which I remembered I had an old RealVNC Client 4.2.9. I tried with it and after some tests and trails I got the Pi desktop using my Unix credentials (I think this is called PAM). From this I could access the server's GUI to check the settings and I was (half)-surprised it was set to...Unix password (although I previously added in my ~/.vnc/config.d/vncserver-x11-virtual file the line
Authentication=VncAuth). Then I disconnected and reconnected with "admin" user and the password I previously set with vncpassword. It worked. So it was time to test with remmina => OK, then remmina over SSH => :D . I didn't even had to restart the server.

Now, I have to search the web to remind my single neuron how to search/find a string in the whole tree and tell you in which file(s) this damned setting was stored. Hopefully it will be in one of the files listed there @RealVNC, but again my single neuron didn't helped me at all with this table.

PS: a side note if you want to try vncserver (OOTB symlinked to vncserver-virtual) with both options -test and -config : I followed the example given in the vncserver-virtual man(ual)=>failed

Code: Select all

Fatal server error:
Unrecognized option: -config=~/.vnc/config.d/vncserver-x11-virtual
:?
This way it works (a poor help although). Just omit the = (equal character)

Code: Select all

~/.vnc/config.d $ vncserver-virtual -test :1 -config ~/.vnc/config.d/vncserver-x11-virtual
Exécution d'applications dans /etc/vnc/xstartup
/usr/bin/Xvnc :1 -auth /home/pi/.Xauthority -pn AdminPassword=********* Authentication=VncAuth Encryption=AlwaysOff Password=xxxxxxxxxx 
PS: I think I found the culprit: ~/.vnc/config.d/Xvnc file.

Return to “Beginners”