记录一次RHCE环境,AMD的CPU无法启动嵌套虚拟化,解决报错

报错信息

core@ubuntu20-dev:~$ sudo qemu-system-x86_64 -cpu "host,pmu=off" -enable-kvm
MoTTY X11 proxy: Unsupported authorisation protocol
Unable to init server: Could not connect: Connection refused
qemu-system-x86_64: error: failed to set MSR 0xe1 to 0x0
qemu-system-x86_64: /build/qemu-BQ4hMP/qemu-4.2/target/i386/kvm.c:2691: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
Aborted

解决方案

1.运行下面命令,创建配置文件/etc/modprobe.d/qemu-system-x86.conf

sudo tee /etc/modprobe.d/qemu-system-x86.conf << EOF
options kvm ignore_msrs=1
EOF

2.重启 sudo reboot

最后修改:2021 年 06 月 02 日
如果觉得我的文章对你有用,请随意赞赏