Replies: 4 comments 6 replies
-
Hello, I guess it depends what you want to do, but maybe using tmux or screen might be enough. When I need more shells, I usually launch Byobu. Would this work for you? |
Beta Was this translation helpful? Give feedback.
-
@krisman maybe you can do the following to simply ssh into the guest from the host. Start vng in network bridge mode:
If your host is configured correctly (see also https://github.com/arighi/virtme-ng?tab=readme-ov-file#troubleshooting), the guest will function like any other host on your subnet. Then you can manually assign an IP, or with DHCP enabled, it will automatically receive an IP address within the subnet. Then you can start sshd inside the vng guest, using your ssh key as host key (also make sure to remove the nologin file so regular users can login):
From your host:
In this way you can ssh into your guest from your host. |
Beta Was this translation helpful? Give feedback.
-
@matttbe good point about the overhead of ssh, and it also doesn't provide any benefit for copying files remotely for example, because we already share the host's filesystem (or portions of it). @krisman I really like the vsock idea, I wasn't very familiar with it, I think we should better integrate it in vng. I was trying to test your patch, but I get this:
I guess I'm missing how the tty file is created and where... but please go ahead and send a PR, I'd be really happy to have this feature! |
Beta Was this translation helpful? Give feedback.
-
Thanks @matttbe for looking at this, this feature has been requested multiple times. I think we can start with the simple optional way, just one CID (like port 3636 for the debugging mode) and improve later in-tree. And yes, at some point it'd be nice to have |
Beta Was this translation helpful? Give feedback.
-
I usually need more than one shell in different ptys when interactively debugging the kernel in order to, for instance, run a debug script in one session while executing a test program somewhere else. I'm assuming this is a common use-case for many people, so I'm wondering how others do it.
The obvious approach would be a ssh server inside the vm. I dislike it because I don't want to keep a dropbear/opensshd server around just for that, doing host and client side key management is annoying and going through authentication for a local debugging machine seems silly. In addition, there are cases where I want to build without network support.
In the past, with the old virtme, I used to create the vm with QMP and multiple char devices, set several ttys and then had a script to connect to the consoles on demand. Recently, I started using the vsock protocol instead
For the record, I create the VM with:
-device vhost-vsock-pci,guest-cid=3
During startup, I do:
socat VSOCK-LISTEN:1024,reuseaddr,fork EXEC:"bash -i",pty,stderr,setsid,sigint,sane,echo=1
and then I can connect with:
socat file:
tty
,raw,echo=0, VSOCK-CONNECT:3:1024Is there a better/simpler way to do it? Should we get this into virtme-ng?
Beta Was this translation helpful? Give feedback.
All reactions