【问题标题】:How to use the QEMU that I compiled with my libvirt? qxl error如何使用我用 libvirt 编译的 QEMU? qxl 错误
【发布时间】:2022-06-11 04:11:31
【问题描述】:

我一直在尝试运行我自己编译的 QEMU。如果我使用普通的 qemu 命令,我可以运行它,但是当我用我编译的 QEMU 替换系统 QEMU 时会出错。

如果您使用virus edit VM_name,您可以编辑配置。我变了

<emulator>/usr/bin/qemu-system-x86_64</emulator>

进入

<emulator>/home/user/Documents/qemu/build/x86_64-softmmu/qemu-system-x86_64</emulator>

你可能会得到类似下面的东西

 <devices>
    <emulator>/home/user/Documents/qemu/build/x86_64-softmmu/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' discard='unmap'/>
      <source file='/var/lib/libvirt/images/ubuntu20.04.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>

我一开始遇到了权限被拒绝的问题,我在下面引用了这个问题。

https://unix.stackexchange.com/questions/471345/changing-libvirt-emulator-permission-denied

在我更改 AppArmor 配置后(添加“/home/user/Documents/qemu/build/x86_64-softmmu/qemu-system-x86_64 PUx”),我得到了这个:

“错误:不支持的配置:域配置不支持视频模型'qxl' 失败的。再试一次? [y,n,i,f,?]:"

我的系统是 ubuntu-22.04LTS,Libvirt 版本是 8.0.0(通过 apt-get 安装),系统中的 QEMU 是 6.2.0(通过 apt-get 安装)。我编译的QEMU来自https://gitlab.com/virtio-fs/qemu.git,分支是virtio-fs-dev(版本是QEMU 7.0.0)。

在编译 QEMU 时是否有我忘记启用的功能?或者有没有教程可以使用我编译的QEMU?谢谢!


更新

我发现如果我换成旧型号,上面的 qxl 问题就解决了。但是我还是遇到了权限被拒绝的问题。

这是我从“dmesg”得到的:

[12227.019203] virbr0: port 2(vnet5) entered blocking state
[12227.019211] virbr0: port 2(vnet5) entered disabled state
[12227.019390] device vnet5 entered promiscuous mode
[12227.019765] virbr0: port 2(vnet5) entered blocking state
[12227.019769] virbr0: port 2(vnet5) entered listening state
[12227.179234] audit: type=1400 audit(1654891381.082:487): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="libvirt-16b54d8a-be5c-4530-a8d8-ebc1bd02481d" pid=317483 comm="apparmor_parser"
[12227.233741] audit: type=1400 audit(1654891381.134:488): apparmor="DENIED" operation="exec" profile="libvirt-16b54d8a-be5c-4530-a8d8-ebc1bd02481d" name="/home/xlf/Documents/qemu/build/qemu-system-x86_64" pid=317485 comm="rpc-libvirtd" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[12227.256173] virbr0: port 2(vnet5) entered disabled state
[12227.257559] device vnet5 left promiscuous mode
[12227.257569] virbr0: port 2(vnet5) entered disabled state
[12227.482556] audit: type=1400 audit(1654891381.386:489): apparmor="STATUS" operation="profile_remove" profile="unconfined" name="libvirt-16b54d8a-be5c-4530-a8d8-ebc1bd02481d" pid=317503 comm="apparmor_parser"

我已经将“/home/user/Documents/qemu/build/x86_64-softmmu/qemu-system-x86_64 PUx”添加到文件/etc/apparmor.d/usr.sbin.libvirtd并执行systemctl reload apparmor。

有什么解决办法吗?谢谢。

【问题讨论】:

  • qemu-kvm -vga qxl 说什么?
  • 感谢提醒。当我使用我编译的 QEMU 时,我得到:“qemu-system-x86_64: QXL VGA not available”,(系统 QEMU 支持它)。好像和香料有关。我安装了 spice-vdagent、spice-client-gtk,重新配置了我的 QEMU 并编译了它。好像不行。
  • 在您的./configure 步骤中,“spice 协议支持”行报告了什么? (以及检查 spice-protocol 和 spice-server 的运行时依赖关系?)
  • 感谢提醒。我意识到问题出在设备兼容性上。此 qxl 错误已修复,我将 VM 更改为旧机器型号。

标签: virtual-machine virtualization qemu libvirt


猜你喜欢
  • 1970-01-01
  • 2011-10-21
  • 2013-09-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-29
  • 1970-01-01
相关资源
最近更新 更多