Skip to content

Conversation

@g-easy
Copy link
Contributor

@g-easy g-easy commented Feb 15, 2022

"sshfs -o vsock=CID:PORT" will cause sshfs to connect directly to the
given vsock, bypassing ssh, and allowing high performance sshfs mounts
of a VM guest.

"sshfs -o vsock=CID:PORT" will cause sshfs to connect directly to the
given vsock, bypassing ssh, and allowing high performance sshfs mounts
of a VM guest.
@g-easy
Copy link
Contributor Author

g-easy commented Feb 15, 2022

Example usage, doesn't even require a VM:

socat VSOCK-LISTEN:12345 EXEC:"/usr/lib/openssh/sftp-server",nofork
./sshfs -o vsock=2:12345 unused_host: ./tmp

(CID=2 means loopback)

Most of the performance gain is from reducing the amount of data copies (rather than avoiding ssh encryption), i.e. socat+nofork means the sftp-server's stdio is dup'd directly to the vsock.

@Nikratio
Copy link
Contributor

Thank you for the patch!

I am not sure if it makes sense to merge this into SSHFS. There is nothing wrong with it on a technical level (at least on first glance), but adding a capability to bypass SSH in a program called SSHFS does not seem wise to me.

Do you have any references about what sits on the other end of a vsock and implements the server-side protocol? Is it the kernel, or another userspace program?

I am also curious about how this relates to virtiofs, which I thought is the recommended way to share filesystems with VMs?

@g-easy
Copy link
Contributor Author

g-easy commented Feb 23, 2022

what sits on the other end of a vsock and implements the server-side protocol? Is it the kernel, or another userspace program?

For my use-case, it will be the usual userspace sftp-server, basically the same as in the socat+nofork example above.

adding a capability to bypass SSH in a program called SSHFS does not seem wise

I understand where you're coming from. :) I have an existing setup where sshfs runs over ssh. I'd like to keep most of my setup and just make it run faster. i.e. I want to keep the sftp protocol part and change the plumbing.

I'd really like to be able to use a vsock directly from sshfs instead of having to plumb stdio around. sshfs already implements -o directport and -o passive but passive mode in particular disables multi-threading.

@h4sh5 h4sh5 merged commit 70c8fd9 into libfuse:master Nov 6, 2023
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.

3 participants