<?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>18.04 &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/18-04/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Mon, 21 Mar 2022 08:01:33 +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>Install Kubernetes on ARM64 Ubuntu 18.04 (with QEMU)</title>
		<link>https://blog.richliu.com/2019/09/25/4160/install-kubernetes-on-arm64-ubuntu-18-04/</link>
					<comments>https://blog.richliu.com/2019/09/25/4160/install-kubernetes-on-arm64-ubuntu-18-04/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 25 Sep 2019 03:39:36 +0000</pubDate>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[18.04]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[flannel. qemu]]></category>
		<category><![CDATA[k8s]]></category>
		<category><![CDATA[kubernetes]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[weave]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4160</guid>

					<description><![CDATA[<p>Install Kubernetes on Ubuntu 18.04 is very easy now, bu [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/09/25/4160/install-kubernetes-on-arm64-ubuntu-18-04/">Install Kubernetes on ARM64 Ubuntu 18.04 (with QEMU)</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Install Kubernetes on Ubuntu 18.04 is very easy now, but only for x86 platform. If on ARM64 environment, it might have some other problem. <br />Some old article mentioned a lot of information but software version is too old for deploy a new version software. <br /><br />After a lot of time to have research, here is instruction for how to install Kubernetes on ARM64 Ubuntu 18.04</p>



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



<h2 class="wp-block-heading">Environment</h2>



<p>Hardware : Ampere eMag Server with 128G RAM and 1T storage<br />Kubernetes master and nodes are running in QEMU image, so, we prepared three QEMU  ARM64 ubuntu 18.04 images for kubernetes running. It also can use two VM to run this demo. </p>



<h2 class="wp-block-heading">Prepare QEMU Image</h2>



<p>It can download Ubuntu bionic cloud image from Taiwan mirror site</p>



<pre class="wp-block-preformatted">wget http://ftp.yzu.edu.tw/Linux/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-arm64.img </pre>



<p>or international mirror site </p>



<pre class="wp-block-preformatted">https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-arm64.img</pre>



<h4 class="wp-block-heading">Install Necessary Package  </h4>



<p>Run following command to install necessary packages . </p>



<pre class="wp-block-preformatted">apt install -y qemu-system-arm bridge-utils cloud-image-utils git qemu-efi</pre>



<h4 class="wp-block-heading">Increase QEMU image size</h4>



<pre class="wp-block-preformatted">qemu-img resize bionic-server-cloudimg-arm64.img +200G</pre>



<p>Create UEFI bios and nvram for qemu image boot. </p>



<pre class="wp-block-preformatted">dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64</pre>



<p>Copy Image to three spare images </p>



<pre class="wp-block-preformatted">cp flash0.img flash0-1.img
cp flash0.img flash0-2.img 
cp flash0.img flash0-3.img 
cp flash1.img flash1-1.img
cp flash1.img flash1-2.img
cp flash1.img flash1-3.img
cp  bionic-server-cloudimg-arm64.img   bionic-server-cloudimg-arm64-1.img 
cp  bionic-server-cloudimg-arm64.img   bionic-server-cloudimg-arm64-2.img 
cp  bionic-server-cloudimg-arm64.img   bionic-server-cloudimg-arm64-3.img </pre>



<h2 class="wp-block-heading"> Set up bridge and network devices </h2>



<p>

We already install bridge-utils before, now, it should configure bridge devices.

</p>



<pre class="wp-block-preformatted"> mkdir -p /etc/qemu ; echo "allow br0" > /etc/qemu/bridge.conf </pre>



<p> Because there is only one network interface on machine, we should use this interface as bridge device, save text below (name nic-br.sh or what you like) and modify it to fit your environment. <br /></p>



<pre class="wp-block-preformatted">ORIGNIC=enP6p1s0
ip addr flush $ORIGINIC
brctl addbr br0
brctl addif br0 $ORIGINIC
ifconfig br0 up
ifconfig br0 192.168.110.1 netmask 255.255.0.0
route add default gw 192.168.1.1
echo nameserver 8.8.8.8 &gt;&gt; /etc/resolv.conf </pre>



<h2 class="wp-block-heading">Configure Hugepage On Host Site (Option)</h2>



<p>Due to previous research on dpdk runs on ARM64 server, so, configure hugepages here. But not necessary for run k8s environment. <br />You can ignore this part </p>



<h4 class="wp-block-heading"> Configure Line Kernel boot command </h4>



<p> It needs to reserve hugepages memory space for Linux kernel, it reserves 32 pages and each pages 1GB, total 32GB. Please modify /etc/default/grub , and add hugepagesz=1GB hugepages=32 to GRUB_CMDLINE_LINUX, ex: </p>



<pre class="wp-block-preformatted">GRUB_CMDLINE_LINUX="console=tty0 hugepagesz=1GB hugepages=32"</pre>



<p> then run foloowing command to update grub.cfg </p>



<pre class="wp-block-preformatted"> update-grub </pre>



<h4 class="wp-block-heading"> Mount hugetlbfs by default </h4>



<p>

If wants to use hugepage, it needs to mount hugetlbfs somewhere, we can create a directory, ex: /mnt/hugepages and mount hugetblsfs there by default.

</p>



<pre class="wp-block-preformatted">mkdir -p /mnt/hugepages 
echo "nodev   /mnt/hugepages                  hugetlbfs       defaults,pagesize=1G    0 0 none" &gt;&gt; /etc/fstab </pre>



<p>Now, please reboot to make huagpage works. </p>



<h2 class="wp-block-heading">Running QEMU</h2>



<p>Following is QEMU script, save it (ex: named run-qemu.sh). It can be more simplification, but this script would be more understand what different. </p>



<pre class="wp-block-preformatted">IMAGE1=bionic-server-cloudimg-arm64-1.img
sudo qemu-system-aarch64 -name vm1 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 8192 \
         -uuid d0000000-1111-1111-1111-11111aaaaaaa \
         -smp 12,sockets=1,cores=12,threads=1 \
         -nographic -nodefaults \
         -pflash flash0-1.img -pflash flash1-1.img \
         -drive file=$IMAGE1,if=none,id=disk1 \
         -device virtio-blk-device,scsi=off,drive=disk1,id=virtio-disk1,bootindex=1 \
         -netdev tap,id=net0,ifname=tap0 \
         -device virtio-net-device,netdev=net0,mac=52:54:00:11:11:11 \
         -mem-path /mnt/hugepages \
         -serial telnet::9001,server,nowait &gt; guest_log-1.txt 2&gt;&gt; guest_log-1.txt &amp;
IMAGE2=bionic-server-cloudimg-arm64-2.img
sudo qemu-system-aarch64 -name vm2 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 8192 \
         -uuid d0000000-2222-2222-2222-22222bbbbbbb \
         -smp 12,sockets=1,cores=12,threads=1 \
         -nographic -nodefaults \
         -pflash flash0-2.img -pflash flash1-2.img \
         -drive file=$IMAGE2,if=none,id=disk2 \
         -device virtio-blk-device,scsi=off,drive=disk2,id=virtio-disk1,bootindex=1 \
         -netdev tap,id=net2,ifname=tap1 \
         -device virtio-net-device,netdev=net2,mac=52:54:00:22:22:22 \
         -mem-path /mnt/hugepages \
         -serial telnet::9002,server,nowait &gt; guest_log-2.txt 2&gt;&gt; guest_log-2.txt &amp;
IMAGE3=bionic-server-cloudimg-arm64-3.img
sudo qemu-system-aarch64 -name vm3 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 8192 \
         -uuid d0000000-3333-3333-3333-33333ccccccc \
         -smp 12,sockets=1,cores=12,threads=1 \
         -nographic -nodefaults \
         -pflash flash0-3.img -pflash flash1-3.img \
         -drive file=$IMAGE3,if=none,id=disk3 \
         -device virtio-blk-device,scsi=off,drive=disk3,id=virtio-disk1,bootindex=1 \
         -netdev tap,id=net3,ifname=tap2 \
         -device virtio-net-device,netdev=net3,mac=52:54:00:33:33:33 \
         -mem-path /mnt/hugepages \
         -serial telnet::9003,server,nowait &gt; guest_log-3.txt 2&gt;&gt; guest_log-3.txt &amp;
sleep 5
brctl addif br0 tap0
brctl addif br0 tap1
brctl addif br0 tap2</pre>



<p>There are some parameters need to understand in QEMU script. <br /><br />-uuid d0000000-1111-1111-1111-11111aaaaaaa \<br /><br />this will assign a unique uuid for each VM, k8s needs different VM run with different uuid and MAC address. <br />It also can use command &#8220;uuidgen&#8221; to generate different uuid for each VM, but here just for debug so assign a &#8220;easy to read&#8221; uuid. <br /><br />-device virtio-net-device,netdev=net3,mac=52:54:00:33:33:33 \<br /><br />Assign a special mac address for VM, because for k8s internal communication, use the same mac address will cause problem, please configure different address before run qemu script. It not easy to modify it after first boot (with cloud image)<br /><br />* Notice, first number for mac address cannot be odd , it would cause problem. <br /><br />-mem-path /mnt/hugepages \<br /><br />Tell VM to use hugepage, if were not configure host with hugepage, please remove this line. </p>



<p>Now,  please run scripts </p>



<pre class="wp-block-preformatted">bash nic-br.sh
bash run-qemu.sh </pre>



<p>Now, it can use telnet to connect each VM&#8217;s console </p>



<pre class="wp-block-preformatted">telnet localhost 9001<br /># or <br />telnet localhost 9002<br /># or <br />telnet localhost 9003</pre>



<p>After system booted/initialed, if you cannot login, please &#8220;killall qemu-system-aarch64&#8221; and follow this article <a href="https://blog.richliu.com/2017/08/31/2165/change-ubuntu-cloud-image-password">Change Ubuntu Cloud Image Password</a> to change all images&#8217;s password.  <br /><br />Somehow, for recent cloud image, it cannot modify password before run qemu script.</p>



<h2 class="wp-block-heading">Install Kubernetes </h2>



<p>There are a lot of article to talk about how to install on Ubuntu, I choice one for reference : <a href="https://vitux.com/install-and-deploy-kubernetes-on-ubuntu/" target="_blank" rel="noopener">Install and Deploy Kubernetes on Ubuntu 18.04 LTS</a><br /><br />Below will shortly note install command here. </p>



<h4 class="wp-block-heading">Install Docker and Kubeadm on every node </h4>



<pre class="wp-block-preformatted">sudo apt update 
sudo apt -y upgrade 

# install and enable docker
sudo apt -y install docker.io 
sudo systemctl enable docker 
sudo systemctl start docker 

# Install k8s
sudo apt -y install apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add 
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
sudo apt update
sudo apt-get install kubeadm -y</pre>



<h4 class="wp-block-heading">Configure Network IP address (Optional)</h4>



<p> Update to you network environment, here we used fix ip address.<br /><br /> Add new record to /etc/hosts   </p>



<pre class="wp-block-preformatted">192.168.110.50     k8s-master
192.168.110.60     k8s-worker-node1
192.168.110.70     k8s-worker-node2</pre>



<p>Please modify /etc/netplan/50-cloud-init.yam, remove dhcp and add fix address. remember, each node has different IP.  Following is only for k8s-master. </p>



<pre class="wp-block-preformatted">network:
     ethernets:
         eth0:
<strong>             addresses: [192.168.110.50/16,]
             gateway4: 192.168.1.1
             nameservers:
                 addresses: [8.8.8.8,8.8.4.4]</strong>
             match:
                 macaddress: '52:54:00:11:11:11'
             set-name: eth0
     version: 2</pre>



<h4 class="wp-block-heading">Configure Host name </h4>



<p>Run following command on master node </p>



<pre class="wp-block-preformatted">sudo hostnamectl set-hostname  k8s-master</pre>



<p> Run following command on other nodes</p>



<pre class="wp-block-preformatted">sudo hostnamectl set-hostname   k8s-worker-node1 
sudo hostnamectl set-hostname   k8s-worker-node2</pre>



<h4 class="wp-block-heading">Disable swap (Option)</h4>



<p>if image is not from cloud image, default Linux enabled swap function, k8s doesn&#8217;t support it, please disable it manually on all nodes and remove swap mount in /etc/fstab. </p>



<pre class="wp-block-preformatted"> sudo swapoff -a </pre>



<h2 class="wp-block-heading">Configure Kubernetes</h2>



<p>Now, we can initial Kubernetes. Run following command</p>



<pre class="wp-block-preformatted"> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 </pre>



<p>wait for few minutes, it will show some result like this </p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="1024" height="749" src="https://blog.richliu.com/wp-content/uploads/2019/09/image-1024x749.png" alt="" class="wp-image-4172" srcset="https://blog.richliu.com/wp-content/uploads/2019/09/image-1024x749.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/09/image-300x220.png 300w, https://blog.richliu.com/wp-content/uploads/2019/09/image-768x562.png 768w, https://blog.richliu.com/wp-content/uploads/2019/09/image.png 1398w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Run following command to assign current account has right to access k8s. </p>



<pre class="wp-block-preformatted">mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre>



<p>Run this command on another node(k8s-worker-node1 and k8s-worker-node2).</p>



<pre class="wp-block-preformatted">sudo kubeadm join 192.168.110.50:6443 --token 46c1oj.i00vyfyn027pgew9 \
     --discovery-token-ca-cert-hash sha256:ed05198cc603ae009a862477bacef329a9e9a2bedc4a040bc4731e6d5cf4f48e</pre>



<figure class="wp-block-image"><img decoding="async" width="1024" height="737" src="https://blog.richliu.com/wp-content/uploads/2019/09/image-1-1024x737.png" alt="" class="wp-image-4174" srcset="https://blog.richliu.com/wp-content/uploads/2019/09/image-1-1024x737.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/09/image-1-300x216.png 300w, https://blog.richliu.com/wp-content/uploads/2019/09/image-1-768x552.png 768w, https://blog.richliu.com/wp-content/uploads/2019/09/image-1.png 1204w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Run get nodes command, it will show current status, the master node status is NotReady, but don&#8217;t worry, it will become Ready after add pod and CNI (container networking interface) plugin. </p>



<pre class="wp-block-preformatted">ubuntu@k8s-master:~$ kubectl get nodes
 NAME         STATUS     ROLES    AGE     VERSION
 k8s-master   NotReady   master   3m42s   v1.16.0</pre>



<p>This action is very import on ARM64 k8s platform, in other document, they told you use flannel or some other document told you used old flannel. all of them not work for me. Please instead flannel with weave net. <br />(Ref <a rel="noreferrer noopener" aria-label="Weave Net for NetworkPolicy (opens in a new tab)" href="https://kubernetes.io/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy/" target="_blank">Weave Net for NetworkPolicy</a> and <a rel="noreferrer noopener" aria-label="CoreDNS is not starting on Ubuntu 18.04.Bionic Beaver #980 (opens in a new tab)" href="https://github.com/kubernetes/kubeadm/issues/980" target="_blank">CoreDNS is not starting on Ubuntu 18.04.Bionic Beaver #980</a>)<br />Run following command to install weave net </p>



<pre class="wp-block-preformatted">kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"</pre>



<figure class="wp-block-image"><img decoding="async" width="1024" height="232" src="https://blog.richliu.com/wp-content/uploads/2019/09/image-2-1024x232.png" alt="" class="wp-image-4175" srcset="https://blog.richliu.com/wp-content/uploads/2019/09/image-2-1024x232.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/09/image-2-300x68.png 300w, https://blog.richliu.com/wp-content/uploads/2019/09/image-2-768x174.png 768w, https://blog.richliu.com/wp-content/uploads/2019/09/image-2.png 1397w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p> Use the following command to view the status of the network:</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="330" src="https://blog.richliu.com/wp-content/uploads/2019/09/image-3-1024x330.png" alt="" class="wp-image-4176" srcset="https://blog.richliu.com/wp-content/uploads/2019/09/image-3-1024x330.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/09/image-3-300x97.png 300w, https://blog.richliu.com/wp-content/uploads/2019/09/image-3-768x248.png 768w, https://blog.richliu.com/wp-content/uploads/2019/09/image-3-620x200.png 620w, https://blog.richliu.com/wp-content/uploads/2019/09/image-3.png 1398w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p> Get nodes again. </p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="142" src="https://blog.richliu.com/wp-content/uploads/2019/09/image-4-1024x142.png" alt="" class="wp-image-4177" srcset="https://blog.richliu.com/wp-content/uploads/2019/09/image-4-1024x142.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/09/image-4-300x42.png 300w, https://blog.richliu.com/wp-content/uploads/2019/09/image-4-768x107.png 768w, https://blog.richliu.com/wp-content/uploads/2019/09/image-4.png 1395w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Great!! it works. </p>



<h2 class="wp-block-heading">MicroK8s</h2>



<p>If you think steps above are too complex and you would like to only run k8s on one machine, microk8s is a good friend for you, can run on ARM64 and very easy to use, just run command </p>



<p>sudo snap install microk8s</p>



<p>And just add a prefix &#8220;microk8s.&#8221; before k8s command, ex:</p>



<pre class="wp-block-preformatted">microk8s.kubectl get nodes</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="854" height="133" src="https://blog.richliu.com/wp-content/uploads/2019/09/image-5.png" alt="" class="wp-image-4178" srcset="https://blog.richliu.com/wp-content/uploads/2019/09/image-5.png 854w, https://blog.richliu.com/wp-content/uploads/2019/09/image-5-300x47.png 300w, https://blog.richliu.com/wp-content/uploads/2019/09/image-5-768x120.png 768w" sizes="(max-width: 854px) 100vw, 854px" /></figure>



<p>See, it&#8217;s very easy to use. right?</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/09/25/4160/install-kubernetes-on-arm64-ubuntu-18-04/">Install Kubernetes on ARM64 Ubuntu 18.04 (with QEMU)</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/2019/09/25/4160/install-kubernetes-on-arm64-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu 18.04 ARM64 DPDK in VM (QEMU)</title>
		<link>https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/</link>
					<comments>https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 19 Aug 2019 08:17:56 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[18.04]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[dpdk]]></category>
		<category><![CDATA[hugepages]]></category>
		<category><![CDATA[l3fwd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4057</guid>

					<description><![CDATA[<p>DPDK is a very popular infrastructure in high speed pac [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/">Ubuntu 18.04 ARM64 DPDK in VM (QEMU)</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>DPDK is a very popular infrastructure in high speed packet process domain, some applications will used the same architecture to process packet, like EPC. <br /><br />For Ubuntu 18.04, it used dpdk 17.11, it not good for some other application like dpdk pktgen, but enough for testpmd and l3fwd test. here is some personal note for setup whole environment. </p>



<figure class="wp-block-image is-resized"><img loading="lazy" decoding="async" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-3.png" alt="" class="wp-image-4076" width="363" height="257" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-3.png 634w, https://blog.richliu.com/wp-content/uploads/2019/08/image-3-300x213.png 300w" sizes="(max-width: 363px) 100vw, 363px" /><figcaption>DPDK in QEMU archeticture</figcaption></figure>



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



<p>Hardware : Ampere eMag Server with 128GB Memory <br />                      Network Card: Intel i210 Gigabit NIC Card * 2 <br /><br />HOST means commands and instructions on host machines <br />VM means commands and instructions inside VM</p>



<h2 class="wp-block-heading">Prepare Environment</h2>



<h4 class="wp-block-heading">Apt source</h4>



<p>First, please add deb-src to your database, edit file /etc/apt/source.list and removed all &#8220;#&#8221; before deb-src, then, run follow commands to update apt database (suppose all commands run with sudo or root in this article)</p>



<pre class="wp-block-preformatted">sed -i 's/# deb-src/deb-src/g' sources.list
apt update</pre>



<h4 class="wp-block-heading">Install Packages</h4>



<p>It needs to install relative packages in host </p>



<pre class="wp-block-preformatted">sudo apt install -y dpdk dpdk-dev dpdk-doc </pre>



<p>Only needs to install on HOST.</p>



<pre class="wp-block-preformatted">sudo apt install -y qemu-efi bridge-utils</pre>



<p>It will install all necessary dpdk packages in host.</p>



<h4 class="wp-block-heading">Preload Module</h4>



<p>It needs to preload vfio-pci modules by default, run following command</p>



<pre class="wp-block-preformatted">echo "vfio-pci" &gt;&gt; /etc/modules</pre>



<h4 class="wp-block-heading">Configure Line Kernel boot command</h4>



<p>It needs to reserve hugepages memory space for Linux kernel, it reserves 32 pages and each pages 1GB, total 32GB. Please modify  /etc/default/grub , and  add hugepagesz=1GB hugepages=32 to GRUB_CMDLINE_LINUX, ex:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>GRUB_CMDLINE_LINUX=&#8221;console=tty0 hugepagesz=1GB hugepages=32&#8243;</p></blockquote>



<p>then run foloowing command to update grub.cfg</p>



<pre class="wp-block-preformatted">update-grub</pre>



<p>Mount hugetlbfs by default</p>



<p>If wants to use hugepage, it needs to mount hugetlbfs somewhere, we can create a directory, ex: /mnt/hugepages and mount hugetblsfs there by default. </p>



<pre class="wp-block-preformatted">mkdir -p /mnt/hugepages
echo "nodev   /mnt/hugepages                  hugetlbfs       defaults,pagesize=1G    0 0 none" &gt;&gt; /etc/fstab</pre>



<h2 class="wp-block-heading">Bind Network Card for DPDK</h2>



<p>It wants to let DPDK use current network card, it needs to bind the network card with dpdk. dpdk-devbind command is a useful command. <br />List current command </p>



<pre class="wp-block-preformatted"> $ dpdk-devbind --status
 Network devices using kernel driver
 0001:01:00.0 'I210 Gigabit Network Connection 1533' if=enP1p1s0 drv=igb unused=vfio-pci
 0002:01:00.0 'I210 Gigabit Network Connection 1533' if=enP2p1s0 drv=igb unused=vfio-pci
 0006:01:00.0 'I210 Gigabit Network Connection 1533' if=enP6p1s0 drv=igb unused=vfio-pci <em>Active</em> </pre>



<p>There are three network card in the machine, we would like to bind 1:1:0.0 and 2:1:0.0 to vfio-pci driver. please used following command to bind those network cards. </p>



<pre class="wp-block-preformatted">dpdk-devbind -b vfio-pci 0001:01:00.0 0002:01:00.0</pre>



<p>and check status again</p>



<pre class="wp-block-preformatted"> $ dpdk-devbind --status

Network devices using DPDK-compatible driver
============================================
0001:01:00.0 'I210 Gigabit Network Connection 1533' drv=vfio-pci unused=igb
0002:01:00.0 'I210 Gigabit Network Connection 1533' drv=vfio-pci unused=igb

Network devices using kernel driver
============================================
0006:01:00.0 'I210 Gigabit Network Connection 1533' if=enP6p1s0 drv=igb unused=vfio-pci <em>Active</em> </pre>



<p>Both network cards would be under  Network devices using DPDK-compatible driver  . </p>



<h2 class="wp-block-heading">Prepare QEMU environment </h2>



<h4 class="wp-block-heading">Set up bridge devices  </h4>



<p>We already install bridge-utils before, now, it should configure bridge devices. </p>



<pre class="wp-block-preformatted">mkdir -p /etc/qemu
echo "allow br0" &gt; /etc/qemu/bridge.conf</pre>



<p>Because there is only one network interface on machine, we should use this interface as bridge device, save text below and modify it to fit your environment. </p>



<pre class="wp-block-preformatted"> ORIGNIC=enP6p1s0

 ip addr flush enP6p1s0


 brctl addbr br0
 brctl addif br0 enP6p1s0
 ifconfig br0 up
 ifconfig br0 192.168.110.1 netmask 255.255.0.0
 route add default gw 192.168.1.1


 echo nameserver 8.8.8.8 >> /etc/resolv.conf </pre>



<p>Run script, command brctl show will show how whether it configure property or not. </p>



<h2 class="wp-block-heading">Prepare QEMU image</h2>



<p>Ubuntu 18.04 cloud image is here</p>



<pre class="wp-block-preformatted">wget http://ftp.yzu.edu.tw/Linux/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-arm64.img</pre>



<p>and please refer this article to change cloud image&#8217;s password <br />Change Ubuntu Cloud Image Password, before use it, don&#8217;t forget to increase cloud image size. 20G is enough for test.</p>



<pre class="wp-block-preformatted">qemu-img resize bionic-server-cloudimg-arm64.img +20G</pre>



<p>Next step is to create bios and nvram for qemu image boot. </p>



<pre class="wp-block-preformatted">dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64</pre>



<h2 class="wp-block-heading">Run Qemu</h2>



<p>Here is qemu command, save text below and run it </p>



<pre class="wp-block-preformatted"> IMAGE=bionic-server-cloudimg-arm64.img
 sudo qemu-system-aarch64 -name vm1 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 8192 \
         -smp 12,sockets=1,cores=12,threads=1 \
         -nographic -nodefaults \
         -pflash flash0.img -pflash flash1.img \
         -device vfio-pci,host=0001:01:00.0 \
         -device vfio-pci,host=0002:01:00.0 \
         -drive file=$IMAGE,if=none,id=disk1 \
         -device virtio-blk-device,scsi=off,drive=disk1,id=virtio-disk1,bootindex=1 \
         -netdev tap,id=net0,ifname=tap0 \
         -device virtio-net-device,netdev=net0 \
         -mem-path /mnt/hugepages \
         -serial telnet::9001,server,nowait > guest1_log.txt 2>> guest1_log.txt &amp;
 sleep 5
 brctl addif br0 tap0 </pre>



<p>-m 8192 : use 8G RAM for VM<br />&#8211;mem-path will use /mnt/hugepages for VM memory<br /><br />it will create a network device tap0 for bridge device interface between VM and host.  and create a telnet server on port 9001, it can use &#8220;telnet 9001&#8221; to get console, I would like to suggest to use ssh if it can access console. </p>



<h2 class="wp-block-heading">Remove cloudinit service</h2>



<p>it needs to remove cloud-initramfs-copymods, it will copy modules from ramdisk to harddriver, and cloud-init, it&#8217;s for some cloud service like aws(?)<br /><br />removed them would help system runs better. </p>



<pre class="wp-block-preformatted">apt remove cloud-initramfs-copymods cloud-init </pre>



<h2 class="wp-block-heading">Disable Services</h2>



<p>After boot, it needs to disable some default service to improve speed, here is some services can be disabled. (needs run those command with root)</p>



<pre class="wp-block-preformatted">systemctl disable ufw
systemctl disable lxcfs
systemctl disable atd
systemctl disable cron
systemctl disable irqbalance
systemctl disable apparmor
systemctl disable apport
systemctl disable ebtables
systemctl disable grub-common
systemctl disable unattended-upgrades
systemctl disable iscsid</pre>



<p>Most import service is irqbalance, without disable it, performance will be drop down. <br /><br />Now, it can reboot VM now. </p>



<h2 class="wp-block-heading">Prepare QEMU environment </h2>



<p>Prepare QEMU environment and prepare host almost the same, only differences are</p>



<ol class="wp-block-list"><li>in QEMU, apt install doesn&#8217;t needs to install qemu-efi and bridge-utils</li><li>in QEMU, before call dpdk-devbind command, it needs to configure enable_unsafe_noiommu_mode for ARM64 platform </li><li>Hugepage size is different , in HOST it uses 32G, in VM we uses 4G</li></ol>



<p>Enable unsafe noiommu </p>



<pre class="wp-block-preformatted">echo 1 &gt; /sys/module/vfio/parameters/enable_unsafe_*</pre>



<p> To permanently enable the no-IOMMU mode, add it to modprobe.d: (<a href="https://dpdk-guide.gitlab.io/dpdk-guide/setup/binding.html" target="_blank" rel="noopener">ref</a>) </p>



<pre class="wp-block-preformatted">echo "options vfio enable_unsafe_noiommu_mode=1" &gt; /etc/modprobe.d/vfio-noiommu.conf</pre>



<p>It also needs to reserve hugepages memory space for Linux kernel for VM, it reserves 4 pages and each pages 1GB, total 4GB. Please modify  /etc/default/grub , and  add hugepagesz=1GB hugepages=4 to GRUB_CMDLINE_LINUX, ex:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>GRUB_CMDLINE_LINUX=&#8221;console=tty0 hugepagesz=1GB hugepages=4&#8243;</p></blockquote>



<p>then run foloowing command to update grub.cfg</p>



<pre class="wp-block-preformatted">update-grub</pre>



<h2 class="wp-block-heading">Run DPDK  l3fwd</h2>



<p>Before run l3fwd, we need to recompile it. </p>



<pre class="wp-block-preformatted">. /usr/share/dpdk/dpdk-sdk-env.sh
make -C /usr/share/dpdk/examples/l3fwd</pre>



<p>Bind network interface</p>



<pre class="wp-block-preformatted">dpdk-devbind -b vfio-pci  enp0s1
dpdk-devbind -b vfio-pci  enp0s2</pre>



<p>Run l3fwd example</p>



<pre class="wp-block-preformatted">cd /usr/share/dpdk/examples/l3fwd/build
./l3fwd -c 1 -- -p 0x3 --config="(0,0,0),(1,0,0)"</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="639" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-1024x639.png" alt="" class="wp-image-4072" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-1024x639.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/08/image-300x187.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/image-768x479.png 768w, https://blog.richliu.com/wp-content/uploads/2019/08/image.png 1440w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Multi Queue example</p>



<pre class="wp-block-preformatted">./l3fwd -l 1,2,3,4 -n 4 -- -p 0x3 --config="(0,0,1),(1,0,2),(0,1,3),(1,1,4)"</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="715" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-1-1024x715.png" alt="" class="wp-image-4073" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-1-1024x715.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/08/image-1-300x209.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/image-1-768x536.png 768w, https://blog.richliu.com/wp-content/uploads/2019/08/image-1.png 1438w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Other</h2>



<p>There is good tool to get hugepage information </p>



<pre class="wp-block-preformatted">apt install hugepages
hugeadm --pool-list</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="865" height="130" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-2.png" alt="" class="wp-image-4074" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-2.png 865w, https://blog.richliu.com/wp-content/uploads/2019/08/image-2-300x45.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/image-2-768x115.png 768w" sizes="(max-width: 865px) 100vw, 865px" /></figure>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/">Ubuntu 18.04 ARM64 DPDK in VM (QEMU)</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/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>QEMU Run x86_64/AMD64 VM on ARM64/AARCH64</title>
		<link>https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/</link>
					<comments>https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 03:33:23 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[18.04]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[ovfm]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[uefi]]></category>
		<category><![CDATA[x86_64]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4045</guid>

					<description><![CDATA[<p>This is a work note for run x86_64/AM64 on ARM64/AARCH6 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/">QEMU Run x86_64/AMD64 VM on ARM64/AARCH64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This is a work note for run x86_64/AM64 on ARM64/AARCH64 server .<br />Because they are different archeticture, so, run x86_64 on ARM server would be very slow. <br /><br />and some functions might be different when run on different platform </p>



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



<h2 class="wp-block-heading">Ubuntu</h2>



<p>It can refer to those three articles to create a new cloud image from Ubuntu server image, remember to change ARM64 image to x86_64 image . <br /><br /><a href="https://blog.richliu.com/2018/08/25/2318/change-ubuntu-cloud-image-size">Change Ubuntu Cloud Image Size</a> (if you choice ubuntu 16.04 as your image)<br /><a href="https://blog.richliu.com/2017/08/31/2165/change-ubuntu-cloud-image-password">Change Ubuntu Cloud Image Password</a><br /><a href="https://blog.richliu.com/2017/10/17/2187/ubuntu-cloud-image-taiwan-mirror-site">Ubuntu Cloud Image Taiwan Mirror Site</a><br /></p>



<p>Install Qemu and setup bridge devices </p>



<pre class="wp-block-code"><code>apt install -y ovmf qemu bridge-utils
mkdir -p /etc/qemu
echo "allow br0" &gt; /etc/qemu/bridge.conf
echo "allow virbr0" &gt;&gt; /etc/qemu/bridge.conf</code></pre>



<p>Write this script to a file and run it. </p>



<pre class="wp-block-code"><code>SERVERFILE=xenial-server-cloudimg-amd64-uefi1.img
VERSION=`uname -r`

sudo qemu-system-x86_64 -name vm1 \
        -machine pc-i440fx-xenial,usb=off \
        -cpu qemu64 -m 8192 \
        -smp 12,sockets=1,cores=12,threads=1 \
        -nographic -nodefaults \
        -bios /usr/share/ovmf/OVMF.fd \
        -virtfs local,path=/home/work,mount_tag=host0,security_model=passthrough,id=host0 \
        -drive file=$SERVERFILE  \
        -net nic,macaddr=$macaddr \
        -net tap,ifname=tap0 \
        -serial telnet::9001,server,nowait &gt; guest1_log.txt 2&gt;&amp;1 &amp;

sleep 5

brctl addif br0 tap0</code></pre>



<p>it can use command <br />qemu-system-x86_64 &#8211;machine help<br />and<br /> qemu-system-x86_64 &#8211;cpu help<br />to get all machine and cpu options. <br /><br />it can change cpu and machine type here. <br /><br />network would be bridge on tap0<br /><br />below is good option to share folder between host and VM, below command will share /home/work with vm. </p>



<pre class="wp-block-code"><code>option 
--virtfs local,path=/home/work,mount_tag=host0,security_model=passthrough,id=host0 </code></pre>



<p>it can put this line to /etc/fstab to mount host&#8217;s folder to somewhere, in this case, just put the same directory like host does. <br /></p>



<pre class="wp-block-code"><code>host0   /home/work   9p      trans=virtio,version=9p2000.L,user,umask=000   0 0</code></pre>



<h2 class="wp-block-heading">CentOS</h2>



<p>CentOS document was written on 2021, but Ubuntu document on 2019, there is some difference between it. but that&#8217;s ok, I believe both ways are works. </p>



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



<p>CentOS default application doesn&#8217;t support run x86_64 code on ARM64 server, it needs to compile manually. <br /><br />Please download qemu and compile it. </p>



<pre class="wp-block-code"><code># Install CentOS Packages
yum config-manager --set-enabled powertools
yum install -y xorg-x11-xauth python3 ninja-build
yum install -y glib2-devel libmount-devel
yum install -y git glib2-devel libfdt-devel pixman-devel zlib-devel

# Download QEMU Source Code
wget https://download.qemu.org/qemu-5.2.0.tar.xz
# Decompress it
tar xvf qemu-5.2.0.tar.xz
# 
cd qemu-5.2.0
./configure --target-list="x86_64-softmmu aarch64-softmmu aarch64-linux-user x86_64-linux-user"
make -j `nproc`
make install 
</code></pre>



<p>Then, qemu will be installed on /usr/local/bin</p>



<h3 class="wp-block-heading">Download UEFI Image</h3>



<p>It needs UEFI Image for x86_64 image boot up. It needs <a rel="noreferrer noopener" href="https://github.com/tianocore/tianocore.github.io/wiki/OVMF" data-type="URL" data-id="https://github.com/tianocore/tianocore.github.io/wiki/OVMF" target="_blank">OVMF&#8217;s tianocore</a> (Open Source UEFI BIOS) to boot up. And we  can download <a href="https://www.kraxel.org" data-type="URL" data-id="https://www.kraxel.org" target="_blank" rel="noreferrer noopener">kraxel </a>as prebuild images. </p>



<pre class="wp-block-code"><code># Install Kraxel into CentOS repos
cd /etc/yum.repos.d/
wget https://www.kraxel.org/repos/firmware.repo
yum install edk2.git-aarch64 edk2.git-ovmf-x64
cd &lt;your vm directory&gt;
cp /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd .
cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd .

</code></pre>



<h3 class="wp-block-heading">Prepare Bridge Devices</h3>



<p>It needs bridge devices to connect to internet, default qemu bridge device name is virbr0 , due to CentOS doesn&#8217;t support brctl, follow this document(<a rel="noreferrer noopener" href="https://www.tecmint.com/create-network-bridge-in-rhel-centos-8/" data-type="URL" data-id="https://www.tecmint.com/create-network-bridge-in-rhel-centos-8/" target="_blank">3 Ways to Create a Network Bridge in RHEL/CentOS 8</a>) to create a CentOS bridge devices. Below is my experiment script to create bridge device, this setting will keep in system, reboot will not be reset. </p>



<pre class="wp-block-code"><code>nmcli conn add type bridge con-name virbr0 ifname virbr0

killall dhclient
ip addr flush enP7p2s0
nmcli conn modify virbr0 ipv4.addresses '192.168.3.191/16'
nmcli conn modify br0 ipv4.gateway '192.168.1.1'
nmcli conn modify br0 ipv4.dns '8.8.8.8'
nmcli conn modify br0 ipv4.method manual
nmcli conn add type ethernet slave-type bridge con-name bridge-br0 ifname enP7p2s0 master virbr0
nmcli conn up virbr0
nmcli conn up bridge-br0

nmcli conn show  --active

# Allow QEMU to access virbr0
mkdir -p /etc/qemu
echo "allow virbr0" &gt;&gt; /etc/qemu/bridge.conf

</code></pre>



<h2 class="wp-block-heading">Run Qemu</h2>



<p>It can refer above to prepare cloud image, I prefer to use ubuntu cloud image, but have not try CentOS image. </p>



<p>Remember Ubuntu 18.04 image won&#8217;t auto increase image size, please follow this <a href="https://blog.richliu.com/2018/08/25/2318/change-ubuntu-cloud-image-size/" data-type="post" data-id="2318">Change Ubuntu Cloud Image Size</a> to modify image size<br /></p>



<pre class="wp-block-code"><code>
qemu-system-x86_64 -m 8192 -smp 16 -nographic \
        -drive if=pflash,format=raw,unit=0,file=OVMF_CODE-pure-efi.fd,readonly=on \
        -drive if=pflash,format=raw,unit=1,file=OVMF_VARS-pure-efi.fd \

        -hdc bionic-server-cloudimg-amd64.img \
        -netdev bridge,br=virbr0,id=net0 \
        -device virtio-net,netdev=net0,mac=00:11:22:33:44:55 \
        -serial telnet::9001,server,nowait &gt; vmlog.txt 2&gt;&gt; vmlog.txt &amp;
</code></pre>



<h3 class="wp-block-heading">x86_64 application</h3>



<p>Sometimes we don&#8217;t need to run whole VM to run some application just for x86_64, it can run user mode application directly. I am a lazy guy, so just reuse cloud image as x86_64 Linux library. </p>



<pre class="wp-block-code"><code>mkdir -p /home/amd64
qemu-img convert  bionic-server-cloudimg-amd64.img bionic-server-cloudimg-amd64.raw
losetup /dev/loop0 bionic-server-cloudimg-amd64.raw
kpartx -a /dev/loop0
mount /dev/mapper/loop0p1 /home/amd64
</code></pre>



<p>Umount Image</p>



<pre class="wp-block-code"><code>umount /home/amd64
losetup -d /dev/loop0</code></pre>



<p>Run x86_64 only application </p>



<pre class="wp-block-code"><code>qemu-x86_64 -L /home/amd64/ bootutil64e
qemu-x86_64 -L /home/amd64/ nvmupdate64e -l</code></pre>



<h2 class="wp-block-heading">Unsolved Problem</h2>



<h3 class="wp-block-heading">Cannot find way to update INTEL NIC&#8217;s NVM</h3>



<p>Tried vfio and application mode, vfio cannot pass iommu to host, it will fail. <br /><br />User space application will cause mmap fail. <br /><br />If you know how to update Intel NIC&#8217;s NVM, welcome to leave a message for me. </p>



<h3 class="wp-block-heading">QEMU &#8211;static problem</h3>



<p>Add &#8211;static parameter will cause some problem, cannot solve it right now. </p>



<p><br />./configure &#8211;target-list=&#8221;x86_64-softmmu aarch64-softmmu aarch64-linux-user x86_64-linux-user&#8221; &#8211;static<br />===</p>



<p>ERROR: sizeof(size_t) doesn&#8217;t match GLIB_SIZEOF_SIZE_T.</p>



<p>&nbsp;&nbsp;&nbsp; You probably need to set PKG_CONFIG_LIBDIR</p>



<p>&nbsp;&nbsp;&nbsp; to point to the right pkg-config files for your&nbsp;&nbsp;&nbsp; build target</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/">QEMU Run x86_64/AMD64 VM on ARM64/AARCH64</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/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
