Thursday, March 22, 2012

Another way to use VNC with Ubuntu

Ubuntu versions 11.10 and 12.04 use LightDM as a login manager. This breaks older methods of using x11vnc as a way to remote into the Linux box. I found one way of fixing this, but I still prefer using xinetd to handle this. Modifying what I found before, with what I have been already using, I have a desirable solution...

1. sudo apt-get install xinetd x11vnc
2. Create a file, /etc/xinetd.d/x11vnc , with the following content...

service x11vnc
  type = UNLISTED
  disable = no
  socket_type = stream
  protocol = tcp
  wait = no
  user = root
  server = /usr/bin/x11vnc
  server_args = -inetd -o /var/log/x11vnc.log -display :0 -forever -bg -rfbauth /etc/vncpasswd -shared -enablehttpproxy -forever -nolookup -auth /var/run/lightdm/root/:0   
  port = 5900
    flags = IPv6

3. sudo chmod a+x /etc/xinetd.d/x11vnc
4. sudo x11vnc -storepasswd (VNC password) /etc/vncpasswd
5. Reboot

If you're using any firewall functionality in Ubuntu, be sure to permit TCP port 5900.