1. vmware esxi安裝centos8,開啟內核虛擬化 2. 安裝qemu-system-arrch64 操作: wget https://download.qemu.org/qemu-2.11.0.tar.xz tar xvJf qemu-2.11.0.tar.xz cd qemu-2.1 ...
1. vmware esxi安裝centos8,開啟內核虛擬化
2. 安裝qemu-system-arrch64
操作:
wget https://download.qemu.org/qemu-2.11.0.tar.xz tar xvJf qemu-2.11.0.tar.xz cd qemu-2.11.0 ./configure –-target-list=aarch64-softmmu make make install
報錯1:Python not found. Use --python=/path/to/python
# ./configure --target-list=aarch64-softmmu ERROR: Python not found. Use --python=/path/to/python #解決1,指定python路徑,提示當前python版本過高: # ./configure --target-list=aarch64-softmmu --python=/usr/bin/python3.6 ERROR: Cannot use '/usr/bin/python3.6', Python 2.6 or later is required. Note that Python 3 or later is not yet supported. Use --python=/path/to/python to specify a supported Python. #解決2,下載python2,再次嘗試遇到新的報錯 # ./configure --target-list=aarch64-softmmu --python=/usr/bin/python2 ERROR: "cc" either does not exist or does not work
報錯2:ERROR: "cc" either does not exist or does not work
下載gcc解決該報錯,然後提示依然是缺包
# ./configure --target-list=aarch64-softmmu --python=/usr/bin/python2
ERROR: zlib check failed
Make sure to have the zlib libs and headers installed.
報錯3:ERROR: zlib check failed Make sure to have the zlib libs and headers installed.
下載zlib zlib-devel,然後再次提示缺包
# ./configure --target-list=aarch64-softmmu --python=/usr/bin/python2 ERROR: glib-2.22 gthread-2.0 is required to compile QEMU
下載glib2 glib2-devel,提示還是缺包
下載pixman pixman-devel
./config成功
make告警:缺少命令:flex bison
下載flex,bison
然後還是失敗:
util/memfd.c:40:12: error: static declaration of ‘memfd_create’ follows non-static declaration static int memfd_create(const char *name, unsigned int flags) ^~~~~~~~~~~~ In file included from /usr/include/bits/mman-linux.h:117, from /usr/include/bits/mman.h:49, from /usr/include/sys/mman.h:41, from /root/qemu-2.11.0/include/sysemu/os-posix.h:29, from /root/qemu-2.11.0/include/qemu/osdep.h:104, from util/memfd.c:28: /usr/include/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here int memfd_create (const char *__name, unsigned int __flags) __THROW; ^~~~~~~~~~~~ make: *** [/root/qemu-2.11.0/rules.mak:66: util/memfd.o] Error 1
看百度上各種解決辦法,懶得去一個一個驗證,直接換最新的包
wget https://download.qemu.org/qemu-7.2.0.tar.xz
查看README文件,根據提示操作
mkdir build cd build ../configure make
提示缺包ninjia
yum --enablerepo=powertools install ninja-build
這次提示python版本過低
Found ninja-1.8.2 at /usr/bin/ninja Running postconf script '/usr/bin/python3 /root/qemu-7.2.0/scripts/symlink-install-tree.py' NOTICE: You are using Python 3.6 which is EOL. Starting with v0.62.0, Meson will require Python 3.7 or newer
安裝一個python3.9 然後把/usr/bin/python3指向python3.9
然後再次執行
mkdir build cd build ../configure --target-list=aarch64-softmmu make
無報錯
make install
缺包就裝包:perl
然後make install成功
# which qemu-system-aarch64 /usr/local/bin/qemu-system-aarch64
為了支持UEFI啟動,下載UEFI固件
wget https://www.kraxel.org/repos/firmware.repo yum install edk2.git-aarch64
編輯/etc/libvirt/qemu.conf最後一行添加
nvram = [ "/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw" ]
參考鏈接:https://wiki.ubuntu.com/UEFI/virt-install
https://www.txisfine.cn/archives/a0d5fa12
https://www.cnblogs.com/linuxxl/p/11658387.html
https://zhuanlan.zhihu.com/p/353547345