Results 1 to 3 of 3

Thread: Headless VNC

Threaded View

  1. #2
    Join Date
    Jul 2005
    Location
    Pennsylvania (USA)
    Beans
    110
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Headless VNC

    Here's how I would do it:

    1. Tell GDM not to start when automatically when the machine starts:
    Code:
    $ sudo update-rc.d -f gdm remove
    2. Install Fluxbox and tightvncserver
    Code:
    $ sudo apt-get install fluxbox tightvncserver
    3. Create a VNC password for your account
    Code:
    $ vncpasswd
    
    Using password file /home/<username>/.vnc/passwd
    Password: 
    Verify:
    Would you like to enter a view-only password (y/n)? n
    4. Create the file ~/.vnc/xstartup with the following config:
    Code:
    #!/bin/sh
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    fluxbox &
    5. Make ~/.vnc/xstartup executable:
    Code:
    $ chmod +x ~/.vnc/xstartup
    6. Use /etc/rc.local to start the VNC session whenever the machine boots. You can specify the display to use, I usually use something unusual like 20. Mine looks like this:
    Code:
    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    su myusername -c "tightvncserver :20"
    
    exit 0
    7. Reboot. After the machine comes up, you should be able to access the VNC session with:
    Code:
    $ vncviewer your.machine.ip:20
    8. To make it all happen via SSH, install SSH:
    Code:
    $ sudo apt-get install ssh
    Then connect to the VNC session via an SSH tunnel like this:
    Code:
    vncviewer machine.ip.address:20 -via machine.ip.address
    That should prompt you for your SSH password, then show you your VNC session, then ask for your VNC password. Your SSH port (default is 22) is the only port that would need to be accessible in this scenario.
    Last edited by sizzam; August 3rd, 2008 at 01:40 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •