VNC

From linux-sunxi.org
Jump to: navigation, search

Remote administration using VNC from boot with Linaro

In this page we see how to use setup our Linux bootable image so that it is automatically accessible remotely through VNC from the login-screen. The following instructions have been tested with Ubuntu/Linaro. Other GNU/Linux distributions may require modifications.

  • Run the commands
sudo apt-get update
sudo apt-get install lightdm-gtk-greeter x11vnc
sudo x11vnc -storepasswd /etc/x11vnc.pass

The first command will update the package list (requires Internet connection) and the second command installs two packages. The third command creates a password for VNC.

  • Then, edit /etc/lightdm/lightdm.conf with
sudo nano /etc/lightdm/lightdm.conf


  • and adjust as follows to disable autologin / enable login screen for VNC
[SeatDefaults]
greeter-session=lightdm-gtk-greeter
user-session=Lubuntu
#autologin-user=linaro
  • Note, that you can select whether you want to enable autologin. The above example disables autologin to get the login-session-start event for VNC. To enable, remove the comment # character from the start of the line. But Re-enabling autologin will prevent VNC from launching automatic.
  • Now create a new file with
sudo nano /etc/init/x11vnc.conf
  • and add the following content:
start on login-session-start
script
/usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log
end script
  • Save and exit. Then, you can start vnc by typing:
start x11vnc

Note that x11vnc will be automatically started after each boot until you remove this /etc/init/x11vnc.conf script.

You should then be able to login with any VNC-viewer (like remmina, vncviewer, etc… in Ubuntu) with your given password @ port 5900 and can login with any user available.

(Thanks to Martin Wild for the above instructions)