1. host
CentOS Linux release 7.2.1603 (AltArch) aarch64
kernel: 3.19.0-0.79.aa7a.aarch64
检查内核是否支持kvm
$dmesg | grep -i kvm
[ 0.364920] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=122
[ 0.365026] kvm [1]: timer IRQ3
[ 0.365039] kvm [1]: Hyp mode initialized successfully
2. 安装必须的包
1 | sudo yum install -y qemu-system-aarch64 |
3. 下载uefi.img和QEMU_EFI.fd
1 | wget https://releases.linaro.org/components/kernel/uefi-linaro/15.12/release/qemu64/QEMU_EFI.fd |
4. 制作cloud.img
- 创建cloud.txt文件,内容如下,其中ssh-rsa换做你本地的id_rsa.pub
1 | #cloud-config |
- 创建cloud.img
1 | # 根据cloud.txt内容创建镜像cloud.img |
5. 启动镜像
1 | qemu-system-aarch64 -smp 4 -m 8092 -M virt -bios QEMU_EFI.fd -nographic \ |
6. 登录
1 | ssh -p 2222 <your_username>@localhost |
成功后如下所示:
1 | [root@APM html]# ssh -p 2222 root@localhost |