2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Windows10環境でQEMU/Raspberry PiをホストOSと通信できるようにするまで

Last updated at Posted at 2021-08-21

やりたいこと

WSL※環境でQEMUとホストOS間でL2レベルの通信を可能にしたい.
※WSL1/WSL2どちらでもよい.

試行錯誤して実現できたこと

Windows版のQEMUをWSL1上で実行し,ホストOS とゲスト OS 間で ping できた.

環境情報

QEMU実行手順

ダウンロードしたファイルを配置する.

$ ls /mnt/c/project/qemu/
2019-07-10-raspbian-buster.img
kernel-qemu-4.19.50-buster
versatile-pb.dtb

qemu を起動する

/mnt/c/qemu/qemu-system-arm.exe \
        -M versatilepb  \
        -cpu arm1176 \
        -m 256 \
        -net tap,ifname=tap0 -net nic \
        -hda 2019-07-10-raspbian-buster.img \
        -serial stdio -usb -device usb-kbd \
        -dtb versatile-pb.dtb \
        -kernel kernel-qemu-4.19.50-buster \
        -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw"  \
        -no-reboot

以上で,デモ動画にあるような感じでホストOS/ゲストOS間でpingできるようになりました.

起動後,ログイン用のプロンプトが出ますが,以下で入れます.

username: pi
password: raspberry

なお,ゲストOSのIPアドレス設定は,以下の記事の内容に従って設定しました.

補足

Windows10のセキュリティ設定でICMPの受信を有効化しないと,ゲストOSからホストOSへpingが通りません.この場合の対処方法は以下を参照ください.

実現できなかったこと

現時点(2021/08/21)では,WSL/Ubuntu版のQEMUはだめでした.

下記の記事にある通り,WSL2でKVMが利用できれば実現できるはずなのですが,自分の環境では再現できませんでした...

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?