0

I have gone down a rabbit hole with all of the different ways to do this. I think I am almost there but something in my auto start is not correct.

Currently via SSH I can get VNC running with this command:

x11vnc -rfbauth /home/username/.vnc/passwd

It calls a stored password and this is working fine.

I have created a x11vnc.conf file in /etc/init/

For simplicity sake, I only have the following in this file:

exec /usr/bin/x11vnc -rfbauth /home/username/.vnc/passwd

However it doesn't start on bootup.

Any help is appreciated, I'm not very literate with ubuntu.

1 Answers1

1

Do the following:

  1. Validate your UID

     $ id
    

    it will return your uid=xxxx. In my case it is 1000.

     $ id
     uid=1000(ubuntu) gid=................
    

    Keep this number handy for the following

  2. Modify the x11vnc.service file

     $ sudo vi /lib/systemd/system/x11vnc.service
    

    and add the following:

     [Unit]
     Description=Start x11vnc at startup.
     After=multi-user.target
     [Service]
     Type=simple
     ExecStart=/usr/bin/x11vnc -loop -forever -bg -rfbport 5900 -xkb -noxrecord -noxfixes -noxdamage -shared -norc -auth /run/user/**UID**/gdm/Xauthority -rfbauth /etc/x11vnc.pass
     [Install] 
     WantedBy=multi-user.target
    

    Save your file, and remember to change the UID with your uid number.

  3. Enable as a service:

     $ sudo systemctl enable x11vnc.service
     $ sudo systemctl daemon-reload
     $ sudo systemctl start x11vnc.service
    

That's it !!!

Now reboot and try. Remember that you have to login in order to connect to VNC, otherwise (for security) you will not be able to login.

Also, have in mind that there are other alternatives to VNC, such as TeamViewer or AnyDesktop.

zx485
  • 2,426