Score:1

vncserver exited too early

lk flag
jxw

I have a Ubuntu 21.10 headless and I need to connect to it using remote desktop. When I attempt to start using vncservercommand I get the below too early exit code

hd2900@hd2900:~/.vnc$ vncserver

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


=================== tail /home/hd2900/.vnc/hd2900:5901.log ===================
==============================================================================

Session startup via '/home/hd2900/.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 10156... success!
hd2900@hd2900:~/.vnc$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:    21.10
Codename:   impish

My xstartup file is configured as

cat xstartup 
#!/bin/sh
# Start Gnome 3 Desktop 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

The VNC was set up by

apt install ubuntu-gnome-desktop
apt install tigervnc-standalone-server

Then I set up the password using vncpasswd command followed by vncserver to command to launch the server.

us flag
Does `tigervncserver -xstartup /usr/bin/gnome-session` work? I use XFCE, and encountered the same error. `tigervncserver -xstartup /usr/bin/xfce4-session` worked for me
Score:0
us flag
tigervncserver -xstartup /usr/bin/gnome-session

will work. Indeed all you need to do is to remove & from the last line:

dbus-launch --exit-with-session gnome-session

Looks like newer versions of tigervncserver expects the ~/.vnc/xstartup (or ~/.vnc/Xtigervnc-session) script to stay in foreground. (I am on Ubuntu 21.10 and the ending & is the problem. On 20.04LTS the ending & is not an issue.)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.