当前位置:   article > 正文

MacOS qemu运行loongarch linux

macos qemu

本文章参考了

https://github.com/LeisureLinux/bilibili/blob/master/scripts/qemu-busybox.sh#L205

windows qemu安装飞腾Aarch64 Loongarch64 操作系统 亲测_qemu安装arm系统-CSDN博客

https://www.cnblogs.com/missed-forest/p/17667862.html

1. 安装qemu

  1. brew install qemu
  2. qemu-system-loongarch64 -version

2. 下载bios文件和archlinux镜像

bios: http://mirror.nju.edu.cn/loongarch/archlinux/images/QEMU_EFI_8.1.fd

archlinux: http://mirror.nju.edu.cn/loongarch/archlinux/images/archlinux-mate-2023.05.10-loong64.qcow2.zst​​​​​​

注:bios和镜像可根据需要使用其它版本。

3. 解压镜像

zstd -d -o archlinux-mate-2023.05.10-loong64.qcow2 archlinux-mate-2023.05.10-loong64.qcow2.zst

4. 启动镜像

  1. #!/usr/bin/env bash
  2. set -e
  3. currentDir=$(cd $(dirname "$0") && pwd)
  4. qemu=qemu-system-loongarch64
  5. bios=${currentDir}/QEMU_EFI_8.1.fd
  6. disk=${currentDir}/archlinux-mate-2023.05.10-loong64.qcow2
  7. "${qemu}" -machine virt -m 8G \
  8. -smp 4,sockets=4,cores=1,threads=1 \
  9. -cpu la464-loongarch-cpu \
  10. -accel tcg,thread=multi \
  11. -bios "${bios}" \
  12. -serial stdio \
  13. -device virtio-gpu-pci \
  14. -nic user,hostfwd=tcp::2222-:22 \
  15. -device nec-usb-xhci,id=xhci,addr=0x1b \
  16. -device usb-tablet,id=tablet,bus=xhci.0,port=1 \
  17. -device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
  18. -display default,show-cursor=on \
  19. -hda "${disk}"


输入口令:loongarch

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/爱喝兽奶帝天荒/article/detail/973344
推荐阅读
相关标签
  

闽ICP备14008679号