Friday, August 18, 2017

vnc - x11vnc much slower than Xvnc + how to get a Xubuntu session manually

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).


x11vnc


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


start on login-session-start
script
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"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 31.5-48.5
VertRefresh 50-70
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1280x800"
EndSubSection
EndSection

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


30/11/2013 07:12:32 Pixel format for client 127.0.0.1:
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.


Xvnc


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:


#!/bin/sh
[ -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!

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...