Ubuntu – How to setup x11vnc to access with graphical login screen

servervnc

I have a server running Ubuntu 12.10 and need to be able to remote to this server without being logged-in.

I have found many solutions, but none seem to work with 12.10.

Can anyone give me step-by-step instructions on how to configure x11vnc to start as a service (prior to user login) so that when connecting with VNC I will be presented with a graphical login screen?

I'm new to Linux so please give as much detail as possible in your responses/comments.

Thanks

Best Answer

  • The above answers solve the problem, though a couple of amendments for versions of Ubuntu with systemd (15.04+), as follows:

    • Take advantage of new -auth guess functionality in x11vnc - which helps!
    • Update for systemd (not upstart)

    Run the following to install:

    sudo apt-get install x11vnc
    sudo x11vnc -storepasswd yourVNCpasswordHERE /etc/x11vnc.pass
    # for Ubuntu 15.04+
    sudo nano /lib/systemd/system/x11vnc.service
    # for Ubuntu 16.10+
    sudo nano /etc/systemd/system/x11vnc.service
    

    Insert this into the file:

    [Unit]
    Description="x11vnc"
    Requires=display-manager.service
    After=display-manager.service
    
    [Service]
    ExecStart=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth guess -rfbauth /etc/x11vnc.pass
    ExecStop=/usr/bin/killall x11vnc
    Restart=on-failure
    Restart-sec=2
    
    [Install]
    WantedBy=multi-user.target
    

    Then, start with:

    sudo systemctl daemon-reload
    sudo systemctl start x11vnc
    

    And ensure the service starts on boot:

    sudo systemctl enable x11vnc
    
  • Related Question