Setting Up a Raspberry Pi for Remote Access Without a Monitor or Keyboard
Tags: raspberrypi, ssh, vnc, beginners
Published: 2024-03-08 07:07:40



Install the following software for this tutorial

- [Raspberry Pi Imager](https://www.raspberrypi.com/software/)
- [RealVNC](https://www.realvnc.com/en/connect/download/viewer/)


First, start the raspberrypi Imager

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ct9abw8l0nka9ba5zsn2.jpg)


When opened, the following configuration screen will be launched.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/in67kyf4g11tsgxtnx01.jpg)


This time,  I'll install Raspberry Pi OS (64-bit) Desktop on a 32GB microSD card, using the Desktop version for graphical display via VNC.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1a5ermamb0f3siartb1m.jpg)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpkbzr904fz8kmx0l4wi.jpg)

Write with the following settings

Press 「Next」

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgcohg9jmwqxhv2x36sn.jpg)


When asked 「Would you like to apply OS customisation settings?」, press 「EDIT SETTINGS」.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqlujyoug1deds6tcse5.jpg)

Under the 「GENERAL」 category, set up Wi-Fi and password in the 「OS Customization」 screen.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa5m6bvnirdtaxur7t8i.jpg)

Select 「SERVICE」 and enter your Wi-Fi and password. If you wish to configure using a public key, select 「SERVICE」 next to 「GENERAL」 and choose 「Allow public-key authentication only. Set authorized_keys for 'pi':'」

And click「SAVE」

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1qzxmr040s40k9qs25x.jpg)






![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v8fna5q1w1g98615jix8.jpg)

When asked 「Would you like to apply OS customisation settings?」, press「YES」.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npcxv5co7135i8nim2x9.jpg)

Please wait a moment while the Raspberry Pi OS is being written to the microSD card.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5r8thbtxfbc371f47v46.jpg)

The display will show 「verifying...」 and after a short while, the process will be completed.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5zk24z9quhwlr9avj7i.jpg)


Click 「CONTINUE」 and then follow the on-screen instructions to remove the microSD card.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1e7ryd73iw1we6m49ss.jpg)


Next, insert the microSD card into the Raspberry Pi and power it on.


Enter the following command in the terminal to connect to the Raspberry Pi via SSH. If a password has been set, enter the password to log in.


```
ssh pi@raspberrypi.local
```

or

```
ping pi@raspberrypi.local
```
Check IPAdress

```
ssh pi@10.207.171.xxx（IP Address）
```

If configured as follows, the 'hostname,' 'Username,' and 'Password' will be as follows.

「hostname」: 「raspberrypi」
「Username」：「pi」
「Password」：「raspberry」


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxpuytgch6gjmjx3pzxy.jpg)

During the first login, you will be asked a question like the following, to which you should respond with 'yes'.

```
ssh pi@(IPAdress)
The authenticity of host '10.207.171.xxx (10.207.171.xxx)' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxx.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?
```

```
Yes
```

Once logged in, you will see a prompt like 「pi@raspberrypi:~ $」, indicating that you have successfully SSH connected to the Raspberry Pi.


```
Linux raspberrypi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: xxx. xxx. xxx
pi@raspberrypi:~ $
```


Having established a connection via SSH in the CLI, I would now like to connect graphically using VNC. To do this, it's necessary to enable VNC connections by running 「sudo raspi-config」.

```
sudo raspi-config
```

The screen will change to a blue background, switching to the interface for configuring Raspberry Pi settings.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osokks4mcvepwosgciep.jpg)

Select 「3 Interface Options」, Click「Enter」

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dw792guyejw8mkdht0vj.jpg)

Select「I2 VNC」

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s24r36to30rkpl0rg9zc.jpg)



「When asked 'Would you like the VNC server to be enabled?」 select 「Yes」.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cihzus5450ab2965878c.jpg)

This will momentarily switch back to the original black screen. Afterwards, 「The VNC Server is enabled」 will be displayed, so select 「OK」.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65ki33jvo5tee1zsinzw.jpg)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbj3boh7pc4xborlerqa.jpg)

Now that VNC is enabled, next launch Real VNC.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pllv45o0316eqawlcwk.jpg)




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rtlashpjrmadbsph4n01.jpg)

Enter the IP address in the input field at the top

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xckw8za1j2bu8by8yqj2.jpg)

Finally, enter the Username and Password you set earlier

If the IP address is entered correctly, the following screen will be displayed for the first time, so click 「Continue」.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wk3g4v3v3p5nvxfxhlqa.jpg)



Finally, enter the Username and Password you set earlier.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nsqsvmxjag1gqrjnj1jk.jpg)




Doing so will display the Raspberry Pi's home screen.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6925dtmntdvz27ds1kz.jpg)