简介
通过ubuntu编译安装qemu
- ubuntu20.04.1
- qemu v5.1.50
源码
https://github.com/qemu/qemu.git
安装依赖
apt-get install -y htop gcc g++ libglib2.0-dev libpixman-1-dev make libgtk-3-dev;
编译
mkdir build
cd build
../configure
make -j4
如果只编译x64
../configure --target-list=x86_64-softmmu
安装
直接安装
sudo make install
打包成deb
sudo apt-get install checkinstall; sudo checkinstall make install
安装镜像
qemu-img create -f qcow2 alpine.img 1g
qemu-system-x86_64 -enable-kvm -m 1024 -smp 4 alpine.img -cdrom ./alpine-standard-3.12.0-x86_64.iso -boot dc
启动
qemu-system-x86_64 -enable-kvm -m 1024 -smp 4 alpine.img
坑点
如果win10 同时安装了hyper-v和vmware
vmware是无法进行嵌套虚拟化,因为hyper-v已经虚拟化了宿主机了
所以用hyper-v调试时候,就不要用hyper-v和wsl2了
https://docs.vmware.com/cn/VMware-Workstation-Pro/15.5/rn/VMware-Workstation-1555-Pro-Release-Notes.html