2

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

Ciro Santilli
  • 3,693
  • 1
  • 18
  • 44
  • hi, did you solve that problem ? I need port forwarding for gem5 to listen custom vnc server running on gem5. – Grayowl Sep 22 '21 at 16:03
  • 1
    @geekowl nope, never found a solution. The best approach would be to understand exactly how it works on QEMU and then see what gem5 is missing. – Ciro Santilli Sep 23 '21 at 09:49
  • I see... is it possible to stream frames using vncserver (default gem5 ) ? I want to run some gl samples and get frames over vnc port without installing X on gem5 disc ( it's too slow ) . I could do this on qemu but it supports port forward etc. – Grayowl Sep 27 '21 at 12:05
  • 1
    @geekowl I did manage to connect with vncserver to gem5 via its magic VNC interface, gem5 shows something like `system.vncserver: Listening for connections on port 5900` at startup. see also: https://cirosantilli.com/linux-kernel-module-cheat/gem5-graphic-mode gem5 also dumps the last frame at `m5out/system.framebuffer.png`, but it keeps overwriting that file for every new frame. – Ciro Santilli Sep 27 '21 at 20:27
  • yes i know that but ... i use gem5 to model gpu that has driver side too. so using installed driver i can test my gpu model on gem5 (i was using qemu). we have own vncserver instaelled with gpu driver but because of that port forwarding problem i cant use it. i tested vncserver but it didn't capture any gl tests frames. i used frame-capture too => nothing... well i'm disappointed... thanks for replies. – Grayowl Sep 28 '21 at 13:05

0 Answers0