User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Auto startup tightvncserver?

Sun Aug 26, 2012 11:40 am

Hello,

2012-08-16-wheezy-raspbian

I've got tightvnc server/viewer running between the pi and my windows machine.
I log in via PuTTY, how can I get vncserver to autorun when I log in to the pi?

Thanks



pi@mypi ~ $ vncserver :1 -geometry 1265x930 -name Win7 -depth 16 -pixelformat rgb565

New 'Win7' desktop is mypi:1

Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/mypi:1.log

pi@mypi ~ $


file contents: /home/pi/.vnc/xstartup

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1

hiveda
Posts: 7
Joined: Sat Jan 21, 2012 2:26 pm

Re: Auto startup tightvncserver?

Sun Aug 26, 2012 12:17 pm

You can find the instructions to set this up on http://elinux.org/RPi_VNC_Server

We've changed the vncboot-script to this:

Code: Select all

USER=root
HOME=/root

export USER HOME

case "$1" in
  start)
        echo "Starting TightVNC"
        #/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565
        sudo mkdir -p /tmp/.X11-unix
        sudo chmod 1777 /tmp/.X11-unix
        sudo chown root:root /tmp/.X11-unix
        su pi -c '/usr/bin/vncserver'
        ;;
  stop)
        echo "TightVNC not stopped yet, TODO"
        ;;

  *)
        echo "Usage: /etc/init.d/vncboot {start|stop}"
        exit 1
    ;;
esac

exit 0
The x11-instructions were needed to prevent error-messages after startx

User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Re: Auto startup tightvncserver?

Sun Aug 26, 2012 12:56 pm

Hello,

Thanks for the info.

Regards

Return to “Networking and servers”