AppArmor 错误:在更新版本的 libvirt (1.2.12) 上启动 lxc 后出现“无效的 VM 定义”

比拉尔牛

我正在尝试在较新版本的 libvirtd 上启动 LXC,但启动失败并出现以下错误:

$ virsh -c lxc: start textlxc
error: Failed to start domain testlxc
error: internal error: cannot load AppArmor profile 'libvirt-dfb2c573-05cb-4ca3-9e46-bea6cebf0f9f'

/var/log/libvirt/libvirtd.log 中的错误消息

2015-06-23 12:13:12.306+0000: 14141: error : virCommandWait:2532 : internal error: Child process (/usr/lib/libvirt/virt-aa-helper -p 0 -c -u libvirt-dfb2c573-05cb-4ca3-9e46-bea6cebf0f9f) unexpected exit status 1: virt-aa-helper: error: /proc/meminfo
virt-aa-helper: error: skipped restricted file
virt-aa-helper: error: invalid VM definition

2015-06-23 12:13:12.306+0000: 14141: error : AppArmorGenSecurityLabel:468 : internal error: cannot load AppArmor profile 'libvirt-dfb2c573-05cb-4ca3-9e46-bea6cebf0f9f'

这是我的testlxc.xml文件

<domain type='lxc'>
  <name>testlxc</name>
  <uuid>dfb2c573-05cb-4ca3-9e46-bea6cebf0f9f</uuid>
  <memory unit='KiB'>4048292</memory>
  <currentMemory unit='KiB'>4048292</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/sbin/init</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/var/lib/libvirt/filesystems/testlxc'/>
      <target dir='/'/>
    </filesystem>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/var/lib/libvirt/filesystems/testlxc-data'/>
      <target dir='/mnt/data'/>
    </filesystem>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/var/run/testlxc/lxc'/>
      <target dir='/mnt/run'/>
    </filesystem>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/proc/meminfo'/>
      <target dir='/proc/meminfo'/>
    </filesystem>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='lxc' port='0'/>
      <alias name='console0'/>
    </console>
  </devices>
</domain>

运行的 Libvirt 版本是 1.2.12,我之前一直在 1.2.2 版本上成功运行 lxc。

$ libvirtd --version
libvirtd (libvirt) 1.2.12
瓦拉克

我已经将问题追溯到virt-aa-helper实用程序中的域 XML 验证这是应该根据需要生成 apparmor 配置文件的实用程序。失败的不是XML的结构,而是报告的错误似乎表明情况确实如此。对于 LXC 容器,函数virDomainDefParseXML函数内部的逻辑验证domain_conf.c被破坏。

我对 libvirt 代码不够熟悉,无法修改此共享区域 - 我可能破坏了其他东西,但以下补丁似乎有效:

