VNC over lightdm results in blank screen

I'm trying to set up VNC over lightdm so multiple users may log in to the server and have their own session each. I'm using TightVNC Viewer from a Windows machine to connect to the Ubuntu virtual machine (VMware on a server). The unity greeter is shown, I can enter my credentials, but then the desktop would just not load, all I get is a blank screen with a wallpaper. I also tried the lightdm-gtk-greeter, with the same result.

Here's my /etc/lightdm/lightdm.conf:

[SeatDefaults]
allow-guest=false
greeter-hide-users=true
greeter-show-manual-login=true
autologin-guest=false
# More sessions at /usr/share/xsessions/
user-session=gnome-fallback
# More greeters at /usr/share/xgreeters/
# greeter-session=lightdm-gtk-greeter
greeter-session=unity-greeter
[XDMCPServer]
enabled=true
port=177
[VNCServer]
enabled=true
command=/usr/bin/Xvnc -rfbauth /etc/vncpasswd
port=5900
width=1280
height=1024
depth=24

Note the user-session: I'm trying to log into a gnome-fallback session. The unity-greeter indeed has Gnome preselected. I tried the other entries as well (e.g. Gnome Classic), with the same result.

Errors are logged in ~/.xsession-errors:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0x5
  Serial number of failed request:  6
  Current serial number in output stream:  8
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0x5
  Serial number of failed request:  6
  Current serial number in output stream:  8
Script for ibus started at run_im.
Script for auto started at run_im.
Script for default started at run_im.
init: gpg-agent post-stop process (4335) killed by TERM signal
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd main process ended, respawning
init: at-spi2-registryd respawning too fast, stopped
init: unity-settings-daemon main process (4382) terminated with status 1
init: unity-settings-daemon main process ended, respawning
init: gnome-session (Unity) main process (4391) terminated with status 1
init: unity-settings-daemon main process (4573) killed by TERM signal
init: Disconnected from notified D-Bus bus

Messages in /var/log/lightdm/lightdm.log immediately after entering the credentials in the greeter:

[+971.31s] DEBUG: Session pid=5164: Continue authentication
[+971.92s] DEBUG: Session pid=5220: Authentication complete with return value 0: Success
[+971.92s] DEBUG: Session pid=5164: Authenticate result for user pamberg: Success
[+971.92s] DEBUG: Session pid=5164: User pamberg authorized
[+971.93s] DEBUG: Session pid=5164: Greeter requests default session
[+971.93s] DEBUG: Seat: Stopping greeter; display server will be re-used for user session
[+971.93s] DEBUG: Session pid=5164: Sending SIGTERM
[+971.95s] DEBUG: Session pid=5164: Exited with return value 0
[+971.95s] DEBUG: Seat: Session stopped
[+971.95s] DEBUG: Seat: Greeter stopped, running session
[+971.95s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0
[+971.99s] DEBUG: Session pid=5220: Not setting XDG_VTNR
[+972.00s] DEBUG: Session pid=5220: Running command /usr/sbin/lightdm-session /usr/lib/gnome-panel/gnome-session-flashback
[+972.00s] DEBUG: Creating shared data directory /var/lib/lightdm-data/pamberg
[+972.00s] DEBUG: Session pid=5220: Logging to .xsession-errors
[+972.08s] DEBUG: Activating login1 session c13
[+972.12s] WARNING: Error activating login1 session: GDBus.Error:org.freedesktop.DBus.Error.Failed: Operation not supported

Any ideas?


Sounds like this issue: https://bugs.launchpad.net/lightdm/+bug/1420558. In short, LightDM's AppArmor policy isn't (as of Ubuntu 14.04.2 LTS) taking VNC into account.

Try removing /etc/apparmor.d/lightdm-guest-session.