[Latest Tutorial] Raspberry Pi Installation System and VNC Remote Desktop Connection

Hello everyone, I will not introduce PYTHONL to you today. Today, as a novice who has just entered the pit of the Raspberry Pi, I sorted out the whole process of installing the Raspberry Pi and shared it with you.


Table of contents

raspberry pie

Preparation:

Raspberry Pi remote ssh fails access denied

reason:

Raspberry Pi system installation

1. Download the Raspberry Pi system

System difference

2. Format the memory card

3. Burn image file

Burning system

first step:

Step two:

third step:

the fourth step:

Connect Raspberry Pi

1. Has a screen

2. No screen but network cable

3. No screen and no network cable

Using VNC Remote Desktop

Raspberry Pi VNC connection error: The connection was refused by the computer Solved

solution one 

Solution two

remote Desktop connection


raspberry pie

Here, let me briefly introduce what is a Raspberry Pi?

Raspberry Pi (Raspberry Pi) is a small computer with the size of a credit card. You can connect Raspberry Pi to TVs, monitors, keyboards and mice and other devices.
The Raspberry Pi can replace your everyday desktop computer for many purposes, including word processing, spreadsheets, media centers and even gaming. And the Raspberry Pi can also play high-definition video up to 4K.

Preparation:

A Raspberry Pi (version 3 and above), a Micro SD card (above 8G), a card reader, and a computer.

I use Raspberry Pi zero 2W, and the following operations are based on this development board, and other types of development boards are the same.

Raspberry Pi remote ssh fails access denied

reason:


The Raspberry Pi officially performed a system update on April 7, 2022. This update deleted the default account pi. Original link
Old method:
1. Insert the burnt SD card into the computer;
2. Configure the ssh file and wpa_supplicant.conf file, and copy them to the SD card;
3. Insert the SD card into the Raspberry Pi, connect the power to start the Raspberry Pi;
4. Find the Raspberry Pi’s IP address, open it with the remote ssh tool putty, and enter the IP address.
 

This is why we configure the SSH file and wpa_supplicant.conf file according to the online tutorial, but the Raspberry Pi still cannot connect to the Internet.

The main problem is that third-party software cannot be used for programming, and official burning software is used, which is also mentioned later in this article.

Raspberry Pi system installation

First of all, if you want to install the system, you definitely need to install the package, just like the win system.

1. Download the Raspberry Pi system

Download address: https://www.raspberrypi.org/software/operating-systems/

When we enter the official website, we will see the following page.

We can choose the appropriate system to download, or we don't need to download , which will be mentioned later.


After the download is complete, it is a .zip file, which needs to be decompressed. The decompressed .img file is the image file to be used.

System difference

Raspberry Pi OS with desktop, Raspberry Pi OS with desktop and recommended software, and Raspberry Pi OS Lite are all operating systems developed based on Raspberry Pi hardware devices, but there are some differences between them.

  1. Raspberry Pi OS with desktop: This version includes a graphical desktop environment, but does not include commonly recommended software. This means that users need to install the required software themselves. This version is suitable for users who have some experience in using Linux, and can freely customize their own system.
  2. Raspberry Pi OS with desktop and recommended software: This version includes a graphical desktop environment and some commonly used recommended software. This allows users to use these pre-installed software directly after installation, suitable for novices and ordinary users.
  3. Raspberry Pi OS Lite: This version does not have a graphical desktop environment, only a command line interface is provided. It is aimed at hardware devices with low configuration (such as Raspberry Pi zero, etc.), which can reduce the resource occupation of the system. This version is suitable for users with certain Linux experience or users who need to work in the command line environment.

Overall, all three versions are designed for different user needs. If you are a novice or want to use Raspberry Pi quickly and easily, you can choose Raspberry Pi OS with desktop and recommended software. If you want more advanced customization or work on a device with limited resources, you can choose Raspberry Pi OS with desktop or Raspberry Pi OS Lite.

2. Format the memory card

In order to prevent mistakes, format it first.

Right click on my computer-management-disk management, check if there is only one partition, there should be only one partition, and it is FAT32.

3. Burn image file

Go to the Raspberry Pi official download burning tool

Raspberry Pi OS – Raspberry Pi

 

 

Note : It must be official, because since 2022/04/04, the official default account password of Raspberry Pi has been cancelled, and it must be downloaded in the official burning tool

