The below steps gave me an auto-starting desktop-effects-tolerant vnc. I haven’t been able to fine one spot that gives a simple method to getting a working vnc on kubuntu, until now:
Make a backup of the MIT-COOKIE auth file. Having this file will allow x11vnc to run without being root, eliminating much of the configuration headaches involved.
ps wwaux | grep auth
The file will be located in:
/var/run/xauth
In my case it was: /var/run/xauth/A:0-q6mb8o – but NOTE: This name will change frequently. This is why we need to copy this out in the next step.
Create a new directory in ~/.vnc to store this file:
mkdir ~/.vnc
Copy the MIT-COOKIE file we found above to this location:
sudo cp /var/run/xauth/your_file ~/.vnc
Now install x11vnc:
sudo apt-get install x11vnc
Create a password:
x11vnc -storepasswd YOUR_PWD ~/.vnc/x11vnc.pass
Run x11vnc once:
x11vnc -forever -rfbport 5900 -rfbauth ~/.vnc/x11vnc.pass -o ~/.vnc/x11vnc.log -auth ~/.vnc/your_auth_file -noxdamage -display :0
The -auth switch points to the MIT-cookie auth file, and -noxdamage prevents Compiz from creating additional display issues. I would suggest changing the RFB or listening port to a non-standard one for security reasons.