I need to access a remote xenial machine with x11vnc sudo apt-get install lightdm x11vnc installed the necessary parts. Then, I created a password with

sudo x11vnc -storepasswd yourVNCpasswordHERE /etc/x11vnc.pass

and than I ran

sudo /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5901 -o /var/log/x11vnc/x11vnc.log

Now, when I connect to the remote machine (from a Mac, with Connect to server via


I get a login in screen with the user names on this machine, but I always get the error

Failed to start session

How can I make this work

  • I'm sure you have tried but have you just typed in the user/password of the machine you are trying to connect too... ignoring the local machines user names. Sorry don't know how Mac's handle it .. not sure if you have the ability to type or if it just shows names on a list so forgive me if this answer doesn't make sense – John Orion May 4 '16 at 23:49
  • I am connecting to the machine via ssh, and get the login screen of the remote machine I can select me as the user (this is the entry on the remote machine) and then enter my password. It looks like unity is not able to start an x server for the remote connection. – Erich Neuwirth May 6 '16 at 11:51
  • Do you get the same error when physically present in front of the machine? x11vnc should not impact what happens on the :0 screen-- just mirrors it. – aap May 6 '16 at 13:25
  • My machine does not have a physical screen. It runs in a VM on a server run by my department. I made some progress. x11vnc -create -many -auth guess -rfbauth ~/.vnc/passwd allows me to connect to an X session. But It does not start lightdm. I will hang on trying to resolve the issue. – Erich Neuwirth May 7 '16 at 10:53
  • As described, with x11vnc -create -many -auth guess -rfbauth ~/.vnc/passwd I can connect from my client machine, I even can start lightdm wih sudo lightdm, but I cannot see or access the lightdm desktop yet. – Erich Neuwirth May 8 '16 at 7:35

Problem solved. It turned out that Ubuntu desktop was not installed. So I did

sudo apt-get install ubuntu-desktop

Additionally, I changed a line in



# ExecStart=/usr/bin/x11vnc  -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth guess -rfbauth /etc/x11vnc.pass
ExecStart=/usr/bin/x11vnc  -create -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -rfbauth /etc/x11vnc.pass -rfbport 5905

After this change, I was able to connect via VNC (from my Mac)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.