"64-bit 1.0 official version system" Raspberry Pi installs QEMU virtual machine and runs standard system

In a few simple steps, your Raspberry Pi can also run a virtual machine! ! !

This tutorial applies to our 1.0 version system! The tutorial of the 2.0 version system will be released in the future!

Start of the tutorial:

First, brush our 1.0 version system, turn on the network, and open the ssh control terminal. At the same time, this tutorial needs a display screen, so you can connect the display screen in advance. The display screen can be used for normal computers and TVs.

One. Install QEMU virtual machine

1. Download the QEMU virtual machine binary software package (send the official account to QEMU to obtain the download address)

2. Upload the downloaded package to your Raspberry Pi
. Download the ftp software on the computer and use the ftp software to upload the package to the Raspberry Pi
Insert picture description here
. 3. Unzip the compressed package. The
binary software package and the virtual machine image are usually used according to the actual situation. Tag, zip, tar.gz, xz compression format release
You must at least install the support for the above compression format software

sudo apt-get update
sudo apt install tar gzip zip unzip bzip2 xz-utils -y
sudo unzip qemu-2.12+dfsg-3ubuntu9.zip

4. Enter the unzipped file directory, and then execute the following command to install

cd /home/pi/qemu-2.12+dfsg-3ubuntu9
sudo sh ./install

two. Debian Aarch64 virtual machine mirroring instructions

1. To use this virtual machine images, BIOS must be turned "KVM hardware acceleration
on opening

(1) Power on and press "ESC"
(2) Enter "BIOS setup"
Insert picture description here
(3) Select "Device Manager"
Insert picture description here
(4) Select "Raspberry Pi Configuration"
Insert picture description here
(5) Select "HypDxe Configuration"
Insert picture description here
(6) Select "System Boot Mode "
Insert picture description here
(7) Select "Boot in EL2" to enable "KVM hardware acceleration"
Insert picture description here
(8) Press "F10" and then "Y" to save the settings
(9) Press "ESC" continuously until you return to the main BIOS interface, select "Continue" to continue
Insert picture description here
( 10) After the configuration is complete, the system will automatically restart

2. Create a new folder virtual_michine

sudo mkdir virtual_michine
sudo chmod 777 virtual_michine

3. Download the standard system virtual machine image and upload all files to the above folder
(send to the official account: get the download address for the standard system virtual machine image)

4. Enter the newly created directory

cd /home/pi/virtual_michine

5. Execute the following command to decompress the virtual machine image file

 sudo xz -k -d disk.qcow2.xz

6. Copy a vm_run file and name it vm_run2

sudo cp  vm_run  vm_run2

7. Edit the copied file vm_run2, remove the "&" symbol at the end of the file, save the file and exit editing

 sudo nano vm_run2

8. Then execute the following command to start the virtual machine in the foreground

sudo sh ./vm_run2

three. Log in to the virtual machine and enable remote login

1. Log in to the system, the default root account password is: raspberry

2. Edit the /etc/ssh/sshd_config file

nano  /etc/ssh/sshd_config

Find the content of the line "PermitRootLogin", remove the preceding "#" comment symbol, and change the content of this line to the following

PermitRootLogin yes

(Before the change)
Insert picture description here
(After the change)
Insert picture description here
3. Execute the following commands

 systemctl restart ssh

4. Finally execute the following command to shut down the virtual machine

init 0

5. Run the virtual machine in the background

sudo nohup sh ./vm_run
  1. Remote login
    The port 22 of the virtual machine is mapped to port 2222 of the machine by default, and you can access port 2222 of the machine by SSH

Reference command:

ssh -p 2222 root@本机的IP地址

Get it done! ! !
Your Raspberry Pi is already running a virtual machine with our standard mirror! And you can use the ssh control terminal to control!
We will release more interesting things in the future, so stay tuned! ! !

Guess you like

Origin blog.csdn.net/qq_41676577/article/details/112971418