Rate This Document
Findability
Accuracy
Completeness
Readability

Installing QEMU

Perform the following operations on the compute nodes (x86-compute and arm-compute).

  1. Install dependencies.
    1
    yum -y install gcc gcc-c++ flex bison glib2-devel zlib-devel pixman-devel libaio-devel librdb-devel 
    
  2. Download the source code.
    • Download online:
      1
      wget https://download.qemu.org/qemu-4.0.0.tar.xz --no-check-certificate
      
    • Download offline:

      On a computer that can access the Internet, visit https://download.qemu.org/qemu-4.0.0.tar.xz to download the source code and copy it to the target server.

  3. Perform compilation and installation.
    1. Decompress the QEMU package, and go to the directory where QEMU is stored.
      1
      2
      tar -xvf qemu-4.0.0.tar.xz
      cd qemu-4.0.0
      
    2. Install the QEMU package.
      1
      ./configure --enable-rbd --enable-linux-aio
      

      1
      2
      make -j 50
      make install
      
  4. Add the lib.
    1
    sed -i  '$ainclude /usr/local/lib' /etc/ld.so.conf
    
  5. Make the configuration take effect.
    1
    ldconfig
    
  6. Verify the version.
    1. Locate the software.
      1
      which qemu-img
      
    2. Query the software version.

      The version should be 4.0.0.

    1. If the QEMU version is not 4.0.0, the new version does not take effect. In this case, back up QEMU-related files in the /usr/bin directory.
      1
      2
      3
      4
      5
      6
      7
      mv  /usr/libexec/qemu-kvm{,.bak}
      mv  /usr/libexec/qemu-bridge-helper{,.bak}
      mv  /usr/bin/qemu-img{,.bak}
      mv  /usr/bin/qemu-io{,.bak}
      mv  /usr/bin/qemu-nbd{,.bak}
      mv  /usr/bin/qemu-ga{,.bak}
      mv  /usr/bin/qemu-pr-helper{,.bak}
      
    2. Link the QEMU-related files in the /usr/local/bin/ directory to the /usr/bin directory.
      1
      2
      3
      4
      5
      6
      ln -s /usr/local/libexec/qemu-bridge-helper /usr/libexec/
      ln -s /usr/local/bin/qemu-ga /usr/bin/
      ln -s /usr/local/bin/qemu-img /usr/bin/
      ln -s /usr/local/bin/qemu-io /usr/bin/
      ln -s /usr/local/bin/qemu-nbd /usr/bin/
      ln -s /usr/local/bin/qemu-pr-helper /usr/bin/
      
    3. Run the following commands on the x86-compute node:
      1
      2
      ln -s /usr/local/bin/qemu-system-x86_64 /usr/libexec/qemu-kvm
      ln -s /usr/libexec/qemu-kvm /usr/bin/
      
    4. Run the following commands on the arm-compute node:
      1
      2
      ln -s /usr/local/bin/qemu-system-aarch64 /usr/libexec/qemu-kvm
      ln -s /usr/libexec/qemu-kvm /usr/bin/