**
1.安装带有NVMe支持的qemu.
**
QEMU Installation
QEMU support for Open-Channel SSDs is based on top of Keith Busch’s qemu-nvme branch, which implements an NVMe compatible device.
Clone the qemu source from
git clone https://github.com/OpenChannelSSD/qemu-nvme.git
qemu-nvme的版本要用master分支的这个commit:fb8f9f2a7e260c3e8a0d993473d24
and configure the QEMU source with
./configure --enable-linux-aio --target-list=x86_64-softmmu --enable-kvm
then install by make and install
2.创建qemu虚拟机
2.1创建空白磁盘
$:qemu-img create -f raw ubuntu.raw 50G
(有空间就建大点,如何你想在虚拟机内部编译内核,磁盘一定要建大点);
2.2, 检查KVM是否可用
QEMU使用KVM来提升虚拟机性能,如果不启用KVM会导致性能损失。要使用KVM,首先要检查硬件是否有虚拟化支持:
$:grep -E 'vmx|svm' /proc/cpuinfo`
如果有输出则表示硬件有虚拟化支持。其次要检查kvm模块是否已经加载:
$:lsmod | grep kvm
kvm_intel 142999 0
kvm 444314