I noticed no one had implemented 9p in rust yet and rust is cool (although another person started working on it while I was)
I wanted to give everyone a standard base to build upon if they were to make differing server implementations, so there could at least be some shared code.
I’ve still got some cleanup to do on this crate, and I have a fairly simple in-memory filesystem server that I’ve been using for testing that I’ll publish soon as a separate crate.
They stopped working on it a while ago, and I took over the crate name on crates.io– they’ve since deleted the repo, but you can browse the source from docs.rs:
Ah, that makes sense. That’s because there’s 9p support built into the linux kernel for it, and it can work with virtio to provide very low overhead for the file sharing.
I always wanted to write something like this, but I never managed/bothered to assemble suitable documentation and/or existing implementations to test against.
For both documentation and implementation testing, I used plan9port. It has a one-shot client for simple reads, writes, and stats, as well as a 9p FUSE adapter. Alternatively, there’s 9p client support built into the Linux kernel.
I might spin up a 9front VM to do some even more rigorous testing, though.
Author here.
I wanted to make this for a few reasons:
I’ve still got some cleanup to do on this crate, and I have a fairly simple in-memory filesystem server that I’ve been using for testing that I’ll publish soon as a separate crate.
I had also started working on my own version, but never got far. So thank you for this. Do you have a link to that other implementation?
They stopped working on it a while ago, and I took over the crate name on crates.io– they’ve since deleted the repo, but you can browse the source from docs.rs:
https://docs.rs/crate/nine/0.1.2/source/
FWIW, I believe crosvm (the ChromeOS hypervisor written in Rust) has an implementation of 9p: https://chromium.googlesource.com/chromiumos/platform/crosvm/+/refs/heads/master/p9/
Interesting! I wonder what they use it for.
File sharing between the host and the guest I believe. My understanding is that 9p is a relatively common choice for that, for whatever reason.
Ah, that makes sense. That’s because there’s 9p support built into the linux kernel for it, and it can work with virtio to provide very low overhead for the file sharing.
I always wanted to write something like this, but I never managed/bothered to assemble suitable documentation and/or existing implementations to test against.
Well done!
Thanks!
For both documentation and implementation testing, I used plan9port. It has a one-shot client for simple reads, writes, and stats, as well as a 9p FUSE adapter. Alternatively, there’s 9p client support built into the Linux kernel.
I might spin up a 9front VM to do some even more rigorous testing, though.