Skip to content

Instantly share code, notes, and snippets.

@shimomura1004
Last active December 18, 2021 11:50
Show Gist options
  • Save shimomura1004/4fe54ad0a74b2ee8e8c4fd18b911570f to your computer and use it in GitHub Desktop.
Save shimomura1004/4fe54ad0a74b2ee8e8c4fd18b911570f to your computer and use it in GitHub Desktop.
x86-64 の QEMU で arm64 の Linux カーネルを実行する
まず arm64 用の Linux カーネルをビルドする
https://kasiviswanathanblog.wordpress.com/arm64-vanilla-kernel-in-qemu/
実行には、カーネルをビルドしたときにできる start_qemu を参考にする
別途 yocto などで作った rootfs などを QEMU に渡して起動する
sudo qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=/dev/sdb2,if=none,format=raw,id=hd1 -device virtio-blk-device,drive=hd1
Xen と併用するなら "-machine virtualization=true" を追加する
(https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/qemu-system-aarch64)
yocto で作ったカーネルで /etc/resolv.conf が起動時に上書きされる問題、いつもどおり resolv.conf を書いて
cat /etc/resolv.conf | resolvconf -a eth0
とすると設定が反映される
@shimomura1004
Copy link
Author

qemu aarch64 では graphics はサポートされていないので注意

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment