(Optional) Upgrading libvirt
The QEMU version on openEuler is generally later than the minimum requirement and does not need to be upgraded. The following uses CentOS 7.6 as an example.
- If you do not demand a GUI and can use the CLI to perform virtualization operations, the built-in libvirt-4.5.0 of the system is recommended.
- However, the libvirt-4.5.0 code has bugs. When virt-manager is used, errors, such as "internal error: Socket 6378 can't be handled (max socket is 4095)", can be triggered. If virt-manager must be used, compile and install libvirt-4.7.0 or later.
- If libvirt fails to be compiled, see libvirt 5.6.0 Compilation Fails Occasionally to rectify the fault.
Installing EDK2
- Online installation
Run the following commands to install edk2 online, as shown in Figure 1.
1 2
wget https://www.kraxel.org/repos/firmware.repo -O /etc/yum.repos.d/firmware.repo yum -y install edk2.git-aarch64
- Offline installation
- Visit https://mirrors.huaweicloud.com/centos/8-stream/AppStream/aarch64/os/Packages/.
- Search for the latest edk2-aarch64 RPM package and copy it to the corresponding directory on the target server.
- Install edk2 offline. See Figure 2.
1rpm -ivh edk2.git-aarch64*.rpm
Installing Dependency Packages
Before the operation, ensure that the server is connected to the Internet or the local source has been configured.
- Install the dependency packages.
yum -y install yum-utils rpm-build
Installing libvirt
- The SELinux security mechanism enabled by default on Linux prevents guest VM images from being loaded. As a result, services for virtualization scenarios cannot be deployed. This is the behavior of Linux itself, and Kunpeng BoostKit for Virtualization does not provide a solution to this issue. If you want to use SELinux in your own system, please find a solution by yourself.
- We provide a method for quickly disabling SELinux. The SELinux configuration method provided in Kunpeng BoostKit for Virtualization is for reference only. You need to evaluate the method and bear related risks.
- Disabling SELinux may cause security issues. If you do not plan to enable SELinux, it is recommended that an end-to-end solution be used to eliminate the risks caused by disabling SELinux. You shall bear the security risks by yourself. If you need to enable SELinux, configure fine-grained security rules based on actual SELinux issues to ensure system security.
The following uses libvirt-5.6.0 as an example. For details about how to download the source package, see OS and Software Requirements. The Arm version does not support live VM migration (but supports cold migration). If you need a live migration, install the patch in the openEuler package. You can obtain the openEuler package at https://gitee.com/src-openeuler/libvirt/tree/openEuler-20.03-LTS/.
- Install the src.rpm source package.
1rpm -i libvirt-5.6.0-1.fc30.src.rpm
- Generate an RPM package.
1 2 3
cd /root/rpmbuild/SPECS/ yum-builddep -y libvirt.spec rpmbuild -ba libvirt.spec
There is a possibility that the src.rpm package provided by the official website fails to be compiled. You may need to try for multiple times.
- Install the RPM package.
cd /root/rpmbuild/RPMS/aarch64/ yum -y install *.rpm
- Modify the configuration file.
- Run the following command to open the qemu.conf file:
1vim /etc/libvirt/qemu.confLocate the content to be modified, as shown in the following figure.

- Press i to enter the insert mode and add the following content:
1nvram = ["/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"]

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Run the following command to open the qemu.conf file:
- Restart the libvirtd service.
1service libvirtd restart

- Disable SELinux.
1setenforce 0

