# Linux Kernel Module Cheat
The perfect emulation setup to study and develop the <<linux-kernel>> v5.9.2, kernel modules, <<qemu-buildroot-setup,QEMU>>, <<gem5-buildroot-setup,gem5>> and x86_64, ARMv7 and ARMv8 <<userland-assembly,userland>> and <<baremetal-setup,baremetal>> assembly, <<c,ANSI C>>, <<cpp,C++>> and <<posix,POSIX>>. <<gdb>> and <<kgdb>> just work. Powered by <<about-the-qemu-buildroot-setup,Buildroot>> and <<about-the-baremetal-setup,crosstool-NG>>. Highly automated. Thoroughly documented. Automated <<test-this-repo,tests>>.

#### 15.3.2. Guest to host networking

First Enable networking.

Then in the host, start a server:

    python -m SimpleHTTPServer 8000

And then in the guest, find the IP we need to hit with:

    ip rounte

which gives:

    default via 10.0.2.2 dev eth0
    10.0.2.0/24 dev eth0 scope link  src 10.0.2.15

so we use in the guest:

    wget 10.0.2.2:8000

Bibliography:

- https://serverfault.com/questions/769874/how-to-forward-a-port-from-guest-to-host-in-qemu-kvm/951835#951835

- https://unix.stackexchange.com/questions/78953/qemu-how-to-ping-host-network/547698#547698