-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: vsock support for remote console access
Having a remote console access can be helpful for different reasons, e.g. an easy way to have multiple terminals, not using a serial which can be slow to print a lot of text, etc. With this new support, a user can simply use vng like before, and add the new --vsock option: vng --vsock (...) Then in another terminal, it can connect to the existing VM: vng --vsock-connect Advanced users can set a different CID with --vsock-cid, useful when multiple VMs are started in parallel. It is also possible to change the command that is executed when connected inside the VM. By default, 'bash -i' is used, but it is possible to pass something else, e.g. vng --vsock byobu Or zsh, fish, tmux, etc. Or a script, for example to set env vars, change dir and set other dimensions, etc., e.g. starting the VM with: $ vng --vsock "${PWD}/console.sh" ... and connecting to it from another terminal with: $ read -r rows columns <<< "$(stty size)" $ cat <<-EOF > console.sh #! /bin/bash stty rows ${rows} columns ${columns} cd "\${virtme_chdir}" HOME=${HOME} byobu EOF $ chmod +x console.sh $ vng --vsock-connect Note: on my side, 'bash' is a bit weird: I cannot see the command I'm typing. I didn't try to find a solution for a too long time as I'm usually not using bash. Regarding the kernel config, two new config are now required: VSOCKETS and VIRTIO_VSOCKETS. They seem light enough. While at it, fixed a typo in the README file with the --network option. Link: #151 Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
- Loading branch information
Showing
6 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters