Qemu安装debian-arm64

更新于 2024-08-05

#创建磁盘
qemu-img create -f qcow2 debian-arm.sda.qcow2 100G

#安装
qemu-system-aarch64.exe -name debian-arm64 -m 4096 -cpu cortex-a72 -smp 8,sockets=4,cores=2 -M virt `
    -bios ./QEMU_EFI.fd `
    -device VGA `
    -device nec-usb-xhci `
    -device usb-mouse `
    -device usb-kbd `
    -drive if=none,media=disk,file=./debian-arm.sda.qcow2,id=hd0 `
    -device virtio-blk-device,drive=hd0 `
    -drive if=none,file=E:/Software/OS/linux/debian-12.5.0-arm64-DVD-1.iso,id=cdrom,media=cdrom `
    -device virtio-scsi-device `
    -device scsi-cd,drive=cdrom `
    -net nic -net user,hostfwd=tcp::2222-:22


#启动
qemu-system-aarch64.exe -name debian-arm64 -m 4096 -cpu cortex-a72 -smp 8,sockets=4,cores=2 -M virt `
    -bios ./QEMU_EFI.fd `
    -device VGA `
    -drive if=none,media=disk,file=./debian-arm.sda.qcow2,id=hd0 `
    -device virtio-blk-device,drive=hd0 `
    -device virtio-scsi-device `
    -net nic -net user,hostfwd=tcp::2222-:22


#报错
qemu启动虚拟后,发现启不来startup.nsh;

在shell下输入:

fs0:
edit startup.nsh

向该文件输入以下内容:

\EFI\debian\grubaa64.efi