Using Desktop Environment with VNC
You can remotely access the Raspberry Pi desktop environment using VNC (Virtual Network Computing) even when no monitor, keyboard, or mouse is connected to the Raspberry Pi.
Enabling VNC
After connecting to the Raspberry Pi via SSH, execute the following command. For SSH usage instructions, refer to here.
sudo raspi-config
Use the keyboard arrow keys to select [3.Interface Options] and press Enter.

Select [I3 VNC] and press Enter.

Select [Yes] and press Enter.

The VNC server has been enabled.

From the main menu again, select [2 Display Options] and press Enter.

Select [D5 VNC Resolution] and press Enter.

Select the resolution for the desktop environment that will be displayed when connecting with a VNC client and press Enter. Note that you should select a resolution that is equal to or lower than your monitor’s resolution.

Resolution setting has been completed.

From the main menu, select <Finish> and press Enter to exit the settings.

Select <Yes> and press Enter to reboot the Raspberry Pi.

Connecting to VNC
To connect to the VNC server from a Windows or Mac PC, you need a VNC client. While various VNC clients exist, we’ll use RealVNC Viewer, which is the most commonly used.
Download the installer for your operating system from here, install it, and run the application.

When RealVNC Viewer is running, enter the Raspberry Pi’s IP address or hostname (e.g., raspberrypi) in the address bar at the top and press Enter. For instructions on finding the Raspberry Pi’s IP address, refer to here.

If an Identity Check window appears, click the [Continue] button.

Enter the Raspberry Pi login username and password. If you want to connect automatically without being prompted for a password on subsequent connections, check [Remember password]. Click [OK] to connect.

Connection to the VNC server is now complete. You can freely use the Raspberry Pi’s desktop environment from your PC.

An icon for the recently connected Raspberry Pi will be created on the viewer’s main screen, and you can connect by clicking this icon from now on.
