vsock icon indicating copy to clipboard operation
vsock copied to clipboard

vhost-user-vsock

Open aep opened this issue 3 years ago • 3 comments

vhost-user-vsock implements vsocks as uds on the host.

i wonder what it takes to implement that in this package. there appears to be a rust impl

https://github.com/rust-vmm/vhost-device/pull/7/files

but i'm not sure if thats the correct layer

aep avatar Jun 30 '22 13:06 aep

Hey there, I have very little context as to what this actually is or what sort of use cases it solves. It's my understanding that the virtio-vsock device with qemu is the defacto solution but would this be for communicating between local processes on the same machine? If so then more recent versions of the vsock kernel modules support loopback communication on the same host.

I just ask because I am a bit removed from the space and would like to understand the use cases for the feature here, and what sort of APIs you'd expect to see. Thanks!

mdlayher avatar Jun 30 '22 14:06 mdlayher

ah, sorry!

normally vsock is implemented by using the host kernel vsock implementation. i.e. the host just opens a socket with AF_VSOCK. However, that's not safe in multi tenancy situations where you don't trust the VMs, so that's what vhost-user-vsock is for.

It implements the host side as vhost-user unix domain socket. the pull request i linked contains an example implementation in rust. Unfortunately i dont know much more either. it looks like vhost-user is fairly complex and i couldnt find a golang implementation of it. It's likely not worth it implementing it in go-vsock if the base vhost-user impl doesnt exist

aep avatar Jun 30 '22 14:06 aep

No worries! We can leave this open for tracking but yeah it seems like a lot more plumbing would be required.

mdlayher avatar Jun 30 '22 14:06 mdlayher