Skip to content

Mounting unix domain sockets does not work #648

Closed
@cfstras

Description

@cfstras

Description

Hi,

while I'm loving lima so far, here's a usecase that I haven't gotten to work yet:
I have an SSH agent (https://github.com/maxgoedjen/secretive) running which has a unix domain socket in ~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh.

F.ex., I can do this in a regular shell (not docker):

# SSH_AUTH_SOCK=$HOME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh ssh [email protected]
Hi cfstras! You've successfully authenticated, but GitHub does not provide shell access.

Also, this works from my host:

# python3 -c 'import socket; sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM); sock.connect("socket.ssh")'
(no output)

Now, I want to use that socket from within my docker containers to securely pull git repositories.
However, when I try to use the socket from inside the lima VM:

# limactl shell docker -- bash -c "SSH_AUTH_SOCK=$HOME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh ssh [email protected]"
[email protected]: Permission denied (publickey).

SSH seems to ignore the socket. If I try it manually from within limactl shell, I see why:

# python3 -c 'import socket; sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM); sock.connect("socket.ssh")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ConnectionRefusedError: [Errno 111] Connection refused

I'm guessing this is because we are using sshfs, which does not seem to properly support Unix domain sockets? (Only found libfuse/sshfs#236)

Is there some recommended route I should go to use SSH within lima?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions