16

I've been using VNC for many years but I don't know why this happens sometimes. With a new Ubuntu 16.04 machine, I first tried using Vino. It worked well, but I decided it is rather slow, so I decided to use TightVNC with the Xfce4 window manger. However I get this "grey screen" (I have experienced it before couple of times..) again.
My xstartup is :

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
startxfce4 &

and the log file is :

24/08/18 09:47:09 Xvnc version TightVNC-1.3.10
24/08/18 09:47:09 Copyright (C) 2000-2009 TightVNC Group
24/08/18 09:47:09 Copyright (C) 1999 AT&T Laboratories Cambridge
24/08/18 09:47:09 All Rights Reserved.
24/08/18 09:47:09 See http://www.tightvnc.com/ for information on TightVNC
24/08/18 09:47:09 Desktop name 'X' (kimchan:1)
24/08/18 09:47:09 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
24/08/18 09:47:09 Listening for VNC connections on TCP port 5901
Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
/usr/bin/startxfce4: X server already running on display :1
Xlib:  extension "RANDR" missing on display ":1".
xfce4-session: Another session manager is already running

24/08/18 09:48:08 Got connection from client 129.254.132.39
24/08/18 09:48:08 Using protocol version 3.8
24/08/18 09:48:12 Full-control authentication passed by 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 22
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 21
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 15
24/08/18 09:48:12 Using zlib encoding for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -314
24/08/18 09:48:12 Enabling full-color cursor updates for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -223
24/08/18 09:48:12 Pixel format for client 129.254.132.39:
24/08/18 09:48:12   32 bpp, depth 24, little endian
24/08/18 09:48:12   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
24/08/18 09:48:12   no translation needed
24/08/18 09:48:12 Using raw encoding for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 22
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 21
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 15
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -314
24/08/18 09:48:12 Enabling full-color cursor updates for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -223
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 22
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 21
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 15
24/08/18 09:48:12 Using zlib encoding for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -314
24/08/18 09:48:12 Enabling full-color cursor updates for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -223

What is wrong here? Is X server already running on display :1 an error? And how about "RANDR" missing on display:1? And what are those many ignoring unknown encoding messages?

6 Answers 6

28

I found https://bbs.archlinux.org/viewtopic.php?id=180965

and changed my xstartup to

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

and it works!

9
  • this works for me xubuntu 18.04
    – ptetteh227
    Commented Apr 13, 2019 at 14:47
  • Also works on Debian Buster 10 with XFCE DE.
    – EsmaeelE
    Commented Sep 25, 2019 at 6:15
  • 1
    works with debian 9 (stretch)
    – tortal
    Commented Mar 30, 2020 at 2:05
  • 1
    Working on 16.04 running on Orange Pi
    – brasofilo
    Commented May 17, 2020 at 3:43
  • 1
    Debian 12 not working, unless you install package dbus-x11. Then it works fine. Commented Dec 2, 2023 at 14:21
2

Working config for Gnome

#!/bin/sh
#
# Config requires following packages:
# gnome-panel nautilus gnome-terminal metacity
#


export XKL_XMODMAP_DISABLE=1

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
    
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey

gnome-session &
gnome-panel &

metacity &
gnome-terminal &
1

Following the other upvoted answer, I simply put:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

in my ~/.vnc/xstartup file and I was able to connect locally. Additionally, I had to edit /etc/vnc/conf adding the line:

$localhost = "no";

to let other machines on my private network connect to the tigervnc server (as opposed to only localhost clients).

1

None of the above worked for me. I found a suggestion on https://wiki.archlinux.org/index.php/TigerVNC#Recommended_security_settings

Try this:

vncserver -geometry ... -depth 24
1

Also make sure you have 'dbus-x11' installed

sudo apt-get install dbus-x11

According to packages.debian.org: This package contains the dbus-launch utility, which automatically launches one D-Bus session bus per X11 display per user. If the dbus-user-session package is also installed, it takes precedence over this package.

2
  • Please add a reference why this is needed.
    – David DE
    Commented Mar 31, 2023 at 10:32
  • Dec 01 2023 all suggestions failed. Only after installing dbus-x11 it was possible to have a working TightVNC (Debian Server, Win10 Client). To make the solution complete , keeping or not the & after startxfce4 command makes no difference, but you have to make use of unset SESSION_MANAGER and unset DBUS_SESSION_BUS_ADDRESS. Just to mention that if screen sharing is required with the existed user, usually logged in at X screen :0 , then you need to install the package x11vnc. In that case you "start" the vnc server by simply running x11vnc. ( use port ::5900 on client) Commented Dec 2, 2023 at 12:41
0

su -l username -c "(export DISPLAY=:5; dbus-launch --exit-with-session; vncserver -geometry 1792x899 -depth 24 :5)"

The command "dbus-launch --exit-with-session" sets dbus variables to be specific to the user running vncserver, otherwise it might pick them up from somewhere else or not have them set at all. 

DBUS_SESSION_BUS_PID=31898 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1003/bus

These need to be set correctly or you will get a blank screen or permission denied. For example DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1003/bus Where 1003 is the id of the user.

4
  • This already has an accepted answer. I do not see that your answer adds anything.
    – David DE
    Commented Apr 26, 2023 at 16:19
  • Because the accepted answer did not work for me. It only worked if starting vncserver as root user. If you wanted to start vncserver as a different user with those important environment variables unset, then it would fail with permission errors or a blank screen. Commented Apr 26, 2023 at 20:36
  • Also the next post from coder1 is also correct, you need dbus-x11 or dbus-user-session package installed Commented Apr 26, 2023 at 20:39
  • @AndyFlanagan in my setup , dbus-user-session was installed but the problem was only solved after installing dbus-x11 Commented Dec 2, 2023 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .