VNC doesn't work with compiz

Solution 1:

The current VNC server in System/Preferences/Remote Desktop is called vino-server. It doesn't currently support operation when Compiz (Desktop Effects) is enabled.

To work around this, you have to use a replacement vnc server. I use x11vnc.

sudo apt-get install x11vnc

Crucially, you have to specifiy -noxdamage when you start the x11vnc server if you're intending to run Compiz.

First, initialise x11vnc with a password :

x11vnc -usepw

and follow the prompts. Then here's an example of how I run my vnc server:

x11vnc -usepw -forever -noxdamage -scale 4/5 -avahi -nolookup -q

  • avahi will mean that the server will advertise itself using avahi (multicast dns)
  • scale 4/5 will mean that a 1900x1200 screen will fit on a 1280x1024 screen.
  • nolookup means that the server won't try to lookup the client. No long pauses.
  • q will suppress some of the output to console. Or use -logfile instead.
  • noxdamage will get your compiz effects working.
  • forever just means that the server will keep running after a client disconnects.

If you do a "man x11vnc", you'll see that there's a raft of additional options. But the ones specified above should get you running.

If you need to run this on startup, I personally run this in /etc/rc.local, but I'm sure there are better ways. EDIT : And there are easier ways, detailed on this very site : How to run scripts on start up?. So, I suppose the easiest is the crontab -e option, but you could also save the command as a script somewhere, then just specify it in system/preferences/startup apps.

Solution 2:

the nodamage option works, but unless you're on a very fast network it's a bad idea - it forces everything to update all the time even if it doesn't change, which uses a huge amount of bandwidth.

Solution 3:

Correcting @Scaine's great answer, it is possible to use vino-server with compiz effects enabled.

Here is how to disable xdamage in vino, and thus make VNC work with compiz:

gsettings set org.gnome.Vino disable-xdamage true

Done!

Now you can use Ubuntu's default "Desktop Sharing" using even with Unity 3D. No need to install x11vnc

But, as others have pointed out, disabling xdamage causes huge network traffic. Not a big issue in a local network, but performance may suffer if remote controlling over the internet.

Solution 4:

If you enable desktop visual effects ( set to Extra ) with proprietary nvidia driver, vnc to the machine WORKS but the screen is frozen after you initially log in and you can't see anything ( except a frozen picture ). It works correctly with the opensource drivers ( well at least for ATI ).