QEMU运行ARM64(Aarch64)Debian系Linux
QEMU运行ARM64(Aarch64)Debian系Linux
安装QEMU
-
尽量安装最新版,目前是5.2,通过以下命令检查
qemu-system-aarch64 -version
下载debian cloud arm64镜像,重命名为debian-10-arm64.qcow2
可以通过这个地址下载不同版本:https://cloud.debian.org/images/cloud
下载qemu-efi-aarch64的deb包,解压出QEMU_EFI.fd文件
-
Debian 10 ftp.br.debian.org/debian/pool…
-
Debian 11 ftp.br.debian.org/debian/pool…
-
解压deb文件,解压出QEMU_EFI.fd dpkg -X *.deb ./
安装libguestfs-tools修改qcow2镜像root密码(最简单的方法)
-
sudo apt-get install -y libguestfs-tools
-
这里将root密码设置为root virt-customize -a debian-10-arm64.qcow2 --root-password password:root
-
磁盘扩容 qemu-img resize debian-10-arm64.qcow2 +8G
启动系统
-
启动无GUI的系统
ini复制代码#Windows Shell qemu-system-aarch64 ^ -M virt -m 4G -cpu cortex-a72 -smp 2 ^ -bios QEMU_EFI.fd ^ -drive id=hd0,media=disk,if=none,file=debian-10-arm64.qcow2 ^ -device virtio-scsi-pci ^ -device scsi-hd,drive=hd0 ^ -nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22,hostfwd=tcp::8000-:80,hostfwd=tcp::8080-:8080,hostfwd=tcp::8888-:8888,hostfwd=tcp::9090-:9090,hostfwd=tcp::9000-:9000 ^ -nographic
ini复制代码#Linux Shell qemu-system-aarch64 \ -M virt -m 4G -cpu cortex-a72 -smp 2 \ -bios QEMU_EFI.fd \ -drive id=hd0,media=disk,if=none,file=debian-10-arm64.qcow2 \ -device virtio-scsi-pci \ -device scsi-hd,drive=hd0 \ -nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22,hostfwd=tcp::8000-:80,hostfwd=tcp::8080-:8080,hostfwd=tcp::8888-:8888,hostfwd=tcp::9090-:9090,hostfwd=tcp::9000-:9000 \ -nographic
-
如果不需要GUI,到这里就结束了
安装GUI
-
更新后安装gui,这里选择LXQT
sudo apt update
sudo apt upgrade
sudo apt install -y lxqt lightdm
-
启动带GUI的系统
ini复制代码#Windows Shell qemu-system-aarch64 ^ -M virt -m 4G -cpu cortex-a72 -smp 2 ^ -bios QEMU_EFI.fd ^ -drive id=hd0,media=disk,if=none,file=debian-10-arm64.qcow2 ^ -device virtio-scsi-pci ^ -device scsi-hd,drive=hd0 ^ -device ramfb ^ -device qemu-xhci,id=xhci ^ -device usb-kbd -device usb-tablet -k en-us ^ -nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22,hostfwd=tcp::8000-:80,hostfwd=tcp::8080-:8080,hostfwd=tcp::8888-:8888,hostfwd=tcp::9090-:9090,hostfwd=tcp::9000-:9000
ini复制代码#Linux Shell qemu-system-aarch64 \ -M virt -m 4G -cpu cortex-a72 -smp 2 \ -bios QEMU_EFI.fd \ -drive id=hd0,media=disk,if=none,file=debian-10-arm64.qcow2 \ -device virtio-scsi-pci \ -device scsi-hd,drive=hd0 \ -device ramfb \ -device qemu-xhci,id=xhci \ -device usb-kbd -device usb-tablet -k en-us \ -nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22,hostfwd=tcp::8000-:80,hostfwd=tcp::8080-:8080,hostfwd=tcp::8888-:8888,hostfwd=tcp::9090-:9090,hostfwd=tcp::9000-:9000
- 来源:https://juejin.cn/post/6905654257782161422