# 验证安装是否成功<a name="ZH-CN_TOPIC_0183154308"></a>

1.  查看内核是否支持KVM虚拟化，即查看/dev/kvm和/sys/module/kvm文件是否存在，命令和回显如下：

    ```
    # ls /dev/kvm
    /dev/kvm
    ```

    ```
    # ls /sys/module/kvm
    parameters  uevent
    ```

    若上述文件存在，说明内核支持KVM虚拟化。若上述文件不存在，则说明系统内核编译时未开启KVM虚拟化，需要更换支持KVM虚拟化的Linux内核。

2.  确认qemu是否安装成功。若安装成功则可以看到qemu软件包信息，命令和回显如下：

    ```
    # rpm -qi qemu
    Name        : qemu
    Epoch       : 10
    Version     : 4.0.0
    Release     : 1
    Architecture: aarch64
    Install Date: Wed 24 Jul 2019 04:04:47 PM CST
    Group       : Unspecified
    Size        : 16869484
    License     : GPLv2 and BSD and MIT and CC-BY
    Signature   : (none)
    Source RPM  : qemu-4.0.0-1.src.rpm
    Build Date  : Wed 24 Jul 2019 04:03:52 PM CST
    Build Host  : localhost
    Relocations : (not relocatable)
    URL         : http://www.qemu.org
    Summary     : QEMU is a generic and open source machine emulator and virtualizer
    Description :
    QEMU is a generic and open source processor emulator which achieves a good
    emulation speed by using dynamic translation. QEMU has two operating modes:
    
     * Full system emulation. In this mode, QEMU emulates a full system (for
       example a PC), including a processor and various peripherials. It can be
       used to launch different Operating Systems without rebooting the PC or
       to debug system code.
     * User mode emulation. In this mode, QEMU can launch Linux processes compiled
       for one CPU on another CPU.
    
    As QEMU requires no host kernel patches to run, it is safe and easy to use.
    ```

3.  确认libvirt是否安装成功。若安装成功则可以看到libvirt软件包信息，命令和回显如下：

    ```
    # rpm -qi libvirt
    Name        : libvirt
    Version     : 5.5.0
    Release     : 1
    Architecture: aarch64
    Install Date: Tue 30 Jul 2019 04:56:21 PM CST
    Group       : Unspecified
    Size        : 0
    License     : LGPLv2+
    Signature   : (none)
    Source RPM  : libvirt-5.5.0-1.src.rpm
    Build Date  : Mon 29 Jul 2019 08:14:57 PM CST
    Build Host  : 71e8c1ce149f
    Relocations : (not relocatable)
    URL         : https://libvirt.org/
    Summary     : Library providing a simple virtualization API
    Description :
    Libvirt is a C toolkit to interact with the virtualization capabilities
    of recent versions of Linux (and other OSes). The main package includes
    the libvirtd server exporting the virtualization support.
    ```

4.  查看libvirt服务是否启动成功。若服务处于“Active”状态，说明服务启动成功，可以正常使用libvirt提供的virsh命令行工具，命令和回显如下：

    ```
    # systemctl status libvirtd
    ● libvirtd.service - Virtualization daemon
       Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
       Active: active (running) since Tue 2019-08-06 09:36:01 CST; 5h 12min ago
         Docs: man:libvirtd(8)
               https://libvirt.org
     Main PID: 40754 (libvirtd)
        Tasks: 20 (limit: 32768)
       Memory: 198.6M
       CGroup: /system.slice/libvirtd.service
               ─40754 /usr/sbin/libvirtd
    
    ```


