RealVNC Server on Raspberry Pi 4

If it's headless, it has no GUI. And if it has no GUI, VNC won't work, because no display server/protocol is running to relay the information. If the Pi is headless, just use SSH.

2 Likes

Thanks for the help. I can do the SSH and the SSH with X to view some apps via GUI.

Using RealVNC on a Rpi3 running Raspbian, I was able to remotely access a VNC version of the GUI without having logged into the Pi's GUI directly. This came in handy because the Pi is located about 2,000 miles away, so I can't login graphically (unless I set it to automatic login, which I didn't want to do for security reasons). But I can restart it remotely (using a Kasa plug), so I can access the Pi's GUI after a reboot using RealVNC.

This is what I was trying to accomplish on the Rpi4 running Manjaro instead of Raspbian.

Is that not possible without running RealVNC (which doesn't appear to work on Manjaro)?

Oh, so the Pi is running a GUI.
So is it running Gnome with Wayland or Xorg?

Yeah, I wasn't clear: the Rpi4 is running a GUI but only when I am physically able to access it with the monitor.

That doesn't happen about 90% of the time, so it will be essentially headless because no monitor will be on or accessible.

When I am physically in the same location as the Pi and running a GUI, it is on Xorg.

Well, if it's running a GUI (display manager) when it boots, it should function the same way as on raspbian. Did you forward the ports correctly in the remote router/firewall?

Let me double check the ports. That may be an issue -- but I don't think it would connect if I had the wrong ports -- it would give me an error.

I want to make sure I am stating the GUI part correctly. The Pi does not boot into a fully running GUI on boot until I enter the password. Before that, it has the GNOME greeting screen. At that screen, I can choose Xorg or Wayland.

But they key part I want to make clear is that when I am accessing it remotely and have to reboot it, the boot process stops at the GNOME greeting screen. I believe that means it is not yet running a GUI, but please let me know if that is wrong?

No it is running a GUI.
Question is, is it running the VNC server? :slight_smile:

Ok -- glad that is cleared up!

So, the Rpi4 is running a GUI at the greeting screen on remote reboot, but there is no monitor attached and I am accessing it remotely via SSH. The goal is to access it via VNC.

I can start the VNC server from the SSH session (see OP), but I cannot access it from a client. I believe it is an issue with GNOME. That is where I think I am.

Have you ever tried to access a pi running Manajaro/GNOME/Xorg via VNC?

As it is not logged into gnome, it can't be an issue with gnome.

When you log into the pi with SSH, can you see if the vnc server systemd service is running?

I hadn't created a systemd service yet. I was trying to start it via the SSH manually first to make sure I had the settings right. I tried various VNC apps, but right now I have tigerVNC installed.

Okay. I don't use VNC my self, so I don't know much about how it works. But if the server is started, you should be able to connect to it, if the ports are open for it.
And if the ports are open and you still can't connect, there should be a log file with info on a afiled connection attempt.

So....I got it to work! But I don't know what I did different, so unfortunately this is not going to be the most helpful thread.

I will say that, after I had everything setup correctly, one thing that I noticed was an error in the log regarding permissions for xstartup.

This was like my fourth or fifth different VNC attempt on the same Pi, and I had forgotten to chmod +x the xstartup file. Once I fixed that, it started working. But I had done this before on a prior install of tigervnc and it did not work. So I must have changed something in between.

The result is a desktop that appears to be something other than GNOME (LXDE I assume). I can't tell for sure b/c only certain GNOME and all non-GNOME desktop applications will start on it. So I can't start gnome-terminal to see the DE.

Below is a picture.

Oddly, that is nautilus on the screen. Also, org.gnome.calculator, gnome-system-monitor, and file-roller work. But gnome-terminaland gnome-disks.

It is definitely providing a much different desktop than the one I get when logging in directly with a monitor.

And, to the extent it helps, I am including the log for the working-ish vnc.

  File "/home/user/.local/share/nautilus-python/extensions/syncthing-plugin-nautilus.py", line 8, in <module>
    from syncthing_gtk.nautilusplugin import NautiluslikeExtension
ModuleNotFoundError: No module named 'syncthing_gtk'

(gnome-panel:6387): menu-WARNING **: 14:01:31.679: Could not ask session manager if shut down is available: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Session>

Mon Nov 11 14:01:32 2019
 Connections: accepted: 10.0.1.10::33916
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type VeNCrypt(19)
 SVeNCrypt:   Client requests security type TLSVnc (258)

Mon Nov 11 14:01:34 2019
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
# Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached

(metacity:6389): metacity-WARNING **: 14:02:23.055: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0xc00024 (Untitled 1 - LibreOffice Math)

(metacity:6389): metacity-WARNING **: 14:02:23.055: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.

Also, it appears that I was using Wayland on the SSH and VNC connections.

Running:
loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'

Yielded: Wayland.

I uncommented the Wayland line in /etc/gdm/custom.conf, and now my session appears as tty.

1 Like

This issue has been bugging me to no end. I'm glad I'm not the only one who experienced this bizarre behavior. It looks like you got a VNC setup working in the end. Did you get RealVNC working, or did you switch to a different server? Thanks.

I didn't get RealVNC working. I only got X working, so I can open apps individually in a GUI -- but not the whole desktop.

This topic was automatically closed after 90 days. New replies are no longer allowed.

Forum kindly sponsored by