How to do port forwarding from guest to host and v

2019-08-10 07:59发布

问题:

For example, I want to be able to do on guest:

nc -l -p 45455

and then on host:

echo asdf | nc  localhost 45455

and have the guest receive the asdf.

My initial goal with this is to setup gdbserver, but this could also be used for fun things like simulating clusters.

For the specific case of gdbserver, it is also be possible to step debug userland processes with gem5's default GDB server as described here, but that may be more unreliable.

In QEMU for example, I can do that with:

-netdev user,hostfwd=tcp::45455-:45455,id=net0

I am also interested in the guest to host direction, although that I haven't managed to do in QEMU yet: https://serverfault.com/questions/769874/how-to-forward-a-port-from-guest-to-host-in-qemu-kvm

If it is not possible, I will accept a "it is not possible answer" from a well known dev :-)

https://www.mail-archive.com/gem5-users@gem5.org/msg15207.html

标签: gem5