The described procedure will not require a display and keyyboard and can be performed just connecting the PI to your router using a LAN cable.
Raspbian OS installation
First of all you need to download the latest Raspbian OS image from here. This procedure is tested with Raspbian Jessie with Pixel (version January 2017).
If you are running on Windows, download the Win32DiskImager utility from here and use it to flash the ISO image to the SD card. Refer to this guide for more details. If you are running on Linux or MaxOS look here.
Do not remove the SD card from the PC at the end of the process because we first need to enable SSH because, due to security reasons, SSH protocol is disabled by default in the latest versions of Raspbian OS.
To enable SSH, all you need to do is to put a file called ssh in the /boot/ directory. The contents of the file don’t matter: it can contain any text you like, or even nothing at all.
You can now insert the SD card into the Raspberry PI slot and power it on.
To avoid the need of connecting a display and keyboard, I typically just plug a LAN cable from my home router to the PI and get it's IP address from the router administrative console which typically is accessible at http://192.168.1.1/ or http://192.168.1.0/.
You can now use any SSH client like Putty to connect to the PI. The default user and passwords are pi/raspberry.
The Raspbian ISO image is not configured to use all the SD card available memory so you need to expand the filesystem to use all the available space.
Enter the raspi-config utility:
Choose option ‘1 Expand Filesystem’.
Exit raspi-config and it should ask to reboot. You can also manually reboot the Raspberry PI with this command:
Set keyboard (optional)
Run raspi-config again if needed.
Choose ‘5 Internationalisation Options’.
Set the correct timezone and keyboard layout.
I typically leave the default locale en_GB.UTF-8 UTF-8.
Running VNC server
The new Raspbian with Pixel already comes with VNC server installed so all you have to do is start it.
On the shell just type:
The last line of the output should be something like this:
New desktop is raspberrypi:1 (192.168.168.4:1)
Run the Raspberry PI Configuration application under Preferences menu. From here you can change the default password.
In the Interfaces tab you can also automatically start the VNC server at boot.
The VNC resolutin can be forced in the /boot/config.txt file. Inside the VNC remote session, open a teminal and type:
sudo leafpad /boot/config.txt
Enter the follwing settings to force a 1080p resolution (1920x1080) . See here for more details.
Reboot your Raspberry Pi
Wait for 1 or 2 minuter for the PI to restart and try connecting to the VNC server to check if it automatically starts.
If you have a RasPI 3 you can now easily configure the WiFi connection from the desktop. After having configured the WiFi, disconnect the LAN cable. Don't forget that a new IP address will be assigned.
Port Mapping (optional)
If you have installed the Raspberry PI at your house and want to access it remotely you can define port mappings on your router.
- SSH: 22 > 10022
- VNC: 5901 > 15901
- HTTP: 80 > 10080