Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement unix socket forwarding #369

Merged
merged 4 commits into from Nov 2, 2021

Conversation

jandubois
Copy link
Member

This is an alternative to #367. It doesn't parse /proc/net/unix at all, but just sets up any configured socket forwards when the guestagent is started, and tears them down when the hostagent exits.

This is now my preferred implementation.

$ limactl start --tty=false examples/docker.yaml
[...]
$ DOCKER_HOST=unix://$HOME/docker.sock docker info | grep -E 'Root|System'
 Operating System: Ubuntu Impish Indri (development branch)
 Docker Root Dir: /home/jan.linux/.local/share/docker
WARNING: Running in rootless-mode without cgroups. To enable cgroups in rootless-mode, you need to boot the system in cgroup v2 mode.

Fixes #221

@jandubois jandubois force-pushed the socket-forward-take2 branch 2 times, most recently from 324ce9d to 2dcefdf Compare October 29, 2021 06:51
@jandubois jandubois changed the title Implement unix socket forwarding - alternate implementation Implement unix socket forwarding Oct 29, 2021
examples/docker.yaml Outdated Show resolved Hide resolved
@jandubois jandubois force-pushed the socket-forward-take2 branch 4 times, most recently from 3369df0 to cddcaa2 Compare November 1, 2021 20:58
@jandubois jandubois marked this pull request as ready for review November 1, 2021 21:39
@AkihiroSuda AkihiroSuda added this to the v0.7.3 milestone Nov 2, 2021
pkg/hostagent/hostagent.go Outdated Show resolved Hide resolved
Either or both sides of a forward can be a unix socket, but the user
will need to have access to the socket because forwarding is done via
ssh using user priviledges and not root.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois jandubois force-pushed the socket-forward-take2 branch 2 times, most recently from 961a568 to a8140f7 Compare November 2, 2021 02:03
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
* cancel HA context to stop reconnecting to the guestagent
* don't show an error when ga connection is lost due to cancel
* cancel ssh forwarding using Background() context to make sure it runs

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jandubois jandubois merged commit 8b46bc4 into lima-vm:master Nov 2, 2021
@jandubois jandubois deleted the socket-forward-take2 branch November 2, 2021 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for forwarding UNIX sockets from the guest to the host
2 participants