Hardware platform: Raspberry Pi 2, Model B, 1GB RAM
Image version: 2015-11-21-raspbian-jessie.img
Introduction: First, you need to install and start the VNC service on the Raspberry Pi, and then connect through the VNC client.
You need to use the command line to install VNC on the Raspberry Pi. If you need remote operation to install VNC, you must login to the command line interface via SSH (the default username for Raspbian is: pi, the default password is: Raspberry).
installation
Command Line Input:
sudo apt-get install Tightvncserver
1 1
After installation, be sure to set up a VNC password with this command first:
vncpasswd
1 1
(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
To set up boot, you need to create a file in/etc/init.d/. For example Tightvncserver:
(Note: The name of the startup script has a habit consistent with the program name)
sudo vi/etc/init.d/tightvncserver
1 1
The contents are as follows:
#!/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 under< C17/>export user= ' pi '
# # # END Customization Required
eval CD ~ $USER case
"$" in
start)
# Start the 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)
# terminates the 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
;;
Esac
Exit 0
(Note: The value of the user variable is the default user name, this is pi.) )
Then add the Execute permission to the Tightvncserver file:
sudo chmod 755/etc/init.d/tightvncserver
and update the boot-up list:
sudo update-rc.d tightvncserver defaults
Restart Raspberry Pi:
sudo shutdown-r now
Manual Start
Of course, you can also manually start the VNC server program, using the following command:
Tightvncserver-geometry 800x600:1
If you start the first time and you never set a password using the VNCPASSWD command, the program asks for a password. Boot is convenient, so it is recommended to start the boot.
Command parameter Description:
One,: 1, specify the number of the console.
Launching multiple consoles can provide multiple desktop environments that do not affect each other. Without this parameter, Tightvncserver will automatically look for the next idle console starting from 1. With this parameter, the specified console is enforced, and an error is made if this console is already started. Adding this parameter effectively prevents inadvertent startup of the program (which starts multiple consoles) and wastes system resources in vain.
The Special No. No. 0 Console--0 console is the one that connects real-world displays of images. For the VNC client, do not enter the port number login, the default is to login to the No. 0 console, convenient. But because number No. 0 is a real desktop, there is a conflict with the boot-up desktop environment. So in the auto-initiated configuration tutorial, use the number 1th console.
Second,-geometry 800x600, resolution. Can not add.
To terminate the VNC console:
Tightvncserver-kill:1
1 1
VNC Client Login
Download vnc-viewer:http://www.realvnc.com/download/viewer/
Login address Enter "IP Address: Console number", number No. 0 can not be added to the console.