qemu安装debian 10.10 for arm64
1. apt install qemu-system-arm libguestfs-tools
download:
kernel:https://mirrors.tuna.tsinghua.edu.cn/debian/dists/Debian10.10/main/installer-arm64/current/images/cdrom/vmlinuz
initrd:https://mirrors.tuna.tsinghua.edu.cn/debian/dists/Debian10.10/main/installer-arm64/current/images/cdrom/initrd.gz
debian 10.10镜像:https://cdimage.debian.org/cdimage/archive/10.10.0/arm64/
2. 安装
tunctl -t tap10
brctl addif br0 tap10
ifconfig tap10 0.0.0.0 promisc up
qemu-img create -f qcow2 arm_buster.qcow2 100G
qemu-system-aarch64 -m 8192 -cpu cortex-a72 -smp 4 -M virt -nographic -drive if=none,file=/home/zjm/arm_buster.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 -drive if=none,file=/home/zjm/debian-10.10.0-arm64-DVD-1.iso,id=cdrom,media=cdrom -device virtio-scsi-device -device scsi-cd,drive=cdrom -net nic -net tap,ifname=tap10,script=no,downscript=no -kernel vmlinuz -initrd initrd.gz
"-bios QEMU_EFI.fd" 不是必须的,可去掉
安装完,重启后,杀掉进程就行
3. 准备启动
guestmount -a arm_buster.qcow2 -m /dev/sda1 mp/
这里的/dev/sda1是安装时arm_buster.qcow2里的boot分区,挂载在mp目录下(这里要根据安装时候,boot目录有没有挂载单独分区)
cp mp/vmlinuz-4.19.0-17-arm64 .
cp mp/initrd.img-4.19.0-17-arm64 .
qemu-system-aarch64 -m 8192 -cpu cortex-a72 -smp 4 -M virt -nographic -drive if=none,file=/home/zjm/arm_buster.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 -net nic -net tap,ifname=tap10,script=no,downscript=no -kernel vmlinuz-4.19.0-17-arm64 -initrd initrd.img-4.19.0-17-arm64 -append "root=/dev/vda2 console=ttyAMA0"
4.debian 源
deb https://mirrors.aliyun.com/debian buster main contrib non-free
deb https://mirrors.aliyun.com/debian buster-updates main contrib non-free