gpt4 book ai didi

virtualization - 使用与 AppArmor 相关的 libvirt 错误创建虚拟机

转载 作者:行者123 更新时间:2023-12-04 14:03:27 26 4
gpt4 key购买 nike

我正在尝试使用以下命令使用 libvirt 创建虚拟机:

virsh create file
"file"的内容:
<domain type='qemu' id='3'>
<name>testvm</name>
<memory>100</memory>
<vcpu>1</vcpu>
<os>
<type arch='i686'>hvm</type>
</os>
<devices>
<disk type='file' device='disk'>
<source file='/libtmp/VM-linux.0.2.img'/>
<target dev='hdc'/>
</disk>
</devices>
<on_reboot>restart</on_reboot>
<on_poweroff>preserve</on_poweroff>
<on_crash>restart</on_crash>
</domain>

这是发生的错误。
error: Failed to create domain from file
error: internal error cannot load AppArmor profile 'libvirt-9cb01efc-ed3b-ff8e-4de5-7227d311dd15'

我可以在不加载图像文件的情况下创建虚拟机。

每次配置文件名称不断变化。我尝试停止它并创建虚拟机,但我遇到了同样的错误。

任何指针都会非常有帮助。

最佳答案

这是 libvirt 中的一个错误。见 https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/665531

使用“virsh edit domainname”命令编辑虚拟域的xml定义。将 xml 定义中的 type='host_device' 替换为 type='raw'。

关于virtualization - 使用与 AppArmor 相关的 libvirt 错误创建虚拟机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12069297/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com