How to avoid ugly dithering when running KDE over VNC?

5

I'm currently setting up a new Xen paravirt domain running KDE (4.2.2, from Kubuntu 9.04). As I have been unable to get the virtual framebuffer working in it, I've decided to set up VNC (from the vnc4server package), and run KDE over Xvnc.

This is all fine and good, and KDE starts up okay. However, all the colours look dithered, especially on the task bar and title bar, making them impossible to see. From my web searches, it appears to be because these items are drawn using Porter-Duff. This is especially the case when using the Oxygen style, and Oxygen and Ozone window titlebars (selecting these styles generates messages about Porter-Duff being unavailable); not using those styles at least makes most of the UI widgets and window titles usable again.

But this doesn't solve the problem for the task bar, nor for the desktop, where the only theme available to me is Oxygen (this is under the "Desktop Settings - Plasma Workspace" window, just for reference). So, unless I have a way to use a non-Porter-Duff theme for those, it seems that KDE would still be unusable under VNC.

So if someone experienced with KDE can advise on how to work around, or even fix, these issues, I'd appreciate it very much. :-)

Chris Jester-Young

Posted 2009-08-19T13:18:52.443

Reputation: 2 116

Answers

1

I had success switching my VNC server from the default vncserver to http://xf4vnc.sourceforge.net/. This appears to be more stable and prevents the ugly dithering effect on the window decorations. I'm on Ubuntu 10.04

Jason R. Surratt

Posted 2009-08-19T13:18:52.443

Reputation: 11

1

Why don't you use remote xdmcp?

Kimvais

Posted 2009-08-19T13:18:52.443

Reputation: 3 809

XDMCP is just a control protocol, it still requires an X server to be running on both ends. This doesn't really answer the question, VNC connections start X sessions when connecting and suspend them afterwards which is ideal in a server type situation where resources are valuable. – Justin Buser – 2012-05-07T20:31:27.040

1Well, that also can have its rendering issues, like if fonts are missing? Of course, one can set up the font server to get fonts over over the wire as well (Google xfs and xset +fp tcp/your-kde-machine:7100). And when controlled using a different keyboard (like from a Mac) then one might need to solve keyboard issues as well, especially when using Xnest or Xephyr (Google xmodmap, or use xev for debugging). I am not sure about speed: it can be very fast, but others say it needs a lot of bandwidth. – Arjan – 2009-10-02T08:15:51.657

Yes, that's a good question. I might try that and see if it helps the situation, although VNC has other benefits, like not having to lose your session when your thin-client machine is being rebooted, much like using screen for console stuff. – Chris Jester-Young – 2009-10-27T18:34:25.677

0

I was playing with this today (on Kubuntu 10.04), but I eventually gave up and went with XFCE4 for VNC connections, and KDE for a local display.

Install the package xfce4 and edit ~/.vnc/xstartup/ to look like this:

#!/bin/sh

unset SESSION_MANAGER
. /etc/X11/xinit/xinitrc

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

startxfce4 &

Jonathan

Posted 2009-08-19T13:18:52.443

Reputation: 153

Actually that will essentially try to create two separate X sessions, take a look at the xinitrc script and you'll see what I mean. – Justin Buser – 2012-05-06T05:59:56.507

0

I noticed what you are describing as well and found that the best way to get rid of it is to choose window decorations etc... that don't use gradients. Ultimately however what I ended up doing is adding a network display as a greeter to /etc/kde4/kdm/kdmrc and then running XMing locally. Basically as soon as it detects the networked display KDM will send the greeter to it, then you just login and it's just like having an external monitor, it even supports OpenGL. I can barely tell the difference but I haven't tried any intensive rendering or anything.

Update

I just had a few moments to run a VNC Server again to try to jog my memory a bit and it seems like the problem is actually much worse than it used to be. Pretty much every variation of setting/bit depth/etc... I could think of still resulted in close to 100% CPU usage for plasma-desktop.

Do yourself a favor and at least give this a shot, you won't be dissapointed (this is what my typical load looks like: https://plus.google.com/u/0/114408677443179637705/posts/Q7BGvYF2fx6 )

Install XMing: http://www.straightrunning.com/XmingNotes/

Launch it from a command prompt:

Xming.exe :10 -rootless -nomultimonitors -clipboard -wgl -nolisten inet6 -ac -screen 0 @2

the @2 denotes my second display, if you only have one or want to use the 1st one just change it to @1.

temporarily disable kdm by adding the following line somewhere near the top before the line that begins with start on:

DISABLED=1

reboot your Linux machine and when it comes back up ssh into it (you don't need to turn on X11 forwarding or anything) and run the following two commands (replace 10.0.0.2 with the ip of the machine you are connecting from):

export DISPLAY="10.0.0.2:10"
dbus-launch kdeinit4 kwin +plasma-desktop

After a few seconds you should see your kde desktop appear, you can switch between the two at will, copy paste between them, etc... and it runs exponentially faster than the VNCServer version.

Justin Buser

Posted 2009-08-19T13:18:52.443

Reputation: 1 147

BTW, forgot to mention, DO NOT DO THIS ON A PUBLIC NETWORK! The -ac option in the Xming command line essentially disables access control to your XServer which isn't a big deal if your on a private network but obviously wouldn't be ideal otherwise. – Justin Buser – 2012-05-06T09:45:47.753

0

Dithering generally occurs when a color palette of higher depth must be displayed using a color palette of lower depth. For example, rendering a 24-bit color palette (2^24=16M colors) in a 16-bit display (2^16=64K colors) or a 16-bit color palette in a 8-bit display (2^8=256 colors)

Just a shot in the dark, but vncserver has a -depth flag you can specify to change the color depth of the server to match your desired client display settings. I assume vnc4server has a similar flag? It defaults to 16-bit, so I'm wondering if you run your VNC server under 24-bit depth if that would prevent the dithering.

I'm not sure of the performance implications or whether that even matters to you.

There may be other ways to solve your problem, but this is the first thing that comes to mind.

Joe Holloway

Posted 2009-08-19T13:18:52.443

Reputation: 250

you can check the vnc server's logfile to see what depth it was running at. the location depends on how it was run; check in /var/log or in ~/.vnc first. – quack quixote – 2009-10-09T02:38:21.490

I always run Xvnc at 24 bits, so this isn't the problem. There is no alpha-blending capability with Xvnc though (that I'm aware of), so that's where the dithering comes in (if I understand correctly as to the function of Porter-Duff). – Chris Jester-Young – 2009-10-27T18:30:19.380