RealVNC - What's going on with RealVNC

Hello guys,

My DietPi setup finally got corrupted because of unsafe power outage. Keeps on staying on Emergency Mode. I tried to Press CTRL+D to resume but it never starts. I reformatted to start fresh, with all the needed services to start again. The problem is I can no longer install Real VNC on this setup. It tries to install and its on the list of optimized softwares.

As far as I can remember, when you install a service it will completely notify you if it’s has been installed successfully. This time when I install Real VNC, it will reach the final part when it tries to finish the install but crashes the terminal. Not knowing if its done or not because the terminal has already force exited without my intervention.

Restarted the Pi, and still the icon for the real VNC beside the clock is not present and looking in the list of services showing that the VNC server has “failed”. Restarting the services will still end up it failing.

I gave up on it for reinstalling over and over again. Is there an ongoing issue with RealVNC with DietPi? :cry: I have been using it up until yesterday when I tried to reinstall DietPi.

Edit: Im using an RPI B+ using the latest DietPi Image.

Try:

systemctl status vncserver.service

See if the service is failing and if so, what error(s) it’s reporting.

I had an issue with RealVNC on one of my Pis where it was reporting a You must specify a password for VNC authentication error. Until I set a password, the service was continually failing, even with service restarts, reboots of the system, etc.

If you have the same error, I can walk you through what I did to resolve it.

If I understood correctly installation is already failing. Try to connect via SSH and run dietpi-software.

Thank you, I will try to do it via SSH. I forgot I used to SSH my way installing softwares. I’ll update you it it worked.

edit: It didn’t work, I tried to install via SSH. What procedure did you take to resolve yours?

Joulinar, I was hoping it would work, but it didn’t. This time a was able to see the end of the installation and it says:

[ INFO ] DietPi-Software | Starting installed services, not controlled by DietPi-Services
[ OK ] DietPi-Software | systemctl start vncserver

And still it shows failed in the list of services

I suggested the status command to discover what specific error(s) are being produced by your vncserver service.

Be sure to check what error(s) you have before you attempt to fix anything. On the chance you also have a password error, I’ll walk you through what I did for mine. YMMV

The command:
systemctl status vncserver.service

…will produce something like the following:

    ● vncserver.service - VNC Server (DietPi)
        Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; vendor preset: enabled)
        Active: failed (Result: exit-code) since Fri 2021-10-29 08:22:32 PDT; 23s ago
        Process: 234484 ExecStart=/usr/local/bin/vncserver start (code=exited, status=1/FAILURE)
    Main PID: 234484 (code=exited, status=1/FAILURE)
            CPU: 36ms

    Oct 29 08:22:32 DietPi vncserver[234484]: registrations and/or pending trademark applications in the European Union,
    Oct 29 08:22:32 DietPi vncserver[234484]: United States of America and other jurisdictions.
    Oct 29 08:22:32 DietPi vncserver[234484]: Protected by UK patent 2481870; US patent 8760366; EU patent 2652951.
    Oct 29 08:22:32 DietPi vncserver[234484]: See https://www.realvnc.com for information on VNC.
    Oct 29 08:22:32 DietPi vncserver[234484]: For third party acknowledgements see:
    Oct 29 08:22:32 DietPi vncserver[234484]: https://www.realvnc.com/docs/6/foss.html
    Oct 29 08:22:32 DietPi vncserver[234484]: OS: Debian GNU/Linux 11, Linux 5.10.63, aarch64
    Oct 29 08:22:32 DietPi vncserver[234484]: You must specify a password for VNC authentication.
    Oct 29 08:22:32 DietPi systemd[1]: vncserver.service: Main process exited, code=exited, status=1/FAILURE
    Oct 29 08:22:32 DietPi systemd[1]: vncserver.service: Failed with result 'exit-code'.

Notice the third line from the bottom in the example above. It states: ‘You must specify a password’. So in my example, I needed to provide that password in order for the service to start.

I set the password with the following command:
vncpasswd -virtual

Then I provided a password and verified it at the prompts:

    Setting "Password" VNC parameter for Virtual Mode server
    Password:
    Verify:
    Successfully set "Password" VNC parameter in /root/.vnc/config.d/Xvnc
    Successfully set "Password" VNC parameter in
    /root/.vnc/config.d/vncserver-x11-virtual

Then I restarted the vncserver service:
systemctl restart vncserver

When I checked the status of the service, it showed that it started successfully:

    root@DietPi:~/.vnc# systemctl status vncserver
    ● vncserver.service - VNC Server (DietPi)
        Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; vendor preset: enabled)
        Active: active (exited) since Fri 2021-10-29 09:34:12 PDT; 2s ago
        Process: 235170 ExecStart=/usr/local/bin/vncserver start (code=exited, status=0/SUCCESS)
    Main PID: 235170 (code=exited, status=0/SUCCESS)
            CPU: 34ms

    Oct 29 09:34:12 DietPi systemd[1]: Started VNC Server (DietPi).
    Oct 29 09:34:12 DietPi systemd[235170]: pam_unix(login:session): session opened for user root(uid=0) by (uid=0)
    Oct 29 09:34:13 DietPi vncserver[235170]: [  OK  ] RealVNC detected
    Oct 29 09:34:13 DietPi vncserver[235170]: [ INFO ] Starting virtual desktop at display :1 in 1280x720x16

