qemu安装arm版本的kylin系统

qemu安装arm版本的kylin系统

根据用户的要求,需要安装arm版本的Kylin V10系统,虚拟的目标处理器是Kunpeng 920。
百度后得知该处理器对应的是virt里的cortex-a72。
“`bash
# qemu-system-aarch64 –version

QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.27)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

#qemu-system-aarch64 -cpu help

cortex-a72
“`

我的服务器已经安装了kvm,并设置了openvswitch作为虚拟机的网桥。因为没有其他空闲网口,所以我先创建br0,再把br0加入到ovs中。

“`bash
# brctl addbr br0
# ovs-vsctl add-port ovs br0
# ovs-vsctl show
Bridge ovs
……
Port ovs
Interface ovs
type: internal
Port ens65f1
Interface ens65f1
Port br0
Interface br0
……
ovs_version: “2.17.9”
“`
使用网络需要调用qemu-bridge-helper,编译/etc/qemu/bridge.conf
“`bash
# cat << EOF >> /etc/qemu/bridge.conf
allow ovs
allow br0

EOF
“`
最后还要安装QEMU_EFI.fd,就可以启动虚拟机。
“`bash
# apt-get install qemu-efi-aarch64
# qemu-system-aarch64 -M virt -cpu cortex-a72 -smp 16 -m 65536 -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -drive file=/data/qemu/kylin.qcow2,format=qcow2 -netdev bridge,id=hostnet0,br=br0 -device virtio-net-pci,netdev=hostnet0 -monitor stdio -vnc :1
“`
这时命令行显示qemu console,通过vnc连接到宿主机:5901端口就可以显示虚拟机。

“`bash
# nohup qemu-system-aarch64 -M virt -cpu cortex-a72 -smp 16 -m 65536 -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -drive file=/data/qemu/kylin.qcow2,format=qcow2 -netdev bridge,id=hostnet0,br=br0 -device virtio-net-pci,netdev=hostnet0 -monitor stdio -vnc :1 &
“`

Comments

No comments yet. Why don’t you start the discussion?

发表回复