Rate This Document
Findability
Accuracy
Completeness
Readability

(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
    
    Figure 1 Installing edk2 online

Installing Dependency Packages

Before the operation, ensure that the server is connected to the Internet or the local source has been configured.

  1. 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/.

  1. Install the src.rpm source package.
    1
    rpm -i libvirt-5.6.0-1.fc30.src.rpm
    
  2. 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.

  3. Install the RPM package.
    cd /root/rpmbuild/RPMS/aarch64/
    yum -y install *.rpm
  4. Modify the configuration file.
    1. Run the following command to open the qemu.conf file:
      1
      vim /etc/libvirt/qemu.conf
      

      Locate the content to be modified, as shown in the following figure.

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

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Restart the libvirtd service.
    1
    service libvirtd restart
    

  6. Disable SELinux.
    1
    setenforce 0