24 June 2020

Raspberry Pi SSH and VNC Server

Hello Everyone,
As part of a netbooting Pi project I needed to image a freshly configured install, but encountered this screen with connecting to the VNC server:
Normally, this should be a quick fix, a bit of searching et voila!  However, this was not the case and there are many posts about resolving this, and I followed the instructions in a couple, but none resolved this issue, so that is why this post exists: concise instructions.  I remember thinking at the time when last did this that it was fiddly and that I should keep some notes about how to set this up, but I didn't, so I'm doing it now.

The Process 

After imaging a new SD card create a file "ssh", without the quotes - no dot or file suffix, in the root/top directory.  This enables the SSH service on boot.  Transfer the SD card, connect up the wired ethernet and apply power.  I use PuTTY to SSH into the RPi either use the IP or hostname "raspberrypi" and use the default username "pi" and password "raspberry".

Edit the config.txt file in the boot directory: sudo nano /boot/config.txt
Uncomment the hdmi_force_hotplug=1, by deleting the preceding hash symbol.
Ctrl+x to exit
Press y and enter to confirm saving of the file.

Run the configuration tool: sudo raspi-config

Select 3 Boot Options
Select B1 Desktop / CLI
Select B3 Desktop, to enable booting to the desktop and provide graphics for the VNC Server to display.

Select 5 Interfacing Options
Select P3 VNC
then Yes to enable VNC Server

Select Finish and then Yes to reboot.

You should now be able to connect to the Pi with a VNC Viewer. Enjoy.

No comments:

Post a Comment