银河麒麟V10(飞腾ARM CPU)安装KVM踩坑记

服务器配置信息

品牌:GreetWall

CPU:飞腾FT-2000+/64 64bit

操作系统:Linux-4.19.90-24.4.v2101.ky10.aarch64-with-kylin-10-Sword

 

初次安装

安装包:yum install libvirt* qemu* virt-manager -y

 

启动libvirtd 服务:

Systemctl enable libvirtd

Systemctl start libvirtd

 

启动报错

Error: Host does not suppor any virtualization options

 错误:主机不支持 任意虚拟化选项

查看libvirtd服务:systemctl status libvirtd,发现有错误提示:

operation failed: Cannot find CPU model with PVR 0x662

could not find capabilities for arch=aarch64 domaintype=qemu

大致意思是qemu不支持aarch64

 

重新编译QEMU

现象:错误:无效参数:could not find capabilities for arch=aarch64

qemu源码编译:(需要指定--cpu=aarch64)

源码下载:https://download.qemu.org/qemu-5.2.0.tar.xz

这里下载的是5.2.0版本,截止发稿最新版本为6.2.0,需要使用gcc-c++ 7.4版本,麒麟yum源最新版本为7.3,所以选择5.2.0版本编译

注意QEMU编译依赖Ninja,需要先安装一下依赖

 

安装re2c

下载地址:http://re2c.org/index.html
tar -zxvf re2c-2.2.tar.gz
cd re2c-2.2/
autoreconf -i -W all
./configure
make
make install

 

安装Ninja

下载地址:https://github.com/ninja-build/ninja/releases
tar -zxvf ninja-1.10.2.tar.gz
./configure.py --bootstrap
cp ninja /usr/bin

 

安装librbd-devel

yum install -y librbd-devel

 

编译QEMU

./configure --target-list=arm-softmmu,aarch64-softmmu --enable-kvm --enable-rbd --enable-vnc --prefix=/usr/local --cpu=aarch64
make
make install
systemctl restart libvirtd

 

虚拟系统管理器正常运行

 

后话

 解决这个问题时,预备了两种解决方案同时在进行

一是重新编译QEMU

二是怀疑操作系统版本和CPU版本不匹配,在麒麟软件官网重新下载了飞腾CPU对应的麒麟V10 SP2系统镜像

重新安装物理机操作系统,安装过程勾选KVM套件,安装完成后,打开虚拟系统管理器可以正常创建虚拟机

至此问题解决,两个方案均验证可行

麒麟操作系统下载地址(需要填写试用信息):https://www.kylinos.cn/support/trial.html?trial=5540

镜像名称:Kylin-Server-10-SP2-aarch64-Release-Build09-20210524.iso

posted @ 2022-01-17 17:19  codest  阅读(11117)  评论(2编辑  收藏  举报