if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) {
    /* If the logic here seems fairly arbitrary, that's because it is :)
     * This is duplicating how the code worked before
     * CapabilitiesDomainDataLookup was added. We can simplify this,
     * but it would take a bit of work because the test suite fails
     * in numerous minor ways. */
    bool use_virttype = ((def->os.arch == VIR_ARCH_NONE) ||
        !def->os.machine);
    virCapsDomainDataPtr capsdata = NULL;

阅读

if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) {
    /* If the logic here seems fairly arbitrary, that's because it is :)
     * This is duplicating how the code worked before
     * CapabilitiesDomainDataLookup was added. We can simplify this,
     * but it would take a bit of work because the test suite fails
     * in numerous minor ways. */
    bool use_virttype = (def->os.type != VIR_DOMAIN_OS_TYPE_EXE) &&
        ((def->os.arch == VIR_ARCH_NONE) ||
          !def->os.machine);
    virCapsDomainDataPtr capsdata = NULL;

不幸的是,我找不到不重新编译的方法来解决这个问题。如果你使用的是 64 位机器,你可以从这个链接下载我在本地构建的包(原谅我的 Microsoft 帐户)。

注意:要查看您是否受到此错误的影响,请在命令提示符中输入以下内容(从该论坛帖子中复制):

$ export VM=foo ; virsh -c lxc:// dumpxml $VM |\
   sudo /usr/lib/libvirt/virt-aa-helper -c \
   -u libvirt-`virsh -c lxc:// domuuid $VM`

foo失败的 lxc 容器的名称在哪里如果你看到输出

virt-aa-helper: error: could not parse XML
virt-aa-helper: error: could not get VM definition

那么可能是同样的错误。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

KVM:无法销毁VM(权限被拒绝)-AppArmor阻止Libvirt

来自分类Dev

更新版本时,indexeddb数据库上的约束错误,仅此而已

来自分类Dev

尝试在VM上启动仿真器时出现错误

来自分类Dev

如果我在开发人员控制台中以更新版本更改api密钥,Google Maps V2将对Playstore上的我的应用程序的先前版本产生影响

来自分类Dev

将加密(从PyCrypto)安装到更新版本时出现问题

来自分类Dev

如何在Ubuntu上安装PEAR / PHPUnit的更新版本?

来自分类Dev

如何在Linux Mint上使用更新版本的GTK +运行Eclipse Mars

来自分类Dev

如何在 Ubuntu 16.04 LTS 及更新版本上正确安装 MATE 桌面环境?

来自分类Dev

mysql文件夹重定位后出现Apparmor错误

来自分类Dev

Docker / LXC中的AppArmor配置文件

来自分类Dev

libvirt不会以“错误:'cgroup.subtree_control'的无效值'+ cpu':无效的参数”启动虚拟机

来自分类Dev

在databricks上安装新版本后,pandas版本未更新

来自分类Dev

如何在没有管理员权限的Debian Linux上安装更新版本的GNU utils(coreutils)?

来自分类Dev

在 API 19 上使用相机拍摄图像崩溃,但它适用于 API 21 和更新版本

来自分类Dev

即使状态更改后触发正常,回调也不会收到状态的更新版本

来自分类Dev

更新版本后客户端上的套接字 IO 套接字 ID 不同(EasyRTC)

来自分类Dev

将android studio 1升级到2后出现错误,无法启动

来自分类Dev

更新到backbonejs最新版本后出现分页错误

来自分类Dev

为什么在Proxmox VE计算机的LXC容器中的“ mount.cifs”上出现“安装错误(1):不允许操作”?

来自分类Dev

Virtualbox更新后无法启动VM

来自分类Dev

在Debian Buster上启动容器时出现lxc(-net?)问题

来自分类Dev

当 vmware 硬件定义更新到版本 10 以上时,vsphere 中的 Juju vm 无法启动

来自分类Dev

TortoiseSVN-恢复到以前的版本后,如何更新到服务器上的最新版本?

来自分类Dev

gcc链接错误:未定义对符号'_ZN2cv5flann12SearchParamsC1Eifb'的引用,

来自分类Dev

Docker与VM和LXC的关系

来自分类Dev

guestfs-xxxxxx VM出现在LibVirt中(virt-manager)

来自分类Dev

在VirtualBox上创建VM时出现错误

来自分类Dev

无法启动libvirt

来自分类Dev

Windows更新后,2014年12月11日出现启动问题VirtualBox 4.3.20,

Related 相关文章

  1. 1

    KVM:无法销毁VM(权限被拒绝)-AppArmor阻止Libvirt

  2. 2

    更新版本时,indexeddb数据库上的约束错误,仅此而已

  3. 3

    尝试在VM上启动仿真器时出现错误

  4. 4

    如果我在开发人员控制台中以更新版本更改api密钥,Google Maps V2将对Playstore上的我的应用程序的先前版本产生影响

  5. 5

    将加密(从PyCrypto)安装到更新版本时出现问题

  6. 6

    如何在Ubuntu上安装PEAR / PHPUnit的更新版本?

  7. 7

    如何在Linux Mint上使用更新版本的GTK +运行Eclipse Mars

  8. 8

    如何在 Ubuntu 16.04 LTS 及更新版本上正确安装 MATE 桌面环境?

  9. 9

    mysql文件夹重定位后出现Apparmor错误

  10. 10

    Docker / LXC中的AppArmor配置文件

  11. 11

    libvirt不会以“错误:'cgroup.subtree_control'的无效值'+ cpu':无效的参数”启动虚拟机

  12. 12

    在databricks上安装新版本后,pandas版本未更新

  13. 13

    如何在没有管理员权限的Debian Linux上安装更新版本的GNU utils(coreutils)?

  14. 14

    在 API 19 上使用相机拍摄图像崩溃,但它适用于 API 21 和更新版本

  15. 15

    即使状态更改后触发正常,回调也不会收到状态的更新版本

  16. 16

    更新版本后客户端上的套接字 IO 套接字 ID 不同(EasyRTC)

  17. 17

    将android studio 1升级到2后出现错误,无法启动

  18. 18

    更新到backbonejs最新版本后出现分页错误

  19. 19

    为什么在Proxmox VE计算机的LXC容器中的“ mount.cifs”上出现“安装错误(1):不允许操作”?

  20. 20

    Virtualbox更新后无法启动VM

  21. 21

    在Debian Buster上启动容器时出现lxc(-net?)问题

  22. 22

    当 vmware 硬件定义更新到版本 10 以上时,vsphere 中的 Juju vm 无法启动

  23. 23

    TortoiseSVN-恢复到以前的版本后,如何更新到服务器上的最新版本?

  24. 24

    gcc链接错误:未定义对符号'_ZN2cv5flann12SearchParamsC1Eifb'的引用,

  25. 25

    Docker与VM和LXC的关系

  26. 26

    guestfs-xxxxxx VM出现在LibVirt中(virt-manager)

  27. 27

    在VirtualBox上创建VM时出现错误

  28. 28

    无法启动libvirt

  29. 29

    Windows更新后,2014年12月11日出现启动问题VirtualBox 4.3.20,

热门标签

归档