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

Reverse unix socket forwarding in Mac deletes the source unix socket. #1724

Closed
RangelReale opened this issue Aug 10, 2023 · 3 comments · Fixed by #1725
Closed

Reverse unix socket forwarding in Mac deletes the source unix socket. #1724

RangelReale opened this issue Aug 10, 2023 · 3 comments · Fixed by #1725

Comments

@RangelReale
Copy link

Description

limactl version 0.16.0

I'm trying to run Docker Desktop on my M2 Mac, and connecting to its unix socket from inside the lima vm. So I created this configuration:

portForwards:
- guestSocket: "/run/user/{{.UID}}/docker.sock"
  hostSocket: "/Users/rangelreale/.docker/run/docker.sock"
  reverse: true

it seems to work, but the unix socket stops work both in the host and in the guest
host:

$ docker container ls
Cannot connect to the Docker daemon at unix:///Users/rangelreale/.docker/run/docker.sock. Is the docker daemon running?

guest:

docker container ls
error during connect: Get "http://%2Frun%2Fuser%2F501%2Fdocker.sock/v1.24/containers/json": read unix @->/run/user/501/docker.sock: read: connection reset by peer

It seems that when using reverse: true, the host socket is being deleted, according to @afbjorklund in slack.

@afbjorklund
Copy link
Member

afbjorklund commented Aug 10, 2023

The host socket is deleted also with reverse: false, but then it is the desired behaviour (previous code, before reverse)

@AkihiroSuda
Copy link
Member

Is this a recent regression?

@afbjorklund
Copy link
Member

afbjorklund commented Aug 10, 2023

Is this a recent regression?

It is as old as reverse: true

Apparently I was testing it with a root-owned socket, and failed to pay attention to the warnings about deletion.

Running the test now with limactl 0.17 fails miserably:
Failed to ping '/tmp/mc.sock:0:CONNECTION FAILURE.

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 a pull request may close this issue.

3 participants