Install tightvncserver
sudo apt-get install tightvncserver -y
Launch VNC at the first time and enter password
tightvncserver
Create a service file
sudo nano /etc/init.d/tightvnc
Paste the content
#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start vnc server
# Description:
### END INIT INFO
case "$1" in
start)
su pi -c 'vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565:'
echo "VNC Started"
;;
stop)
pkill Xtightvnc
echo "VNC Terminated"
;;
*)
echo "Usage: /etc/init.d/tightvnc {start|stop}"
exit 1
;;
esac
Press ctrl+x to exit, press y to select overwrite option and press enter to acceptSet service executable
sudo chmod 755 /etc/init.d/tightvnc
Recheck which service needed to launch at startup
sudo update-rc.d tightvnc defaults
Reboot the computer to test
sudo reboot
To connect yoru pi use ip address plus :1
https://www.howtogeek.com/141157/how-to-configure-your-raspberry-pi-for-remote-shell-desktop-and-file-transfer/2/
No comments:
Post a Comment