Windows10下使用QEMU安装Ubuntu20.04虚拟机,并启用硬件加速

发布于:2025-05-31 ⋅ 阅读:(25) ⋅ 点赞:(0)

Windows10下使用QEMU安装Ubuntu20.04虚拟机,并启用硬件加速

作者 将狼才鲸
创建日期 2025-05-30

一、实际安装步骤

    1. 下载好QEMU安装包,Ubuntu20.04 ISO镜像
    1. 创建一个目录,进入 D:\99_VirtualOS\Ubuntu20.04 目录,将Ubuntu ISO拷贝到该目录
    1. 右键打开CMD,然后输入下面命令(带输入命令后的执行结果)
D:\99_VirtualOS\Ubuntu20.04>qemu-img create -f qcow2 ubuntu-20.04.img 128G

Formatting 'ubuntu-20.04.img', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=137438953472 lazy_refcounts=off refcount_bits=16

D:\99_VirtualOS\Ubuntu20.04>qemu-system-x86_64 -m 2048 -smp 4 -machine accel=whpx ubuntu-20.04.img -cdrom ubuntu-20.04.3-desktop-amd64.iso

WHPX: setting APIC emulation mode in the hypervisor
Windows Hypervisor Platform accelerator is operational
whpx: injection failed, MSI (0, 0) delivery: 0, dest_mode: 0, trigger mode: 0, vector: 0, lost (c0350005)
(qemu:8152): Gtk-WARNING **: 22:39:27.481: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/bullet-symbolic.svg.
This may indicate that pixbuf loaders or the mime database could not be found.
qemu: WHPX: Unexpected VP exit code 4
    1. 然后会弹出图形界面,在图形界面中按正常方式安装Ubuntu;
    • 注意:千万不要关掉黑色的CMD窗口,否则安装界面会立马退出!
    • 注意:安装时使用了whpx后安装速度会快很多,强烈建议!
    • 安装时间比较久,需要耐心等安装完成(和用VMware安装Ubuntu速度差不多),但不选whpx的话会慢很多。
    • 鼠标点中安装界面内后按左上角提示按下Ctrl + Alt + G组合键能退出窗口的鼠标捕获。
    1. 安装完成后关机,然后用下面命令重新启动虚拟机:
D:\99_VirtualOS\Ubuntu20.04>qemu-system-x86_64 -m 2048 -smp 4 -machine accel=whpx ubuntu-20.04.img

WHPX: setting APIC emulation mode in the hypervisor
Windows Hypervisor Platform accelerator is operational
whpx: injection failed, MSI (0, 0) delivery: 0, dest_mode: 0, trigger mode: 0, vector: 0, lost (c0350005)

网站公告

今日签到

点亮在社区的每一天
去签到