Score:2

Gnome VNC session not displaying correctly -- defaults to gnome-classic

us flag

I'm trying to set up a VNC server in Ubuntu 22.04 using tightvnc. I pretty much have it working, except the gnome session is not displaying correctly. It looks like this:

enter image description here

which is sort of like gnome classic, but without the desktop background, so clearly things are not fully loading.

Here's my ~/.vnc/xstartup file:

$ cat ~/.vnc/xstartup
#!/bin/sh
autocutsel -fork
xrdb $HOME/.Xresources
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity"
export XDG_MENU_PREFIX="gnome-flashback-"
unset DBUS_SESSION_BUS_ADDRESS
gnome-session --session=gnome-flashback-metacity --disable-acceleration-check --debug &

I've also tried another version which basically looks the same:

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &

And here's my systemd service:

$ cat /etc/systemd/system/vncserver@.service 

[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=user
Group=user
WorkingDirectory=/home/user

PIDFile=/home/user/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1920x1080 -localhost :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

My .Xresources file is empty (but exists).

And lastly, the current status of the service kicks up a couple of errors, but I can't figure out what they mean or how to debug them:

● vncserver@1.service - Start TightVNC server at startup
     Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-12-14 18:53:37 CET; 19min ago
    Process: 28167 ExecStartPre=/usr/bin/vncserver -kill :1 > /dev/null 2>&1 (code=exited, status=2)
    Process: 28171 ExecStart=/usr/bin/vncserver -depth 24 -geometry 1920x1080 -localhost :1 (code=exited, status=0/SUCCESS)
   Main PID: 28182 (Xtightvnc)
      Tasks: 155 (limit: 629145)
     Memory: 257.2M
        CPU: 32.435s
     CGroup: /system.slice/system-vncserver.slice/vncserver@1.service
             ├─28182 Xtightvnc :1 -desktop X -auth /home/user/.Xauthority -geometry 1920x1080 -depth 24 -rfbwait 120000 -rfbauth /home/user/.vnc/passwd -rfbport 5901 -fp /usr/share/font>
             ├─28269 /usr/libexec/gnome-session-binary --session=gnome-flashback-metacity --disable-acceleration-check --debug
             ├─28272 dbus-launch --exit-with-session /usr/libexec/gnome-session-binary --session=gnome-flashback-metacity --disable-acceleration-check --debug
             ├─28273 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --session
             ├─28283 /usr/bin/gnome-keyring-daemon --start --components=ssh
             ├─28293 gnome-flashback
             ├─28294 /usr/libexec/gnome-flashback-clipboard
             ├─28297 /usr/libexec/gnome-flashback-media-keys
             ├─28298 /usr/libexec/at-spi-bus-launcher --launch-immediately
             ├─28304 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/home/user/.cache/at-spi/bus_1
             ├─28308 /usr/libexec/at-spi2-registryd --use-gnome-session
             ├─28324 /usr/libexec/gvfsd
             ├─28324 /usr/libexec/gvfsd
             ├─28332 /usr/libexec/gvfsd-fuse /home/user/.cache/gvfs -f
             ├─28348 /usr/libexec/gvfs-udisks2-volume-monitor
             ├─28357 /usr/libexec/gvfs-mtp-volume-monitor
             ├─28362 /usr/libexec/gvfs-gphoto2-volume-monitor
             ├─28367 /usr/libexec/gvfs-afc-volume-monitor
             ├─28373 /usr/libexec/gvfs-goa-volume-monitor
             ├─28377 /usr/libexec/goa-daemon
             ├─28385 /usr/libexec/goa-identity-service
             ├─28390 ibus-daemon --xim --panel disable
             ├─28395 /usr/libexec/dconf-service
             ├─28397 /usr/libexec/ibus-dconf
             ├─28398 /usr/libexec/ibus-extension-gtk3
             ├─28402 /usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd
             ├─28404 /usr/libexec/ibus-x11 --kill-daemon
             ├─28408 metacity
             ├─28411 /usr/libexec/ibus-portal
             ├─28421 /usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd
             ├─28434 /usr/libexec/gvfsd-trash --spawner :1.23 /org/gtk/gvfs/exec_spaw/0
             ├─28444 gnome-panel
             ├─28445 /usr/libexec/ibus-engine-simple
             ├─28459 /usr/libexec/geoclue-2.0/demos/agent
             ├─28460 nm-applet
             ├─28466 /usr/lib/x86_64-linux-gnu/indicator-messages/indicator-messages-service
             ├─28467 /usr/libexec/tracker-miner-fs-3
             ├─28484 /usr/lib/x86_64-linux-gnu/indicator-application/indicator-application-service
             ├─28498 /usr/libexec/evolution-data-server/evolution-alarm-notify
             ├─28564 /usr/libexec/evolution-source-registry
             ├─28576 /usr/libexec/evolution-calendar-factory
             ├─28591 /usr/libexec/evolution-addressbook-factory
             ├─30350 update-notifier
             └─30411 /usr/bin/python3 /usr/share/apport/apport-gtk

Dez 14 18:54:39 BF1370032 update-notifier.desktop[30399]: Error executing command as another user: Not authorized
Dez 14 18:54:39 BF1370032 update-notifier.desktop[30399]: This incident has been reported.
Dez 14 18:54:41 BF1370032 metacity.desktop[28408]: Xlib:  extension "X-Resource" missing on display ":1".
Dez 14 18:55:37 BF1370032 gnome-session-binary[28269]: DEBUG(+): Starting app: /org/gnome/SessionManager/App58
Dez 14 18:55:37 BF1370032 gnome-session-binary[28269]: DEBUG(+): GsmAutostartApp: starting org.gnome.DejaDup.Monitor.desktop: command=/usr/libexec/deja-dup/deja-dup-monitor startup-id=1>
Dez 14 18:55:37 BF1370032 gnome-session-binary[28269]: GnomeDesktop-DEBUG(+): Not systemd managed, will not move PID 30446 into transient scope
Dez 14 18:55:37 BF1370032 gnome-session-binary[28269]: DEBUG(+): GsmAutostartApp: started pid:30446
Dez 14 18:57:37 BF1370032 gnome-session-binary[28269]: DEBUG(+): GsmAutostartApp: (pid:30446) done (status:0)
Dez 14 19:05:36 BF1370032 gnome-session-binary[28269]: DEBUG(+): GsmSystemd: received logind signal: SessionNew
Dez 14 19:05:36 BF1370032 gnome-session-binary[28269]: DEBUG(+): GsmSystemd: ignoring SessionNew signal

Any thoughts on how to make the gnome session look like the default gnome environment? Do I just need to install some additional extensions or am I going about this wrong?

Hei avatar
bs flag
Hei
I am on the same boat. Did you figure?
user3037237 avatar
us flag
Nope, after a ton of trouble shooting it just seems that the vncserver service running a virtual desktop can't handle 3d acceleration. I was able to get it to work with KDE, if that's useful, but I ended up just going back to x11vnc to reveal the current active desktop. Works fine for a single user and with a monitor, but wouldn't work for multiple users or a headless box.
I sit in a Tesla and translated this thread with Ai:

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.