![Qemu 和 qemu-kvm 在 ubuntu 16.04 上失败](https://linux22.com/image/1090028/Qemu%20%E5%92%8C%20qemu-kvm%20%E5%9C%A8%20ubuntu%2016.04%20%E4%B8%8A%E5%A4%B1%E8%B4%A5.png)
我从 Ubuntu 14.04 升级到了 16.04。Kvm 管理器无法工作。我尝试删除它,现在尝试重新安装时,运行以下命令时仍然出现相同的错误sudo apt install qemu qemu-kvm
Setting up libvirt-bin (1.3.1-1ubuntu10.10) ...
Job for libvirt-bin.service failed because the control process exited with error code. See "systemctl status libvirt-bin.service" and "journalctl -xe" for details.
invoke-rc.d: initscript libvirt-bin, action "start" failed.
● libvirt-bin.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirt-bin.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since lun 2017-06-26 16:34:35 EDT; 4ms ago
Docs: man:libvirtd(8)
http://libvirt.org
Process: 13371 ExecStart=/usr/sbin/libvirtd $libvirtd_opts (code=exited, status=6)
Main PID: 13371 (code=exited, status=6)
CGroup: /system.slice/libvirt-bin.service
└─13389 /usr/sbin/libvirtd
jun 26 16:34:35 john-Lenovo-Yoga-2-Pro systemd[1]: Failed to start Virtualiza...
jun 26 16:34:35 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Unit ...
jun 26 16:34:35 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Faile...
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package libvirt-bin (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libvirt-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我运行journalctl -xe
命令时,我得到这个输出
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro audit[13459]: AVC apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=13459 comm="libvirtd" family="netlink" sock_type="raw" protocol=0 requested_m
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro libvirtd[13459]: cannot connect to netlink socket with protocol 0: Permission denied
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro kernel: audit: type=1400 audit(1498509276.292:198): apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=13459 comm="libvirtd" family="netlink" sock
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Main process exited, code=exited, status=6/NOTCONFIGURED
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: Failed to start Virtualization daemon.
-- Subject: Unit libvirt-bin.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit libvirt-bin.service has failed.
--
-- The result is failed.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Unit entered failed state.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Failed with result 'exit-code'.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Service hold-off time over, scheduling restart.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: Stopped Virtualization daemon.
-- Subject: Unit libvirt-bin.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit libvirt-bin.service has finished shutting down.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: Starting Virtualization daemon...
-- Subject: Unit libvirt-bin.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit libvirt-bin.service has begun starting up.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro audit[13481]: AVC apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=13481 comm="libvirtd" family="netlink" sock_type="raw" protocol=9 requested_m
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro libvirtd[13481]: libvirt version: 1.3.1, package: 1ubuntu10.10 (Christian Ehrhardt <[email protected]> Tue, 16 May 2017 12:38:02 +0200)
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro libvirtd[13481]: hostname: john-Lenovo-Yoga-2-Pro
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro libvirtd[13481]: Unable to initialize audit layer: Permission denied
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro audit[13481]: AVC apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=13481 comm="libvirtd" family="netlink" sock_type="raw" protocol=0 requested_m
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro libvirtd[13481]: cannot connect to netlink socket with protocol 0: Permission denied
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Main process exited, code=exited, status=6/NOTCONFIGURED
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: Failed to start Virtualization daemon.
-- Subject: Unit libvirt-bin.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit libvirt-bin.service has failed.
--
-- The result is failed.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Unit entered failed state.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Failed with result 'exit-code'.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro sudo[13080]: pam_unix(sudo:session): session closed for user root
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Service hold-off time over, scheduling restart.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: Stopped Virtualization daemon.
-- Subject: Unit libvirt-bin.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit libvirt-bin.service has finished shutting down.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: libvirt-bin.service: Start request repeated too quickly.
jun 26 16:34:36 john-Lenovo-Yoga-2-Pro systemd[1]: Failed to start Virtualization daemon.
-- Subject: Unit libvirt-bin.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit libvirt-bin.service has failed.
--
-- The result is failed.
答案1
这修复了它
sudo systemctl stop apparmor.service
sudo apt-get -f install
sudo systemctl start apparmor.service