I’m currently working on a project where I need to establish communication between a user space process running on an Android emulator and another process running on the host machine. I’m looking for reliable, low-latency, high throughput communication channels. Our main targets are macOS and Windows hence a cross platform solution would be ideal however I’m ready to support both platforms separately if needed. While TCP/IP serves as a fallback, I’m interested in experimenting with alternative routes to see if we can find something that performs better for our specific use case. So far I’ve found several options but none seem to meet our criterias.
Android Goldfish
An ancient documentation in Android emulator mentions Goldfish Pipe as a fast mechanism to transfer data between host and guest processes. According to docs the pipe exposes a service named “unix:” which allows opening UNIX domain socket on the host but I failed to get a response for that service. It’s possibly removed in favor of better alternatives. I noticed that qemud is responding which is actually a multiplexer for some other services but I couldn’t figure out how to leverage it.
ivshmem
This seems available only for Linux hosts. I found an attempt to bring it into macOS but it is not maintained. Our project will be deployed to client computers and installing a kernel extension is not an option anyway.
vsock
I’ve stumbled on this project and gave it a try however I receive ENODEV when trying to open AF_VSOCK socket. XNU source reveals some traces for AF_VSOCK but I’m not sure if it is really supported. I can dig it further if I can confirm that is is actually supported. Also, what about Windows support ?
Question
What viable options exist for bi-directional high performance communication between a host process and process on Android emulator ? What are the trade-offs ? These requirements are likely needed by others in the long history of Qemu so I suspect I’m overlooking some fundamental solutions.