In your RealVNC® account online, assign permissions on the Computers page to restrict discovery appropriately. Install VNC® Connect in a secure location (such as C: Program Files ), and turn on update notifications. Upgrade to 256-bit AES session encryption. Turn off direct connectivity.
This page describes the console based raspi-config application. If you are using the Raspberry Pi desktop then you can use the graphical Raspberry Pi Configuration application from the Preferences menu to configure your Raspberry Pi.
raspi-config
is the Raspberry Pi configuration tool originally written by Alex Bradbury. It targets Raspbian.Usage
You will be shown
raspi-config
on first booting into Raspbian. To open the configuration tool after this, simply run the following from the command line:The
sudo
is required because you will be changing files that you do not own as the pi
user.You should see a blue screen with options in a grey box in the centre, like so:
It has the following options available:
Moving around the menu
Use the
up
and down
arrow keys to move the highlighted selection between the options available. Pressing the right
arrow key will jump out of the Options menu and take you to the <Select>
and <Finish>
buttons. Pressing left
will take you back to the options. Alternatively, you can use the Tab
key to switch between these.Note that in long lists of option values (like the list of timezone cities), you can also type a letter to skip to that section of the list. For example, entering
L
will skip you to Lisbon, just two options away from London, to save you scrolling all the way through the alphabet.What raspi-config does
Generally speaking,
raspi-config
aims to provide the functionality to make the most common configuration changes. This may result in automated edits to /boot/config.txt
and various standard Linux configuration files. Some options require a reboot to take effect. If you changed any of those, raspi-config
will ask if you wish to reboot now when you select the <Finish>
button.Menu options
Change User Password
The default user on Raspbian is
pi
with the password raspberry
. You can change that here. Read about other users.Network Options
From this submenu you can set the host name, your WiFi SSID, and pre-shared key, or enable/disable predictable network interface names.
Hostname
Set the visible name for this Pi on a network.
Boot Options
From here you can change what happens when your Pi boots. Use this option to change your boot preference to command line or desktop. You can choose whether boot-up waits for the network to be available, and whether the Plymouth splash screen is displayed at boot-up.
Localisation Options
The localisation submenu gives you these options to choose from: keyboard layout, time zone, locale, and WiFi country code. All options on these menus default to British or GB until you change them.
Change locale
Select a locale, for example
en_GB.UTF-8 UTF-8
.Change time zone
Select your local time zone, starting with the region, e.g. Europe, then selecting a city, e.g. London. Type a letter to skip down the list to that point in the alphabet.
Change keyboard layout
This option opens another menu which allows you to select your keyboard layout. It will take a long time to display while it reads all the keyboard types. Changes usually take effect immediately, but may require a reboot.
Change WiFi Country
This option sets the country code for your WiFi network.
Interfacing Options
In this submenu there are the following options to enable/disable: Camera, SSH, VNC, SPI, I2C, Serial, 1-wire, and Remote GPIO.
Camera
Enable/disable the CSI camera interface.
SSH
Enable/disable remote command line access to your Pi using SSH.
SSH allows you to remotely access the command line of the Raspberry Pi from another computer. SSH is disabled by default. Read more about using SSH on the SSH documentation page. If connecting your Pi directly to a public network, you should not enable SSH unless you have set up secure passwords for all users.
VNC
Enable/disable the RealVNC virtual network computing server.
SPI
Enable/disable SPI interfaces and automatic loading of the SPI kernel module, needed for products such as PiFace.
I2C
Enable/disable I2C interfaces and automatic loading of the I2C kernel module.
Serial
Enable/disable shell and kernel messages on the serial connection.
1-wire
Enable/disable the Dallas 1-wire interface. This is usually used for DS18B20 temperature sensors.
Overclock
It is possible to overclock your Raspberry Pi's CPU. The default is 700MHz but it can be set up to 1000MHz. The overclocking you can achieve will vary; overclocking too high may result in instability. Selecting this option shows the following warning:
Be aware that overclocking may reduce the lifetime of your Raspberry Pi. If overclocking at a certain level causes system instability, try a more modest overclock. Hold down the Shift key during boot to temporarily disable overclocking.
See http://elinux.org/RPi_Overclocking for more information.
Advanced Options
Expand Filesystem
If you have installed Raspbian using NOOBS, the filesystem will have been expanded automatically. There may be a rare occasion where this is not the case, e.g. if you have copied a smaller SD card onto a larger one. In this case, you should use this option to expand your installation to fill the whole SD card, giving you more space to use for files. You will need to reboot the Raspberry Pi to make this available. Note that there is no confirmation: selecting the option begins the partition expansion immediately.
Overscan
Old TV sets had a significant variation in the size of the picture they produced; some had cabinets that overlapped the screen. TV pictures were therefore given a black border so that none of the picture was lost; this is called overscan. Modern TVs and monitors don't need the border, and the signal doesn't allow for it. If the initial text shown on the screen disappears off the edge, you need to enable overscan to bring the border back.
Any changes will take effect after a reboot. You can have greater control over the settings by editing config.txt.
On some displays, particularly monitors, disabling overscan will make the picture fill the whole screen and correct the resolution. For other displays, it may be necessary to leave overscan enabled and adjust its values.
Memory split
Change the amount of memory made available to the GPU.
Audio
Force audio out through HDMI or a 3.5mm jack. Read more on the audio configuration documentation page.
Resolution
Define the default HDMI/DVI video resolution to use when the system boots without a TV or monitor being connected. This can have an effect on RealVNC if the VNC option is enabled.
Pixel Doubling
Enable/disable 2x2 pixel mapping.
GL Driver
Enable/disable the experimental GL desktop graphics drivers.
GL (Full KMS)
Enable/disable the experimental OpenGL Full KMS (kernel mode setting) desktop graphics driver.
GL (Fake KMS)
Enable/disable the experimental OpenGL Fake KMS desktop graphics driver.
Legacy
Enable/disable the original legacy non-GL videocore desktop graphics driver.
Update
Update this tool to the latest version.
About raspi-config
Selecting this option shows the following text:
Finish
Use this button when you have completed your changes. You will be asked whether you want to reboot or not. When used for the first time, it's best to reboot. There will be a delay in rebooting if you have chosen to resize your SD card.
Development of this tool
See this tool's source at github.com/RPi-Distro/raspi-config, where you can open issues and create pull requests.
This article uses content from the eLinux wiki page RPi raspi-config, which is shared under the Creative Commons Attribution-ShareAlike 3.0 Unported license
Sometimes it is not convenient to work directly on the Raspberry Pi. Maybe you would like to work on it from another device by remote control.
VNC is a graphical desktop sharing system that allows you to remotely control the desktop interface of one computer (running VNC Server) from another computer or mobile device (running VNC Viewer). VNC Viewer transmits the keyboard and either mouse or touch events to VNC Server, and receives updates to the screen in return.
You will see the desktop of the Raspberry Pi inside a window on your computer or mobile device. You'll be able to control it as though you were working on the Raspberry Pi itself.
VNC Connect from RealVNC is included with Raspbian. It consists of both VNC Server, which allows you to control your Raspberry Pi remotely, and VNC Viewer, which allows you to control desktop computers remotely from your Raspberry Pi should you want to.
You must enable VNC Server before you can use it: instructions for this are given below. By default, VNC Server gives you remote access to the graphical desktop that is running on your Raspberry Pi, as though you were sitting in front of it.
However, you can also use VNC Server to gain graphical remote access to your Raspberry Pi if it is headless or not running a graphical desktop. For more information on this, see Creating a virtual desktop, further below.
Enabling VNC Server
On your Raspberry Pi, run the following commands to make sure you have the latest version of VNC Connect:
Now enable VNC Server. You can do this graphically or at the command line.
Enabling VNC Server graphically
- On your Raspberry Pi, boot into the graphical desktop.
- Select Menu > Preferences > Raspberry Pi Configuration > Interfaces.
- Ensure VNC is Enabled.
Enabling VNC Server at the command line
You can enable VNC Server at the command line using raspi-config:
Now, enable VNC Server by doing the following:
- Navigate to Interfacing Options.
- Scroll down and select VNC > Yes.
Connecting to your Raspberry Pi with VNC Viewer
There are two ways to connect to your Raspberry Pi. You can use either or both, depending on what works best for you.
Establishing a direct connection
Direct connections are quick and simple providing you're joined to the same private local network as your Raspberry Pi. For example, this might be a wired or wireless network at home, at school, or in the office).
- On your Raspberry Pi (using a terminal window or via SSH) use these instructions or run
ifconfig
to discover your private IP address. - On the device you'll use to take control, download VNC Viewer. For best results, use the compatible app from RealVNC.
- Enter your Raspberry Pi's private IP address into VNC Viewer:
Establishing a cloud connection
You are entitled to use RealVNC's cloud service for free, provided that remote access is for educational or non-commercial purposes only.
Cloud connections are convenient and encrypted end-to-end. They are highly recommended for connecting to your Raspberry Pi over the internet. There's no firewall or router reconfiguration, and you don't need to know the IP address of your Raspberry Pi, or provide a static one.
- Sign up for a RealVNC account here: it's free and it only takes a few seconds.
- On your Raspberry Pi, sign in to VNC Server using your new RealVNC account credentials:
- On the device you'll use to take control, download VNC Viewer. You must use the compatible app from RealVNC.
- Sign in to VNC Viewer using the same RealVNC account credentials, and then either tap or click to connect to your Raspberry Pi:
Authenticating to VNC Server
To complete either a direct or cloud connection, you must authenticate to VNC Server.
If you're connecting from the compatible VNC Viewer app from RealVNC, enter the user name and password you normally use to log in to your user account on the Raspberry Pi. By default, these credentials are
pi
and raspberry
.If you're connecting from a non-RealVNC Viewer app, you'll first need to downgrade VNC Server's authentication scheme, specify a password unique to VNC Server, and then enter that instead.
- If you are in front of your Raspberry Pi and can see its screen, open the VNC Server dialog on your Raspberry Pi, select Menu > Options > Security, and choose VNC password from the Authentication dropdown.
- Or if you're configuring your Raspberry Pi remotely from the command line, then to make the changes for Service Mode (the default configuration for the Raspberry Pi):
- Open the
/root/.vnc/config.d/vncserver-x11
config file. - Replace
Authentication=SystemAuth
withAuthentication=VncAuth
and save the file. - In the command line, run
sudo vncpasswd -service
. This will prompt you to set a password, and will insert it for you in the right config file for VNC Server running in Service Mode. - Restart VNC Server.
- Open the
Playing Minecraft and other directly rendered apps remotely
You can remotely access apps which use a directly rendered overlay, such as Minecraft, the text console, the Raspberry Pi Camera Module, and more.
To turn this feature on:
- On your Raspberry Pi, open the VNC Server dialog.
- Navigate to Menu > Options > Troubleshooting and select Enable experimental direct capture mode.
- On the device you'll use to take control, run VNC Viewer and connect.Note: existing connections must be restarted in order for these changes to take effect.
Please note that direct screen capture is an experimental feature. If you're connecting from a desktop computer and mouse movements seem erratic, try pressing F8 to open the VNC Viewer shortcut menu and selecting Relative Pointer Motion.
If performance seems impaired, try these troubleshooting steps, or let RealVNC know.
Creating a virtual desktop
If your Raspberry Pi is headless (i.e. not plugged into a monitor) or controlling a robot, it is unlikely to be running a graphical desktop.
VNC Server can create a virtual desktop for you, giving you graphical remote access on demand. This virtual desktop exists only in your Raspberry Pi's memory:
To create and connect to a virtual desktop:
- On your Raspberry Pi (using Terminal or via SSH), run
vncserver
. Make note of the IP address/display number that VNC Server will print to your Terminal (e.g.192.167.5.149:1
). - On the device you'll use to take control, enter this information into VNC Viewer.
To destroy a virtual desktop, run the following command:
This will also stop any existing connections to this virtual desktop.