<?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>virt-manager &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/virt-manager/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Sun, 27 Jul 2025 12:11:15 +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>[Gentoo] virt-manager/libvirt virbr0 doesn&#8217;t exist</title>
		<link>https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/</link>
					<comments>https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 27 Jul 2025 12:11:11 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[virt-manager]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6345</guid>

					<description><![CDATA[<p>Once when I reboot the system, system shows, there is n [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/">[Gentoo] virt-manager/libvirt virbr0 doesn&#8217;t exist</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Once when I reboot the system, system shows, there is no virbr0 </p>



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



<p>First, check the interface states, default network is inactive</p>



<pre class="wp-block-preformatted"># virsh net-list --all<br /> Name              State    Autostart   Persistent<br />----------------------------------------------------<br /> bridged-network   active   yes         yes<br /> default           inactive yes         yes</pre>



<p>Manual restart, it shows following message</p>



<pre class="wp-block-preformatted"># virsh net-start default<br />error: Failed to start network default<br />error: internal error: Child process (VIR_BRIDGE_NAME=virbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper) unexpected exit status 2:<br />dnsmasq: failed to create listening socket for 192.168.123.1: Address already in use</pre>



<p>The root cause is, when libvirt start the default network, it will also bring up the dnsmasq as dns server, but if this system also has DNS server like named or another dnsmasq service, it will have port conflict. <br />Tried to modify the yaml to assign dnsmasq to another port, but doens&#8217;t work (old configure is to use /etc/dnsmasq.conf, but seems it will use default.xml after update the libvirt )</p>



<p>add <code><strong>&lt;dns enable="no"/></strong></code> to default network setting can solve this issue, ex:</p>



<pre class="wp-block-preformatted"># virsh net-edit default<br /><br />&lt;network><br />  &lt;name>default&lt;/name><br />  &lt;uuid>cdf10e75-0299-43b5-8c93-e6943e261ef3&lt;/uuid><br />  &lt;forward mode='nat'/><br />  &lt;bridge name='virbr0' stp='on' delay='0'/><br />  &lt;mac address='52:54:00:66:c4:a3'/><br />  <strong>&lt;dns enable='no'/></strong><br />  &lt;ip address='192.168.122.1' netmask='255.255.255.0'><br />    &lt;dhcp><br />      &lt;range start='192.168.122.2' end='192.168.122.254'/><br />    &lt;/dhcp><br />  &lt;/ip><br />&lt;/network></pre>



<p>ref. <br />https://serverfault.com/questions/937188/disable-or-change-port-of-dnsmasq-service-in-libvirt</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/">[Gentoo] virt-manager/libvirt virbr0 doesn&#8217;t exist</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/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] Upgrade From x64 to ARM64</title>
		<link>https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/</link>
					<comments>https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 03 Feb 2024 14:53:39 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[virt-manager]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5761</guid>

					<description><![CDATA[<p>Describe how to move Gentoo x64 to ARM64 platform. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/">[Gentoo] Upgrade From x64 to ARM64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>時隔多年，終於又迎來一次大升級，之前寫過幾篇升級的文章，像是<br />電腦升級 <a href="https://blog.richliu.com/2015/08/06/1827/%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a-i7-5775c-asus-z97-ausb3-1/">i7 5775c + ASUS Z97-A/USB3.1</a> : 後來 Desktop 還升級了二次，一次是換 i5-9600K，中間還買了 2080 ，最近一次是換 AMD 7900，又買了一張 3090 （當然是買前生產力買後遊戲機），不過因為懶得寫就沒記錄了<br /><a href="https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/">[Gentoo] 電腦升級案 32bit -> 64bit Linux</a> : 十年前的升級紀錄，和本篇要寫的文章很像，不過這次就是升級到不同平台架構的機器上了<br /><a href="https://blog.richliu.com/2006/10/17/366/%e5%b1%b1%e5%af%a8%e6%9b%b4%e6%96%b0%e8%a8%98%e9%8c%84/">山寨更新記錄</a> : 早年 BBS 的更新紀錄，現在的話就不會用這種 Raid 盒，都是改用 Software Raid ，便宜！</p>



<p>這次升級要從 x64 平台升級到 ARM64 平台，雖然目前 Linux 下 ARM64 支援度還是不錯，但是兩個平台能用的東西還是有差異，主要是紀錄一下升級過程中有什麼需要注意的事情</p>



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



<h2 class="wp-block-heading">ARM64 Hardware Prepareation </h2>



<p>CPU Board: Ampere Altra CPU + AsRock ALTRAD8U : 這個組合現在已經能在 <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">newegg </a>上買到了，也是目前最強大的 ARM64 平台，當 homelab 平台非常適合<br /><br />DRAM: 買這種主機板用的都是 RDIMM ，有可能便宜有可能貴，可以查 Gigabyte 的 QVL List[<a href="https://www.gigabyte.com/tw/Enterprise/Rack-Server/R152-P33-rev-100#Support-QvlPdfSupportList" target="_blank" rel="noopener">Ref</a>] 內的 DRAM list 購買，有朋友就是在日本買到DDR4 2933 32GB RDIMM 一隻5000羊的DDR，目前匯率 NT$1,100.- 非常便宜<br /><br />Network: AsRock ALTRAD8U 有 1*Intel i210 Ethernet 和 2*10G Intel x550 Ethernet ，這部份到不是問題，我另外拿了舊的 Intel x540 4 Port ethernet 當小 switch 用<br /><br />SATA:  這種板子預設都沒有 SATA interface 了，所以要買 SATA 卡，有 PCIe 轉 SATA ，這個要注意 PCIe bandwidth 和 SATA 數量，一分錢一份貨。<br />如果要追求速度，淘寶上也可以買到便宜 SAS 外接 SATA ，淘寶的 LSI SAS 8port internal 卡大部份 NT$2500 到 NT$6000 都有，記得買轉接線要看好規格，SAS 接頭的規格很多，一不小心就會弄錯<br /><br />SSD: 板子上介面有 2* M.2 2280，如果覺得不夠，可以買 OCU 轉 U.2 轉接線，或是還有 PCIe slot ，可以買 PCIe 轉 M.2 都可以。但是 U.2 的硬碟不一定好買，而且常常價位偏高，但是相對上是比較便宜的選擇</p>



<h2 class="wp-block-heading">Software Move To ARM64 Platform </h2>



<h3 class="wp-block-heading">QEMU/Libvirt</h3>



<p>這部份應該是最難的部份，不過理論上也不是不可以，我原來是 VirtualBox ，但是 ARM64 沒有 VirtualBox ，只有 Proxmox 有，剛看了一下，還支援 riscv64,loongarch64 [<a href="https://github.com/jiangcuo/Proxmox-Port" target="_blank" rel="noopener">ref</a>]，不過我個人不太想再學一套，所以還是用 virt-manager/libvirtd 這套，一般用途 virt-manager 和 libvirtd 應該也很夠用了。</p>



<p>目前用到現在都可以用，Ubuntu 22.04，Windows 10 for x86，Windows 11 for ARM，安裝沒什麼問題。只有 Windows 10 for x86 非常慢，慢到我不想再開了，不知道為什麼。</p>



<p><strong>Qemu bridge devices</strong>: 這個應該是問題，如果是以前用 VirtualBox ，可以直接選 NIC card interface ，但是 virt-manager 似乎沒這個選項，所以要直接設定到 bridge device，不過影響不是很大，就只是設定一個 bridge device，然後將 host internet ethernet port device 綁上去就好了</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" width="824" height="383" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-12.png" alt="" class="wp-image-5762" style="aspect-ratio:2.151436031331593;width:784px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-12.png 824w, https://blog.richliu.com/wp-content/uploads/2024/02/image-12-600x279.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-12-768x357.png 768w" sizes="(max-width: 824px) 100vw, 824px" /></figure></div>


<p>其他可能是如果 Libvirt 要用 graphic 輸出，不能用 qxl ，只能用 VGA or ramfb ，尤其是 windows 只能用 ramfb，如果 Guest 是 Linux 可以用 VGA ，顯示比較正常，如果連 GUI 都沒有，就直接看 console 輸出吧，問題更少</p>



<h3 class="wp-block-heading">Qemu file sharing </h3>



<p>QEMU 支援 virtiofs ，不過這個功能在 gentoo 內 ARM64 是不能用的，因為不能用，所以我也不知道 x64 那邊會有什麼限制<br />另外一個是 virtio-9p ，這個缺點是分享進 VM  之後，沒辦法使用 user 權限存取，用 root 身份限制也很多，像是存取 non-root user 檔案會有問題[<a href="https://serverfault.com/questions/559726/kvm-guest-cannot-write-to-9p-share-owned-by-non-root" target="_blank" rel="noopener">ref</a>]<br /><br />有其他需求的人可以考慮改用 samba or nfs ，但是效能就會大大下降了，這點可能是有效能需求的人要考量的</p>



<h3 class="wp-block-heading">Firewall </h3>



<p>原來的 Firewall script 似乎沒辦法和 Libvirt 一起工作，我又不想修改，最後比較簡單的作法就是在我的 script 執行完之後，再重啟 libvirtd ，這樣就正常了。<br />正常後別忘了執行 /etc/init.d/iptables save 儲存，這樣重開機之後才會正常執行 firewall rule. </p>



<h3 class="wp-block-heading">Docker</h3>



<p>試了一下似乎沒什麼問題，但是目前沒什麼要跑的 APP ，所以應該測不出什麼<br />不過之前 arm64 k8s docker [<a href="https://blog.richliu.com/2023/09/17/5329/arm64-kubernetes-qemu-metallb-linkerd-numa/">ref</a>]都跑過了，應該踩雷的機會低很多</p>



<h3 class="wp-block-heading">Other Software</h3>



<p>在 Linux 下轉移到 ARM64 平台問題不大，大部份的 software 都是安裝之後 copy 過去<br />就算是在系統上有資料的 mysql 和 apache 都是這樣</p>



<p>這次我用了一個方式轉移 configuration files<br />1. 將要轉移的程式設定檔 commit 到 git server <br />2. 從新機器將 git server 拉回來 configuration files <br />3. diff 之後將新的設定套上去<br /><br />因為我是 gentoo 玩家，gentoo 升級 packages 常常需 merge configuration files 了，所以這個轉移的過程不難，只是很耗費時間而已。不過因此絕大部份的設定檔都沒有問題，反而是少數系統本身自帶的設定檔反而怪怪的</p>



<h3 class="wp-block-heading">KDE</h3>



<p>之前我都遠端跑 vnc + kde ，不過 Gentoo 有個 BUG 就是 plasmashell 的 CPU usage 會很高<br />這次換 virt-manager 之後可以用 ssh remote control VM，發現這個方式還不錯，反正我也只有用到這個功能，KDE 等有需求的時候再開 vnc 就好了，平時是不需要開的</p>



<h2 class="wp-block-heading">搬移步驟</h2>



<p>1. 備份系統碟，以備不時之需<br />2. 重新規劃電腦的網路卡，如果只有一張就直接設成 bridge interface <br />3. software raid 的部份可以參考自己之前的文章 <a href="https://blog.richliu.com/2011/05/16/1078/linux-software-raid-%E7%B3%BB%E7%B5%B1%E8%BD%89%E7%A7%BB/">Linux Software Raid 系統轉移</a><br />4. UEFI 的部份可以參考自己之前的文章<a href="https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/"> Gentoo ARM64 UEFI Install Guide</a><br />5. 搬移 APPs<br />5.1 重要的 APP 才要搬資料，ex: Web, mysql <br />5.2 不重要的 APP 只要搬設定檔，ex: apt-cache-ng, squid 等等<br />5.3 如果是切換平台，要確定 VM 沒問題才能切</p>



<h2 class="wp-block-heading">Known Issues </h2>



<h3 class="wp-block-heading">IPv6 Default Router</h3>



<p>不知道為什麼，在 wan 的 bridge interface 會增加一個 default route fe80::1 ，這個設定會讓 IPv6 失效，後來解決方式是在 LAN 端加上一個 IP address fe80::1 才解決</p>



<h3 class="wp-block-heading">efi boot </h3>



<p>因為我系統碟是做 software raid  ，每次編完 kernel 再 update grub 時，記得 efi boot 時有時會 fail ，試著將兩顆 nvme 都 mount 上來加上再安裝一次 efi partition 似乎才會正常，找了一下沒找到原因，不管了，反正能動就好</p>



<pre class="wp-block-preformatted">grub-mkconfig -o /boot/grub/grub.cfg
umount /boot/efi
mount /dev/nvme0n1p1 /boot/efi
grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=Gentoo
umount /boot/efi
mount /dev/nvme1n1p1 /boot/efi
grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=Gentoo
umount /boot/efi
</pre>



<p>ref.<br />None</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/">[Gentoo] Upgrade From x64 to ARM64</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/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>aarch64/ARM64 virt-install 啟動方法</title>
		<link>https://blog.richliu.com/2017/01/05/2064/aarch64arm64-virt-install-%e5%95%9f%e5%8b%95%e6%96%b9%e6%b3%95/</link>
					<comments>https://blog.richliu.com/2017/01/05/2064/aarch64arm64-virt-install-%e5%95%9f%e5%8b%95%e6%96%b9%e6%b3%95/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 05 Jan 2017 15:19:34 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[virt-install]]></category>
		<category><![CDATA[virt-manager]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2064</guid>

					<description><![CDATA[<p>雖然 ubuntu 有好用的 uvttool-libvirt 可以管理 cloud image , 但是似乎在 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/01/05/2064/aarch64arm64-virt-install-%e5%95%9f%e5%8b%95%e6%96%b9%e6%b3%95/">aarch64/ARM64 virt-install 啟動方法</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>雖然 ubuntu 有好用的 uvttool-libvirt 可以管理 cloud image , 但是似乎在 aarch64/ARM64 的平台上會有問題,<br />
參數傳進去的時候似乎都會叫起來 VGA (cirrus), 但是 QEMU aarch64 上不支援 VGA (至少我用的不支援)<br />
替代方案就是用 Virt Manager<br />
<span id="more-2064"></span></p>
<p>安裝</p>
<pre lang="bash">
$ sudo apt install virt-manager
</pre>
<p>跑一個簡單的 aarch64 image </p>
<pre lang="bash">
$ sudo virt-install --name ubuntu-aarch64 --ram 2048 --arch aarch64 --boot uefi \
--disk /home/test/ubuntu.img,device=disk,bus=virtio \
--boot machine=virt,kernel=trusty-kernel,kernel_args="console=ttyAMA0 root=/dev/vda1 rw kgdboc=ttyAMA0,115200" \
--network bridge:virbr0 \
--os-type=linux \
--nographics \
--noautoconsole
</pre>
<p>ubuntu.img 是預先準備好的 <a href="https://cloud-images.ubuntu.com/" target="_blank" rel="noopener">ubuntu cloud image</a>, 16.04 才可以支援比較多的 ARM64 平台.<br />
14.04 支援的就少很多. </p>
<p>以上的參數比較重要的是 &#8211;noautoconsole, 這樣執行時就不會等在那邊, 會自動啟動. </p>
<p>&#8211;noautoconsole will install vm to libvirt without connect to console </p>
<p>&#8212;- 2017/03/10 &#8212;-<br />
也可以用 virt-install + netboot install</p>
<p>先建立 image </p>
<pre lang="bash">$ qemu-img create -f qcow2 ./name.qcow2 30G </pre>
<p>再執行 virt-install , 目前測過 14.04 和 16.04 , 只有 16.04 成功, 猜想是 ports 那邊少了什麼東西</p>
<pre lang="bash">
$ sudo virt-install --name ubuntu-aarch64 --ram 4096 --vcpus 4 --arch aarch64 \
        --boot uefi \
        --disk /home/richliu/disk.qcow2,device=disk,bus=virtio \
        --network bridge:virbr0 \
        --os-type=linux \
        --nographics \
        --location 'http://ports.ubuntu.com/dists/xenial/main/installer-arm64/'
</pre>
<p>這個參數可以順利安裝完, 然後再啟動系統就好</p>
<p>&#8212;- 2017/04/26 &#8212;-<br />
如果是要裝 ARM64 Trusty-Update 的 Netboot kernel . 要動一下小技巧<br />
1) 先在 host VM 上安裝 apache2<br />
2) 到 /var/www/html 上 mirror http://ports.ubuntu.com/dists/trusty-updates/main/installer-arm64/current/images/ 下的<br />
* MANIFEST<br />
* MANIFEST.udebs<br />
* xenial-generic/netboot => </p>
<p>目錄要照著放, 所以會是</p>
<pre lang="bash">
$ cd /var/www/html
$ mkdir -p dists/trusty-updates/main/installer-arm64/current/images/
$ cd dists/trusty-updates/main/installer-arm64/current/images/
$ lftp http://ports.ubuntu.com/dists/trusty-updates/main/installer-arm64/current/images/
[download blah blah]
$ mv xenial-generic/netboot .
</pre>
<p>然後 &#8211;location 指到 http://[ARM64 Server IP] 這樣就可以了, ex:</p>
<pre lang="bash">
virt-install --name ubuntu-aarch64 --ram 8192 --vcpus 4 --arch aarch64 \
--boot uefi \
--disk /root/disk.qcow2,device=disk,bus=virtio \
--network bridge:virbr0,model=virtio \
--os-type=linux \
--nographics \
--location http://10.102.81.16/dists/trusty-updates/main/installer-arm64
</pre>
<p>對了, 這邊的 model=virtio 是強迫 network interface 不要用 vhost, 而是用 virtio</p>
<pre lang="bash">
$ virsh start ubuntu-aarch64
$ virsh connect ubuntu-aarch64
</pre>
<p>ref.<br />
<a href="http://opennodecloud.com/opennode-os/2013/01/01/howto-kvm-guest-install.html" target="_blank" rel="noopener">KVM Guest virt-install examples with virtio drivers</a><br />
<a href="https://raymii.org/s/articles/virt-install_introduction_and_copy_paste_distro_install_commands.html" target="_blank" rel="noopener">Installing Virtual Machines with virt-install, plus copy pastable distro install one-liners</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/01/05/2064/aarch64arm64-virt-install-%e5%95%9f%e5%8b%95%e6%96%b9%e6%b3%95/">aarch64/ARM64 virt-install 啟動方法</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/2017/01/05/2064/aarch64arm64-virt-install-%e5%95%9f%e5%8b%95%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