From there, I was able to connect with RealVNC again after I corrected one additional issue; for some reason, the port had changed from :5900 to :5901. I just specified the new port in RealVNC. VNC has worked normally since.

cloudn8ive

Thank you, that’s a lot for me to take but I’ll try that.

As of the moment I realized I don’t need a desktop environment. All I need to deploy is a Pi-hole, and CUPS for printing. I never did use the desktop due to it being laggy as I got an older RPI.

The only good advantage that I got when RealVNC works again is the remote access via cloud. This way I can access the Pi without me doing Port forwarding under CGNAT.

I will get back to this thread once I needed it the most. For now I will try your guide to make sure it will work when I need it, if not I’ll stay with a headless setup for now.

Edit: I’m wondering, after you set it up correctly (fixed it), did the icon for RealVNC showed up beside the system clock? I was wondering, because its may way of setting it up.

ok I’m lost. Are you able to connect to your system using RealVNC locally inside your local network?

If you don’t need a real desktop, better to think on a VPN solution like WireGuard. This is more resource effective and you could access your system from any client.

It was before I reformat it yesterday. I did the same procedure installing DietPi as normally you would, it’s just that this time RealVNC installs but the VNC server status from DietPi Services shows it failed. Then the RealVNC server icon is no longer available on the taskbar near the system clock as it would.

I was considering RealVNC because of the RealVNC Connect feature to access my Pi server remotely via cloud.

Although a was able to install the other VNC service called TigerVNC. It shows Active VNC Server under Dietpi Services. The problem is I know how to access any settings for the VNC server and I cant remote to it. It says something like “Not Listening”.

And to answer your question, yes I was able to access my Pi via VNC locally as well. But not not after I reformat, because it fails.

pls share following

systemctl status vncserver
journalctl -u vncserver
ss -tulpn | grep LISTEN

I’ll try to Install it, and the desktop as well. I will update you from what I got.

Edit: I edited my last previous post, but I haven’t noticed your response yet.

“Although a was able to install the other VNC service called TigerVNC. It shows Active VNC Server under Dietpi Services. The problem is I don’t know how to access any settings for the VNC server and I cant remote to it. It says something like “Not Listening”.”

TigerVNC is completely different VNC application and has nothing to do with RealVNC.

Hello again here are the results I got:

systemctl status vncserver

● vncserver.service - VNC Server (DietPi)
     Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2021-10-30 16:53:57 BST; 24min ago
    Process: 372 ExecStart=/usr/local/bin/vncserver start (code=exited, status=127)
   Main PID: 372 (code=exited, status=127)
        CPU: 144ms

Oct 30 16:53:48 SVR01 systemd[1]: Started VNC Server (DietPi).
Oct 30 16:53:49 SVR01 systemd[372]: pam_unix(login:session): session opened for user root(uid=0) by (uid=0)
Oct 30 16:53:57 SVR01 systemd[1]: vncserver.service: Main process exited, code=exited, status=127/n/a
Oct 30 16:53:57 SVR01 systemd[1]: vncserver.service: Failed with result 'exit-code'.

journalctl -u vncserver

-- Journal begins at Sat 2021-10-30 16:53:29 BST, ends at Sat 2021-10-30 17:20:02 BST. --
Oct 30 16:53:48 SVR01 systemd[1]: Started VNC Server (DietPi).
Oct 30 16:53:49 SVR01 systemd[372]: pam_unix(login:session): session opened for user root(uid=0) by (uid=0)
Oct 30 16:53:57 SVR01 systemd[1]: vncserver.service: Main process exited, code=exited, status=127/n/a
Oct 30 16:53:57 SVR01 systemd[1]: vncserver.service: Failed with result 'exit-code'.

ss -tulpn | grep LISTEN

No Output Message

Exit code 127 means that the binary itself was not found. Can you please paste the following:

ls -l /usr/local/bin/vncserver
ls -l /usr/bin/vncserver-virtual
ls -l /usr/bin/vncserver-x11

MichaIng

Hello here are the results I got:

ls -l /usr/local/bin/vncserver

-rwxr-xr-x 1 root root 2337 Nov 8 12:44 /usr/local/bin/vncserver

ls -l /usr/bin/vncserver-virtual

-rwxr-xr-x 1 root root 1059040 Jan 20 2021 /usr/bin/vncserver-virtual

ls -l /usr/bin/vncserver-x11

-rwsr-xr-x 1 root root 1441916 Jan 20 2021 /usr/bin/vncserver-x11

Then the “not found” probably comes from RealVNC itself to say that the required libraries were not found. This is on Bullseye? Could you try:

dpkg -L libraspberrypi0 | grep '/usr/lib/arm-linux-gnueabihf/.*\.so.0' | while read -r line
do
line=${line#/usr/lib/arm-linux-gnueabihf/}
ln -s "$line" "${line%.0}"
done
systemctl restart vncserver
sleep 3
journalctl -u vncserver