dhruvvyas90 / qemu-rpi-kernel

Qemu kernel for emulating Rpi on QEMU
2.06k stars 363 forks source link

Internet connection ? #134

Open Iuliean opened 3 years ago

Iuliean commented 3 years ago

How do you set that up ?

I am using native-emulation

ptrsr commented 3 years ago

This is unfortunately difficult to achieve. It is possible for QEMU to add a virtual USB ethernet adapter to the Raspi VM. However, to use this virtual ethernet adapter, the virtual raspi requires two kernel modules: USB_ETH and USB_DWC2. These have to be compiled WITH the kernel (to ensure both are the same version), and installed in the root partition.

Recently I've published a Docker image that includes QEMU, RaspiOS Lite and has internet access. In the dockerfile you can find step by step how to achieve the process described above.

nateww commented 2 years ago

If you are on a MAC, I created a PR for the native emulation that sync's up the kernel version with the release of RaspiOS to match, so that usb networking works.

See https://github.com/faf0/macos-qemu-rpi/pull/5

fgenoese commented 2 years ago

@ptrsr Would you mind publishing a recent kernel (buster, bullseye) in your repository that includes the two modules needed (USB_ETH and USB_DWC2)?

ptrsr commented 2 years ago

@fgenoese here you go. I'm planning to create a separate repo in which the image, kernel and device tree blob are automatically build and shared. For now you can use the files provided above.