arighi / virtme-ng

Quickly build and run kernels inside a virtualized snapshot of your live system
GNU General Public License v2.0
456 stars 50 forks source link

[Question] is there a way to exec into an existing vng machine? #191

Closed Andreagit97 closed 1 week ago

Andreagit97 commented 1 week ago

Sometimes it could be useful to access a second shell inside the same virtme-ng machine. For example, when debugging a verifier issue we could inject some ebpf probes with retsnoop and watch the result in one shell. At the same time, in the other terminal, we could run our broken ebpf program to trigger the retsnoop output.

I was looking for something similar to docker --exec, kubectl --exec ... I see that today there is an --exec flag but it seems a different thing. Is there a way to create a second shell with existing flags?

BTW this is an amazing tool for debugging verifier failures on random kernels, thank you!

arighi commented 1 week ago

Something like this was discussed in #151 using vsock. I usually just run tmux inside the vng session to have multiple sessions. I was also planning to send a PR to start sshd inside the vng instance (as an option), so you can basically ssh into the running vng instance (the code just needs some polishing, I may be able to push something in the next days). It'd be nice to explore also the vsock idea, I haven't played with that very much.

Andreagit97 commented 1 week ago

thank you for the quick answer! I didn't notice the discussion on this, I will close this since it sounds like a duplicate of that discussion.