Home / Linux Admin /

Setting up VNC on Linux

X11 VNC (recommended)

  1. Update
  2. Install server
  3. Start server for one session
  4. Possible arguments

XTightVNC (not recommended)

Single Use Scenario

  1. Do the usual
  2. Install tightVNC server
  3. Do a first run on the vnc server
  4. Run the server:

Start at boot

  1. Create a file at /etc/init.d/
  2. Paste in the following text:

    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides: vncboot
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start VNC Server at boot time
    # Description: Start VNC Server at boot time.
    ### END INIT INFO
    
    USER=root
    HOME=/root
    
    export USER HOME
    
    case "$1" in
    start)
    echo "Starting VNC Server"
    #Insert your favoured settings for a VNC session
    /usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565
    ;;
    
    stop)
    echo "Stopping VNC Server"
    /usr/bin/vncserver -kill :0
    ;;
    
    *)
    echo "Usage: /etc/init.d/vncboot {start|stop}"
    exit 1
    ;;
    esac
    
    exit 0
  3. Save and exit (Ctrl-o and Ctrl-x)
  4. Set permissions
  5. Do this thing
  6. reboot and connect!

this document last modified: July 07 2018 02:00

Home / Linux Admin /