trying to get Tigervnc to run with gdm on ubuntu 20.04

34 views
Skip to first unread message

Scott Franco

unread,
Aug 22, 2025, 2:20:12 AMAug 22
to TigerVNC User Discussion/Support

I have tigervnc on ubuntu 20.04 (Yes I tried 24.04, it does not run vnc). I can start the vnc on the command line manually, but can't get it to run automatically on startup.

The xstartup file is:

#!/bin/sh
echo "Starting xsetup" > ~/xlog
# 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 &

To start vnc manually from the command line, I have a script:

/usr/bin/vncserver -kill :1
/usr/bin/vncserver :1 -depth 24 -geometry 1920x1080 -localhost no


To start vnc on power on, I use the script /etc/init.d/vncserver:

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    networking
# Default-Start:     3 4 5
# Default-Stop:      0 6
### END INIT INFO

PATH="$PATH:/usr/X11R6/bin/"

# The Username:Group that will run VNC
export USER="test"
#${RUNAS}

# The display that VNC will use
DISPLAY="1"

# Color depth (between 8 and 32)
DEPTH="24"

# The Desktop geometry to use.
GEOMETRY="1920x1080"
#GEOMETRY="800x600"
#GEOMETRY="1024x768"
#GEOMETRY="1280x1024"

# The name that the VNC Desktop will have.
NAME="test-vnc-server"

OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

. /lib/lsb/init-functions

case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on   localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;

stop)
log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;

restart)
$0 stop
$0 start
;;
esac

exit 0

These are all things I got from instructions on how to set up a vnc server.

On manual start, it is fine, has the GDM environment. On power up restart, it comes up black with no cursor.

What am I doing wrong?

Pierre Ossman

unread,
Sep 11, 2025, 9:22:53 AMSep 11
to Scott Franco, TigerVNC User Discussion/Support
On 22/08/2025 08:20, Scott Franco wrote:
>
> These are all things I got from instructions on how to set up a vnc server.
>
> On manual start, it is fine, has the GDM environment. On power up restart,
> it comes up black with no cursor.
>
> What am I doing wrong?
>

I would suspect it starts too early and there is something critical
missing. Have you checked and compared logs between the working and
broken case?

Regards,
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Reply all
Reply to author
Forward
0 new messages