Shutting Down
There’s no power button on the Raspberry Pi (although there is
a header for a reset switch on newer boards). The proper way to
shut down is through the Shut down command under the taskbar
menu with in the desktop environment.
You can also shut down from the command line by typing:
pi@raspberrypi: ~ $ sudo shutdown now
If you want to restart, you can type
pi@raspberrypi: ~ $ sudo shutdown -r now
Be sure to do a clean shutdown whenever possible (and don’t just
pull the plug). In some cases, you can corrupt the SD card if you
turn off the power without halting the system.
Running Headless
If you want to work on the Raspberry Pi without plugging in a mon-
itor, keyboard, and mouse, there are some ways to set it up to run
headless
. If all you require is to get into the command line, you can
simply hook the Raspberry Pi up to the network and use an SSH
client to connect to it (username: pi, password: raspber-
ry). The SSH utility on Mac or Linux will do; use PuTTY (bit.ly/
1sfuf4X) on Windows (or Linux). The SSH server on the Raspberry
Pi is enabled by default (run the Raspberry Pi configuration utility
again if for some reason it doesn’t launch at startup).
Another way to connect to the Pi over a network connection is to
start the Virtual Network Computing (VNC) server on the Pi and
connect to it using a VNC client. The benefit of this is that you can
run a complete working graphical desktop environment in a window
on your laptop or desktop. This is a great solution for a portable
development environment. The VNC server comes preinstalled on
the latest versions of the Raspberry Pi OS; to start and configure
it, click the VNC server icon on the top right of the taskbar (Figure
1-12).
24 Getting Started with Raspberry Pi
GSW_RASPI_4ED_FIN.indd 24GSW_RASPI_4ED_FIN.indd 24 10/28/21 10:53 AM10/28/21 10:53 AM