Raspberry Pi Command line:
sudo apt-get install Tightvncserver
After installation, be sure to set up a VNC password with this command first:
vncpasswd
(Enter the operation password two times, then ask whether to set a view (view-only) password, as you like, generally not necessary. )
set boot up:
You need to create a file in/etc/init.d/. For example Tightvncserver (note: The name of the startup script, which has the same habit as the program name).
sudo nano/etc/init.d/tightvncserver
The contents are as follows: (right-click = paste in Putty window)
#!/bin/sh### begin init info# provides: tightvncserver# Required-Start: $local _fs# required-stop: $local _fs# default-start: 2 3 4 5# default-stop: 0 1 6# short-description: start/ stop tightvncserver### end init info # more details see:# http:// Www.penguintutor.com/linux/tightvnc ### Customize this entry# Set the USER variable to the name of the user to start tightvncserver underexport user= ' pi ' ### end customization required eval cd ~ $USER case "$" in start # start command line. Customize the resolution, console number, or other parameters here. su $USer -c '/usr/bin/tightvncserver -depth 16 -geometry 800x600 :1 ' echo "starting tightvnc server for $USER " ;; stop) # terminate command line. Here the console number is consistent with the start. su $USER -c '/usr/bin/tightvncserver -kill :1 ' echo "tightvncserver stopped" ;; *) echo "Usage: /etc/init.d/tightvncserver {start|stop}" exit 1 ;; Esacexit 0
Note: For a few players the default user is not pi, please change the user variable yourself.
Press Ctrl+x to answer Y (save) to exit the Nano editor.
Then give the Tightvncserver file plus execute permissions and update the boot list.
sudo chmod 755/etc/init.d/tightvncserversudo update-rc.d tightvncserver Defaults
Access on Mac, first install VNC, and then specify the address when connecting: vnc://192.168.1.123.
Play the Raspberry Pi-raspberry, install VNC Remote Desktop Services