Friday, February 4, 2011

Setup VNC Server for Lubuntu

Now I have radio Tray working I want to set up Lubuntu PC with no monitor, keyboard or mouse (just power lead and Cat5 network cable).
I am used to VNC for windows so wanted to continue to use that product. Have read a lot about setting up ssh tunnel - but want to keep it simple. Also the Lubuntu PC is on my local network and will not be connected from outside.

Accessible using regular vnc viewers, and through java-enabled browsers.


Open terminal window

Accessories/LXterminal  in command terminal type:



1) Install packages


sudo apt-get install x11vnc vnc-java


2) Set up password to allow clients to view


x11vnc -storepasswd


3) Open up ports 5800 and 5900 on your firewall


4) Run this command: 


x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800


At this point I realised that the connection is temporary - at reboot you loose the connection and have to restart it - so to have VNC start at boot:-


5) Add the command from 4) to your sessions, so that it starts at each login.


This is how you do 5)


Open terminal window

Accessories/LXterminal  in command terminal type:


sudo leafpad /etc/xdg/lxsession/lubuntu/autostart

sudo leafpad /etc/xdg/lxsession/Lubuntu/autostart  (note use of upper case)


You will be prompted for you user password

Autostart will open

Add at bottom of list
@x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800
Save and close. Test by rebooting - that should work

Information Sources


http://www.ubuntu-unleashed.com/2007/10/setup-vnc-server-for-ubuntu-gutsy.html

7 comments:

  1. Excellent info.

    Now, how to get x11vnc to start before the login?

    ReplyDelete
    Replies
    1. Use ssh login then execute
      sudo x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -auth guess

      Delete
    2. ---------------
      -usepw: found /home/username/.vnc/passwd
      /tmp/fd.Lrwo6g: 305: [: -a: unexpected operator
      /tmp/fd.Lrwo6g: 305: [: -a: unexpected operator
      -auth guess: failed for display='unset'
      -auth guess: since we are root, retrying wifh FD_XDM=1
      /tmp/fd.Lrwo6g: 305: [: -a: unexpected operator
      /tmp/fd.Lrwo6g: 305: [: -a: unexpected operator
      -auth guess: failed for display='unset'
      ----------------------------
      What's wrong? What I'm missing?

      Delete
  2. I have a problems with 2) "bash: x11vnc: command not found"

    ReplyDelete
  3. Waking up an old thread but though I would help the next guy out if they stumble on this thread and it does not work after reboot as it did with me using 17.10

    I had to change "sudo leafpad /etc/xdg/lxsession/Lubuntu/autostart" to "sudo leafpad ~/.config/lxsession/Lubuntu/autostart"

    This only works for the logged in session however, but that met my needs. The other method would not work at all.

    ReplyDelete