Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Xubuntu 12.04 on a headless server inside a VMware virtual machine. I'd prefer using x11vnc over Xvnc in order to use LightDM and the X server started by LightDM (and login using Xubuntu-session rather than xfce4).

The problem is that x11vnc is much slower than Xvnc (both vnc4server and tightvncserver flavours). I'm on a low speed broadband connection and, e.g. dragging windows is visibly slower on x11vnc, about 3-4 times slower I'd say.

I'm forcing 16 bit and 1280x800 on both x11vnc and Xvnc, but I'm not sure x11vnc is actually using 16bpp (see logs below).


I start x11vnc with a start script in /etc/init/x11vnc:

start on login-session-start
x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 \
  -auth /var/run/lightdm/root/:0 -forever -shared -bg \
  -o /var/log/x11vnc.log -rfbport 5901 -localhost -nopw -xrandr
end script

By default, this will start in 800x600 with 32bpp, which cannot be changed via command line parameters. I had to do:

apt-get install xserver-xorg-video-dummy

and then create /etc/X11/xorg.conf (which did not exist by default) with the contents:

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"

Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70

Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 16
    SubSection "Display"
    Depth 16
    Modes "1280x800"

When connecting to it, /var/log/x11vnc.log says:

30/11/2013 07:12:32 Pixel format for client
30/11/2013 07:12:32   16 bpp, depth 16, little endian
30/11/2013 07:12:32   true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
30/11/2013 07:12:32 no translation needed

note the true color part.

Also, there is still transparency in the lower panel when using 16bpp in x11vnc, whereas when using "-depth 16" with Xvnc, all transparent panels have solid color and the "alpha" option in the panel configuration is gone. This makes me think that XFCE still detects a 32bit display when using x11vnc, which may be a cause for slowness.

I also tried xserver-command=X -depth 16 in /etc/lightdm/lightdm.conf, but didn't make any difference.


I did:

apt-get install vnc4server
vncserver :1 -depth 16 -geometry 1280x800

This starts a new X session, depending on what I have in ~/.vnc/startup, which is:

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# x-window-manager &
startxfce4 &

There is no wireframe by default. Dragging windows shows the full window, not just a border, and it's still visibly faster than x11vnc which is showing only a wire frame when dragging windows! Same goes if I replace vnc4server with tightvncserver.

Any clues on how to make x11vnc just as fast? It must be capable somehow!

I tried all sort of options to x11vnc (from all thos -nox* -nowireframe, etc) to no avail.

Alternatively, I could stop LightDM and start Xvnc with the ~/.vnc/xstartup so that it starts the same Xubuntu session as it does from LilghtDM login screen, rather than XFCE4 session ... but I don't know how. I did replace startxfce4 with /etc/X11/Xsession but it does not look the same. The fonts are smaller and there are artefacts.

Any help would be appreciated!

share|improve this question

migrated from Dec 13 '13 at 6:45

This question came from our site for professional and enthusiast programmers.

Your choice of X server (normal X, Xvnc) shouldn't dictate what software you run. You ought to be able to get LightDM to use Xvnc as its X server, unless it's stupidly hardcoded to use only "X". Note that you can only run a couple of instances of normal X, but infinite Xvncs, so it's better to work out how to get Xvnc working. – Nicholas Wilson Nov 30 '13 at 9:01
Disclaimer: I work for, but have you considered using our free version of Xvnc? Or our free version of x11vnc (we call it vncserver-x11)? Worth seeing if our packages are any easier to set up, or faster. Having said that though, LightDM might be a total pain to configure (I use gdm and wouldn't know), so it could be our software isn't any easier for you on that front. – Nicholas Wilson Nov 30 '13 at 9:03
Thanks for replying. It doesn't dictate, really. Making Xvnc the X server for LightDM might be an option, I haven't thought of that. X is not hardcoded in lightdm, as it supports the option xserver-command=X -depth 16 which can be set to anything. However, I think the host would want access to the vm as well via normal X. I shall try though. ALso, LightDM does support VNC natively via a [VNCServer] group in its .conf file, which will start Xvnc whenever someone connects to 5901. This is fast, but the whole session dies and kills all apps if my VNC connection dies, so that's not ideal. – Normadize Dec 1 '13 at 3:00
I tried vncserver-11 and couldn't quite managed. Keeps saying 'unable to open display'. I start LightDM normally, which starts X on :0 and then I tried "vncserver-11 --display=:0" or --display=0. The docs say to start vncserver-x11 while in X, but the machine is headless (I'm on ssh). I also tried "vncserver-x11-serviced" which seems to work but asks for a password upon connection which I don't know and is not the one set in /root/.vnc/passwd. Also, all options I place in /etc/vnc/config.d/vncserver-x11-serviced seem to be ignored (I added "-SecurityTypes None"). Any clues? I'm giving up... – Normadize Dec 1 '13 at 5:41
Run two lightdms then-if it supports multiseat? To run vncserver-x11 or any X app you probably need to copy the XAUTHORITY variable from the console session. As for the serviced, if you have an Enterprise trial it'll be prompting for your system password (only root has access initially), otherwise you'll need to run "vncpasswd /root/.vnc/config.d/vncserver-x11" to set a VNC password. You set the security types for the daemon in /root/.vnc/config.d/vncserver-x11 too with an = to separate. Hope that helps, sorry for the frustration. – Nicholas Wilson Dec 1 '13 at 8:45

I managed to answer the Alternative part of my question, i.e. use vnc4server or tightvncserver to start a Xubuntu session instead of a plain XFCE session. This is separate from LightDM, which can then be stopped or put on manual. I'll investigate Nicholas's suggestions later.

This is equivalent to logging in via LightDM with a Xubuntu session, it remains alive if my vnc connection dies or I disconnect, and I get to enjoy the Xubuntu customizations.

To do that, make ~/.vnc/xstartup contain just the following:

export XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
export XDG_DATA_DIRS=/usr/share/xubuntu:/usr/local/share/:/usr/share/:/usr/share
vncconfig -iconic &
. lightdm-session

You can replace . lightdm-session with exec startxfce4 or startxfce4 &. The former is really what LightDM calls, but it calls xfce4-session in the end.

This then starts a Xubuntu session, rather than a plain XFCE one, and you can stop LightDM altogether if X/keyboard access is not needed.

You can configure a daemon by placing the following in /etc/init/vncserver.conf:

start on runlevel [2345]
stop on runlevel [016]
post-start script
        su USER -c "vncserver :1 -geometry 1280x800 -depth 16 -localhost -SecurityTypes None"
end script
post-stop script
        su USER -c "vncserver -kill :1"
end script

Then start/stop it with start vncserver. The above is for vnc4server and will start Xvnc listening only on and will not require a password. This is handy for me as I use an ssh tunnel anyway:


If you use tightvncserver, then delete the option -SecurityTypes None as it doesn't understand it. Note that tightvncserver always asks for a password (you can't make it passwordless).

NOTE: if USER above is not root, or if you run "vncserver :1 [options]" as non-root, then inside XFCE there will be issues sudo-ing into GUI apps because the underlying sudo-ed app will not find an X display. I haven';t yet found a fix for this. With x11vnc it works because x11vnc connects to an existing X session, including the :0 one.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.