Loading... > 在使用QEMU进行虚拟化时,AMD CPU用户可能会遇到一系列兼容性问题,导致虚拟机无法正常启动。本文将介绍如何通过添加特定的KVM参数来解决这些问题。 在AMD CPU上运行QEMU/KVM 虚拟化时,可能会遇到以下错误信息: ```bash 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 ``` 这些错误与 KVM 处理 MSR 的兼容性有关,所以我们可以向 KVM 模块添加一个参数,让 KVM 遇到未知 MSR 请求的时候忽略而不是抛出异常错误信息,我们可以这样做 ```bash tee /etc/modprobe.d/qemu-system-x86.conf << EOF options kvm ignore_msrs=1 EOF ``` 上面的命令会在 `/etc/modprobe.d/` 创建一个名为`qemu-system-x86.conf` 的配置文件,其内容为`options kvm ignore_msrs=1`,当 KVM 模块被加载时,就会应用这个参数,重启生效 Last modification:April 25, 2025 © Allow specification reprint Support Appreciate the author Like 如果觉得我的文章对你有用,请随意赞赏