Ubuntu-mate 21.04 64bit tigervncserver 1.11 will not run

I have installed tigervnc server on many Ubuntu, CentOS, and windows systems. I cant get it to work on U-M 21.04.

I installed U-M 21.04 64bit desktop on a new laptop with a new SSD. I ran apt update to make it current. Next, I installed tigervnc-standalone-server package with apt. The default package installed reported "tigervnc-standalone-server 1.11.0+dfsg-2ubuntu0.1".

I logged in as a non-root user. I ran vncpasswd to set my password.

Next I created my ~/.vnc/xstartup according to help here:
How to Install & Configure VNC Server on Ubuntu 20.04 finding no help for U-M 21.04.
xstartup contents:
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
/usr/bin/mate-session --debug &

Then I run 'vncserver :1'

Then I get the following error:

New Xtigervnc server 'phil-Inspiron-15-3511:1 (painter)' on port 5901 for display :1.
Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/painter/.vnc/passwd :1 to connect to the VNC server.

=================== tail /home/painter/.vnc/phil-Inspiron-15-3511:5901.log ===================

Session startup via '/home/painter/.vnc/xstartup' cleanly exited too early (< 3 seconds)!

Maybe try something simple first, e.g.,
tigervncserver -xstartup /usr/bin/xterm
The X session cleanly exited!
Killing Xtigervnc process ID 30379... success!

On all my other systems I dont see such messages and a session is created which I can access with my external vnc client.

Any ideas?

thanks
oldunixguy

Very obvious problem -- at least to a guy attuned to these details like me. Take a look at that last line of your xstartup file:

/usr/bin/mate-session --debug &

The last line should never be put in the background; when the last command in the script exits, the script terminates, and so does your VNC connection. By putting the last command in the background, the script exits immediately and your VNC session is terminated as soon as you begin it.

By keeping the mate-session daemon in the foreground:

/usr/bin/mate-session --debug

...your VNC session will not terminate until you log out of the MATE VNC session, which is the expected behavior (at least if you ask me).

In other words, remove that ampersand (&) at the end of the script.


I hope the solution is as simple as that, I hope it works, and I hope what I wrote helps.

Thanks for the reply!

Unfortunately I can't test it just now.....

However, the following is used on MANY CentOs 5 and several 7 and Ubuntu 14,16... all have the final step put in background. Here is a working one from CentOs 5:
[[email protected] .vnc]$ cat xstartup
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-session &

Also, the instructions found in the reference for use on Ubuntu 20 also has the final step put into background. They used "startxfce4 &" Desktop.

It is my understanding that the xstartup IS supposed to exit as soon as the Desktop process is started. So something else must be wrong.
thanks
oldunixguy

OK then, redirect the output of mate-session to a file:

/usr/bin/mate-session --debug >&2 2>/tmp/mate-session.log

...connect via VNC, and see what the log file contains. Maybe that'll give us a clue.

good idea. I know zero about the GUI world- been doing text and shells since 1972! I hope this sheds some light. I don't have the computer just now so it may be a week or so when I ge my hands on it again.
thanks
oldunixguy

1 Like