测试qemu安装openeuler架构aarch64

测试qemu安装openeuler架构aarch64
一、参考资料
https://libvirt.org/
https://docs.openeuler.org/zh/
https://www.qemu.org/
https://www.kernel.org/
二、软件安装
1、linux环境
2、qemu6.0.0
3、libvirt
4、tigervnc
5、kernel5.10
三、测试镜像启动
1、下载直接启动镜像
https://repo.openeuler.org/openEuler-21.03/virtual_machine_img/aarch64/openEuler-21.03-aarch64.qcow2.xz
2、解压缩
xz -dk openEuler-21.03-aarch64.qcow2.xz
3、bios引导
sudo qemu-system-aarch64 -m 4096 -cpu cortex-a57 -M virt -nographic \
-bios edk2-aarch64-code.fd \
-hda openEuler-21.03-aarch64.qcow2 \
-netdev bridge,id=net0,br=virbr0 -device virtio-net-device,netdev=net0,mac=12:22:33:44:55:66
4、zImage引导
a、制作zImage
make ARCH=arm64    CROSS_COMPILE=aarch64-linux-gnu-    defconfig
make ARCH=arm64    CROSS_COMPILE=aarch64-linux-gnu-    menuconfig
make ARCH=arm64    CROSS_COMPILE=aarch64-linux-gnu-    all -j 32 
b、启动
sudo qemu-system-aarch64 -m 4096 -cpu cortex-a57 -M virt \
-kernel Image -nographic \
-drive if=none,file=openEuler-21.03-aarch64.qcow2,id=image \
-device virtio-blk-device,drive=image  \
-append 'console=ttyAMA0,115200  root=/dev/vda2 ' \
-netdev bridge,id=net0,br=virbr0 -device virtio-net-device,netdev=net0,mac=12:22:33:44:55:66
5、虚拟桥配置(默认IP:192.168.122.1)
配置文件位置
/etc/libvirt/qemu/networks/autostart/default.xml
可自定义
/etc/libvirt/qemu/networks/autostart/br0.xml
启用命令
sudo virsh --connect qemu:///system net-start br0
7、配置更新源参考(这只是一部分,网上找到全量可直接复制)
sudo vi /etc/yum.repos.d/openEuler.repo
[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-21.03/update/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
8、安装更新软件
sudo dnf install vim wget
四、光盘安装测试
1、下载光盘网络安装镜像
https://repo.openeuler.org/openEuler-21.03/ISO/aarch64/openEuler-21.03-netinst-aarch64-dvd.iso
2、创建虚拟磁盘vm1.raw
qemu-img create -f raw vm1.raw 20G
3、安装
 sudo qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt \
-bios edk2-aarch64-code.fd \
-drive if=none,file=openEuler-21.03-netinst-aarch64-dvd.iso,id=cdrom,media=cdrom \
-device virtio-scsi-device \
-device scsi-cd,drive=cdrom \
-hda vm1.raw \
-nographic -vnc :20 -display gtk,grab-on-hover=off,gl=off \
-netdev bridge,id=net0,br=virbr0 -device virtio-net-device,netdev=net0,mac=12:22:33:44:55:66 \
-device virtio-gpu-pci \
-device virtio-mouse-device \
-device qemu-xhci,id=xhci -usb -device usb-kbd -device usb-mouse -device usb-tablet -k en-us 
注:启动安装图形界面速度超慢!安装过程更慢!出去散散步吧~
启动后用tigervnc连接图形安装
4、安装网络源配置
https://repo.openeuler.org/openEuler-21.03/OS/aarch64/
5、启动
sudo qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt \
-bios edk2-aarch64-code.fd \
-hda vm1.raw \
-nographic -vnc :20 -display gtk,grab-on-hover=off,gl=off \
-netdev bridge,id=net0,br=virbr0 -device virtio-net-device,netdev=net0,mac=12:22:33:44:55:66 \
-device qemu-xhci,id=xhci -usb -device usb-kbd -device usb-mouse -device usb-tablet -k en-us \
-device virtio-mouse-device -device virtio-gpu-pci 
6、启用网络
dhclient eth0
五、更改密码
初始密码:openEuler12#$
-append参数里面添加'init=/bin/sh'
mount -o remount,rw /
passwd root
光盘修改密码
grouble
rescue
chroot /mnt/sysroot
passwd
六、启动界面
=========================================================================
Authorized users only. All activities may be monitored and reported.
Welcome to 5.10.0-4.17.0.28.oe1.aarch64
System load:     1.77
Processes:     106
Memory used:     18.8%
Swap used:     0.0%
Usage On:     39%
Users online:     1
=========================================================================

七、问题

图形鼠标不可见,添加参数

-device VGA
 

你可能感兴趣的:(linux,经验分享,arm)