28 Mart 2013 Perşembe

Raspbian - VNC'yi boot ile başlatmak

Start VNC Server Automatically on Bootup

There's no point in having VNC if you have goto to the Pi, login and start the server manually. So let's start it on bootup before the login prompt.
Create a new file in the init.d directory:
sudo nano /etc/init.d/tightvncserver
Enter the following details:
#!/bin/sh
# /etc/init.d/tightvncserver
VNCUSER='pi'
case "$1" in
    start)
        su $VNCUSER -c '/usr/bin/tightvncserver :1'
        echo "Starting TightVNC Server for $VNCUSER "
        ;;
    stop)
        pkill Xtightvnc
        echo "TightVNC Server stopped"
        ;;
    *)
        echo "Usage: /etc/init.d/tightvncserver {start|stop}"
        exit 1
        ;;
esac
exit 0
Give the script executable permission:
sudo chmod 755 /etc/init.d/tightvncserver
We can now start or stop the service manually:
sudo /etc/init.d/tightvncserver start
sudo /etc/init.d/tightvncserver stop
But let's make Tight VNC Server start every time the Raspberry Pi starts up:
sudo update-rc.d tightvncserver defaults
Now just power off the Raspberry Pi. Make sure it's connected to the network and power back on. You can now connected across the network using the VNC Viewer!


http://www.neil-black.co.uk/raspberry-pi-beginners-guide#.UVyuTjdvC9o

Hiç yorum yok: