Most of the time, I’m using SSH to connect remotely with the Raspberry Pi. If you are more accustomed to a GUI, you can use VNC for remote access via the network. With VNC, you can access your Raspberry Pi’s GUI screen from a laptop or desktop computer using the same mouse, keyboard, and display of your own computer. Here’s the steps you need to do to setup a working VNC server/client to access your Raspberry Pi remotely. This is an tutorial done on Raspbian OS.
Step One: Download VNC Viewer on Your Windows or Mac Computer
You have a lot of different options for VNC software, but we’ve found that VNC Viewer is the easiest to use that works well with the Raspberry Pi.
From your PC or Mac (and iPhone or Android, for that matter), head to RealVNC’s VNC Viewer, click the Download button for your operating system, then download the free application.
Step Two: Start VNC Server Using SSH or Terminal
VNC Server is included with the newest version of Raspbian, PIXEL, so all we need to do here is start up a server.
SSH allows you to control your Raspberry Pi using the command line from any computer. You’ll need to do this to start the VNC Server for the first time.
Login to your Raspberry Pi via SSH so that you can start up the VNC Server that comes packed with your Pi.
In the command line prompt, type in vncserver
and press Enter.
This runs a command and starts the VNC server on the Raspberry Pi.
At the end of the command you’ll see a note similar to the one in the image above that says,
“New desktop is raspberrypi:1”
followed by a number that includes the Pi’s IP address, like
(192.168.0.19:1)
Make a note of this number, you’ll need it to log into the VNC server from your PC.
Now that the VNC server is running, you can log into it from your other computer.
Step Three: Log Into VNC Server from Your PC
From your PC or Mac, double-click the VNC Viewer application you downloaded in the first step.
In the VNC Server box, type in the number you made a note of in the previous step, like 192.168.0.19:1, then click Connect.
Enter pi for username and raspberry for password and click OK. (Or use your own username/password if you created a custom account on Raspbian)
Within a few seconds, VNC Viewer should display your Raspberry Pi’s desktop environment. You can now control your Raspberry Pi just as if you were sitting right in front of it and using a keyboard, mouse, and monitor connected to the actual Pi.
Step Four: Set VNC to Start Automatically
Unless you want to go through the process outlined in step two every time you want to use your Raspberry Pi, you’ll want to set the VNC Server to run automatically at boot. This is very easy to do.
In the Raspberry Pi’s desktop environment, click the Terminal icon to open up your command line.
Type in sudo raspi-config
and press Enter.
Use the arrow keys to scroll down to Advanced Options and press Enter.
Scroll down to VNC Server and press Enter.
Select Yes and press Enter.
That’s it, now the VNC Server should start automatically on boot. Once VNC is set up, you can use your Raspberry Pi just like a second computer no matter where it’s plugged in.
– masterkenneth