(1) First of all, you need to have a CentOS virtual machine. If you don’t have one, you can refer to VMWare to install a CentOS7 operating system virtual machine to install a CentOS virtual machine.
(2 Install base commands
yum install -y net-tools
yum install -y wget
(2) Download the centos7 operating system image of the ARM architecture
mkdir -p /opt/os
cd /opt/os
wget http://mirror.nju.edu.cn/centos-altarch/7.9.2009/isos/aarch64/CentOS-7-aarch64-Minimal-2009.iso --no-check-certificate
chmod 777 /opt/os/CentOS-7-aarch64-Minimal-2009.iso
(3) The EFI
path for downloading the ARM architecture is /usr/share/AAVMF/AAVMF_CODE.fd
yum install -y http://mirror.centos.org/altarch/7/os/aarch64/Packages/AAVMF-20180508-6.gitee3198e672e2.el7.noarch.rpm
(4) Install basic dependencies
yum groupinstall 'Development Tools' -y
yum groupinstall "Virtualization Host" -y
yum install -y kvm qemu virt-viewer virt-manager libvirt libvirt-python python-virtinst
yum install libguestfs-tools -y
yum install virt-install.noarch -y
systemctl enable libvirtd
systemctl start libvirtd
usermod -aG libvirt $(whoami)
yum install virt-install virt-viewer virt-manager -y
(5) Modify the qemu configuration file
vi /etc/libvirt/qemu.conf
Uncomment the following two lines
(6) Restart the virtual machine
reboot
(7) Download qemu
cd /opt
wget https://download.qemu.org/qemu-4.2.0.tar.xz
(8) Install basic dependencies
yum install python2 zlib-devel glib2-devel pixman-devel -y
(9) Decompress qemu
cd /opt/
tar xf qemu-4.2.0.tar.xz
(10) Install qemu
cd qemu-4.2.0/
./configure --target-list=aarch64-softmmu --prefix=/usr
make -j8
make install
(11) Create a disk
rm -rf /var/lib/libvirt/images/test.img
qemu-img create /var/lib/libvirt/images/test.img 30G
(12) Start the virtual machine
qemu-system-aarch64 -m 1024 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/AAVMF/AAVMF_CODE.fd -nographic -drive if=none,file=/opt/os/CentOS-7-aarch64-Minimal-2009.iso,id=cdrom,media=cdrom -device virtio-scsi-device -device scsi-cd,drive=cdrom -drive if=none,file=/var/lib/libvirt/images/test.img,id=hd0 -device virtio-blk-device,drive=hd0
(13) Set the hostname as follows
(14) Set the network to dhcp mode as follows
(15) Set the disk mount, here is a simple process
(16) Set the password of the root user
(17) When setting the time zone, if there is no exclamation mark in the following positions, continue the installation
(18) After the installation is complete, press Enter to restart
(19) Then you can log in through the set root password