<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>libvirtd &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/libvirtd/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Mon, 06 Mar 2023 10:36:05 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>Unable to complete install: internal error: cannot load AppArmor profile libvirt</title>
		<link>https://blog.richliu.com/2023/03/05/5128/unable-to-complete-install-internal-error-cannot-load-apparmor-profile-libvirt/</link>
					<comments>https://blog.richliu.com/2023/03/05/5128/unable-to-complete-install-internal-error-cannot-load-apparmor-profile-libvirt/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 05 Mar 2023 08:12:43 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[libvirtd]]></category>
		<category><![CDATA[qemu]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5128</guid>

					<description><![CDATA[<p>ARM64 系統 + Ubuntu 20.04 裝 virt-manager 碰到一些問題，第一關是碰到 li [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2023/03/05/5128/unable-to-complete-install-internal-error-cannot-load-apparmor-profile-libvirt/">Unable to complete install: internal error: cannot load AppArmor profile libvirt</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>ARM64 系統 + Ubuntu 20.04 裝 virt-manager 碰到一些問題，第一關是碰到 libvirtd 被 mask 掉了，這個簡單</p>



<span id="more-5128"></span>



<p>下</p>



<pre class="wp-block-preformatted">systemctl umask libvertd </pre>



<p>就可以 unmask 了，這指令我實在是太少用，都記不起來以前有沒有碰過，第二關忘了是什麼錯誤訊息，大致上好像是沒辦法 link 到 libvirtd-ro 之類的，索性手動啟動所有的 libvirtd-* service </p>



<pre class="wp-block-preformatted">$ sudo systemctl start virtlogd
$ sudo systemctl enable virtlogd
$ sudo systemctl enable virtlockd
$ sudo systemctl start virtlockd
$ sudo systemctl start libvirtd-admin.socket
$ sudo systemctl enable libvirtd-admin.socket
$ sudo systemctl start libvirtd-ro.socket
$ sudo systemctl enable libvirtd-ro.socket
$ sudo systemctl enable libvirtd.socket
$ sudo systemctl start libvirtd.socket
</pre>



<p>最後應該是出現了一個 AppArmor 的錯誤訊息，像是這個</p>



<pre class="wp-block-preformatted">Unable to complete install: 'internal error: cannot load AppArmor profile 'libvirt-df1a8e70-7a27-41e4-a7cc-ea065d3b3699''

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2089, in _do_async_install
    guest.installer_instance.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 542, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 491, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4034, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: internal error: cannot load AppArmor profile 'libvirt-df1a8e70-7a27-41e4-a7cc-ea065d3b3699'
</pre>



<p>試過了很多方式，都沒有辦法繞過 AppArmor ，最後只好放大絕，不要讓 qemu 使用 AppArmor ，不安全就算了對吧，</p>



<pre class="wp-block-preformatted">$ sudo vim /etc/libvirt/qemu.conf

# Set
security_driver = "none"</pre>



<p>然後找到　security_driver  這個參數，設定成 &#8220;none&#8221; ，再重新啟動 libvirtd 就可以了<br />真是莫名其妙的 BUG ，因為其他台機器沒有碰到類似的問題</p>



<p>ref.<br /><a href="unable to set AppArmor profile" target="_blank" rel="noreferrer noopener">libvirt: error : unable to set AppArmor profile</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2023/03/05/5128/unable-to-complete-install-internal-error-cannot-load-apparmor-profile-libvirt/">Unable to complete install: internal error: cannot load AppArmor profile libvirt</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2023/03/05/5128/unable-to-complete-install-internal-error-cannot-load-apparmor-profile-libvirt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