You must download the official one. Some of the articles you may find use third-party burning software. There is no problem with it together, and it cannot be used now.

Burning system

5a5db636273a446fb2628eb0b5500e7f.png

first step:

Select the system to burn, as we said before, you don’t need to download the system, it will be downloaded automatically here.

311c23b1be014c62bd275ec94c0625af.png

We can also customize the burning, we can choose the burning software that we have downloaded. We can also use this to format, or directly overwrite the installation. 

Step two :

select memory card 

7008863ae9ea4bdda056153b39e1d918.png

third step:

Set the account password (note that this step is very important, remember to write it down, and use it when you log in) we still use the default password because it is easy to remember.

 8dfa9719e1b2480dadaea10d88eaaffa.png

 When we click on the settings button, we will see the following screen.

In this interface we need to set:

  1. Host name: It is used when connecting to the Raspberry Pi with remote access search. You can customize it. Generally, raspberrypi is used to distinguish it.
  2. SSH service type: use password to log in, just use the user name and password set next when using SSH service to log in: only allow to use public key to log in, that is, you need to log in with the user key when logging in, but you need to use the user name and password when logging in to the system. However, it is recommended to have a small display screen for getting started, otherwise it will be a bit of a hassle. A separate article about SSH will be published later to explain in detail.
  3. Username and password: You can customize it, and you need to use it when you log in to the system.
  4. WiFi and WiFi password: Try to choose a commonly used WiFi with stable signal, because the Raspberry Pi will automatically enable the WiFi service and connect when it is turned on. The WiFi country must be CN (China), otherwise there will be problems.
  5. Language setting: The time zone and keyboard layout are set here, and the time zone does not matter, but note that in the Linux system, UTC+8 selects Shanghai (Shanghai time) instead of Beijing (Beijing time), so don’t look for Beijing.
  6. Keyboard layouts are different layouts corresponding to different languages. For example, the commonly used English/Chinese keyboards have QWERTY layouts, French keyboards have AZERTY layouts, Russian keyboards have ЙЦУКЕН layouts, and German keyboards have QWERTZ layouts. This is mainly because there will be relatively big problems when entering passwords, because the Linux system does not display that touch typing is required when entering passwords in the Terminal window and the command line version of the system, so different layouts may cause the same key to correspond to different input characters, resulting in a mismatch.
  7. Image customization options: These two options are permanent storage and this time only, you can choose according to your needs. Permanent storage means that you don’t need to set it up again every time you burn, just reset it when you need to change the settings.

Then how do we set it up, I will show you step by step:

Step 1: Open the SSH service. This is like creating an SSH file in the root directory before. After this is enabled, there is no need to create an SSH file in the root directory.

 Configure account password and WIFI

 the fourth step:

Click write and that's it! ! The next step is to wait until the writing is completed and the file verification is completed, then pull out the U disk and insert it into the Raspberry Pi to power on and start. The burning process of other systems is the same, but it should be noted that the transmission speed of the mirror station of some systems is very slow, and problems may occur during the burning process, just try more. If you have any questions, please contact us.

Connect Raspberry Pi

This step is the most difficult to do, and it took a lot of detours. Let's see how to do it.

In any case, the SSH port must be opened, because the Raspberry Pi OS system closes the SSH port by default, so we need to enter the file to open it first.

Here are three ways to do it:

① With display

② No monitor with network cable

③ No display, no network cable

We will introduce to you one by one:

1. Has a screen

If there is a screen, of course it must be connected to the screen hhh

I am using a seven-inch touch screen here. There are many tutorials on how to connect it, so I won’t go into details here. It is easiest to connect the Raspberry Pi with a screen.

Step 1: Unplug the card reader, then insert the TF card into the Raspberry Pi.

Step 2: Just select the wifi connection in the upper right corner of the screen. Just like mobile phone networking.

2. No screen but network cable

Step 1: Unplug the card reader, then insert the TF card into the Raspberry Pi.

