一、环境介绍:
二、安装软件:
sudo apt install qemu-kvm
sudo apt-get install qemu libvirt-bin virtinst virt-manager virt-viewer
kvm --help
# 查看kvm是否安装成功
sudo virsh -c qemu:///system list
三、搭建虚拟机:
# 用qemu-img命令创建一个虚拟磁盘
mkdir -p /home/my/work/vms && cd /home/my/work/vms
sudo qemu-img create -f qcow2 euleros2.8_disk01.img 20G
# 下载镜像 https://developer.huawei.com/ict/site-euleros/euleros/repo/yum/2.8/os/aarch64/iso/EulerOS_Server_V200R008C00SPC202B580/
wget https://euleros2019.obs.cn-north-1.myhuaweicloud.com/ict/site-euleros/euleros/repo/yum/2.8/os/aarch64/iso/EulerOS_Server_V200R008C00SPC202B580/EulerOS-V2.0SP8-aarch64-dvd-B580.iso
# 安装系统
qemu-system-aarch64 -hda /home/my/work/vms/euleros2.8_disk01.img -cdrom /home/my/work/vms/EulerOS-V2.0SP8-aarch64-dvd-B580.iso -boot d -m 1024
四、运行虚拟机:
# 启动虚拟机
qemu-system-aarch64 euleros2.8_disk01.img -m 1024
附录:
1、图形界面与命令行界面切换
# 切换到图形界面
systemctl set-default graphical.target
# 切换到命令行界面
sudo systemctl set-default multi-user.target
参考资料