Step 2: Connect the Raspberry Pi to the power supply, and let the red light next to the power supply be on. And connect the Raspberry Pi and the computer with a network cable, observe whether the green light and yellow light on the network port of the Raspberry Pi are on, you can unplug the network cable and plug it in again. (Unplug the power and plug it in again if it still doesn't light up)

 Step 3:win+R Open the run window, then enter cmd, open the terminal command line window, and enter the command

ping -4 raspberrypi.local

 

 If such a prompt pops up

Can try:

Method 1: Unplug the power network cable and reinsert the TF card

Method 2: If there is a problem, turn on Internet connection sharing in the advanced network settings.

645f541fcb0046ccbc3128054d0c2f17.png

Method 3: Reprogram the system

3. No screen and no network cable

Step 1: (If we didn’t set up WIFI before) Don’t unplug the TF card, go to the boot partition, and create a wpa_supplicant.conf file. There is no need to create an SSH file here. The content of the file is as follows:

country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="你的wifi名(注意不要有中文)"
    psk="你的wifi密码"
    key_mgmt=WPA-PSK
}

If you have already set it before, please ignore this operation! ! !

Step 2: Unplug the card reader, then insert the TF card into the Raspberry Pi, and power on the Raspberry Pi

Step 3:win+R Open the run window, then enter cmd, open the terminal command line window, and enter the command

ping -4 raspberrypi.local

Note that the computer should be connected to the same wifi as written on the file at this time

The result should be as follows: (where 192.168.1.50 is my own Raspberry Pi IP address, your IP address will be different)

 

 You can also use the router background to view,

Using VNC Remote Desktop

VNC is a remote desktop protocol that allows users to remotely access and control another computer's desktop over a network. VNC is the abbreviation of Virtual Network Computing. Its working principle is to transmit the image on the remote computer screen to the local computer, and transmit the mouse and keyboard events of the local computer to the remote computer. The VNC protocol is cross-platform, so it can be remotely connected and controlled between different operating systems, such as Windows, Linux and Mac OS X, etc. There are many implementations of the VNC protocol, including TightVNC, RealVNC, and UltraVNC.

Raspberry Pi VNC connection error: The connection was refused by the computer Solved

The PC and the Raspberry Pi are connected graphically, and the Raspberry Pi can be operated without a Raspberry Pi display. But everything is difficult at the beginning. When you operate for the first time, you will more or less encounter some inexplicable problems, such as Connection refused when using VNC-Viewer to connect. After several times of tossing, I finally figured out what was going on, and recorded the operation steps here.

Download VNC Viewer from the official website .

When I used VNC-Viewer to log in to the Raspberry Pi for the first time, the error message The connection was refused by the computer was reported. Repeated operations many times still failed, but it was possible to connect using putty. You can go to the official website to download, or you can choose other software.

solution one 

Open putty, fill in the IP address column according to the IP address obtained by ifconfig on the Raspberry Pi, keep the port as 22, and then click Open.

The software switches to the command line window, and first displays the login page, where the default login name is pi, and the password is raspberry. I still set the default account password. You should use the account password you set when burning. Here you should know that the password will not be echoed. You need to pay attention to whether the input method and capitalization are correct. 

After the login is successful, a paragraph of English will be displayed, and finally a few letters at the beginning of the familiar Raspberry Pi command line will pop up: pi@raspberrypi: $, so that you can enter the command.

Now the problem is officially solved. The reason why the connection failed with VNC is that the VNC service of the Raspberry Pi is not enabled. Then we have logged in the Raspberry Pi and can directly enter the vncserver command to start the VNC service.

After executing the vncserver command, a series of English words will pop up, we only need to pay attention to the best line:

New desktop is raspberrypi:1 (192.168.1.50:1)

The last 192.168.1.50:1 is the IP address and port number, especially the last port number 1.

Solution two

The first step is to configure the Raspberry Pi.
In the putty command line, enter

sudo raspi-config

This will open a graphical interface. In the interface, use the arrow keys to control the cursor, and the Enter key to select.

  1. Open VNC: Interfacing Options ->  VNC -> Yes
  2. Exit the graphical interface: (left and right arrow keys to select)Finish

remote Desktop connection

It is the first time to configure the board, so you need to enter the port number. If you want to log in to control the Raspberry Pi with VNC in the future, just enter the IP address.

Enter the VNC address and port number of the Raspberry Pi obtained by putty into VNC-Viewer, press Enter, and the Raspberry Pi login window will pop up after success.

 After the operation is successful, you will see the familiar Raspberry Pi operation interface on the computer.

 

Guess you like

Origin blog.csdn.net/BROKEN__Y/article/details/131815597