[Aboriginal] 9p VirtFS for /home

Rob Landley rob at landley.net
Wed May 25 05:46:37 PDT 2011

On 05/25/2011 03:57 AM, Niklas Brunbäck wrote:
> On Mon, 23 May 2011, Salman Aljammaz wrote:
>> Caveat: Because this uses VitrIO, this currently only works for x86
>> targets.  I believe there was an effort to make that work with ARM as
>> well [2] but I don't know what's happened with that.  Meanwhile we
>> could just run a real 9p server (inferno/npfs) and mount it over the
>> network.  I wonder why qemu doesn't do 9p with its user mode network,
>> like cifs...  I should look into that.
> I'm currently using unfsd (http://unfs3.sourceforge.net/) to mount stuff
> in qemu. It works really well, but you have to do a "cp -rs
> /nfsmount/path/to/source /path/to/some/local/fs" and build in
> /path/to/some/local/fs. I'm also exporting the toolchain to the target
> via NFS.

The control images are squashfs (read only) mounts on /mnt, so they also
havve to cp -s into writeable space in order to build.  (That's a
marvelous trick, isn't it?)

So far 9p is in fact capable of being built in.  (I'm playing with
crosstool in a qemu debian image that's only got a 1 gig filesystem and
debian takes up over half of that, so I've got /mnt/diod with more space
to hg clone crosstool into...)

I am very interested in automating this, but I'd also like to get the
infrastructure right...

> It should work with most arches and it does not require root privileges
> but you need to specify mountport=, port= and mountvers=3.

The diod server can also do the same thing for 9p via tcp/ip.  The
advantage of virtfs is that it's built into qemu.

9p is a nice protocol that can in theory work through any arbitrary
serial connection, it needs one connection per mount.  For virtfs it's
using virtio to provide that connection, for diod it's using tcp/ip for
that connection.  In theory, qemu could fake up a TCP/IP connection (it
would just require a bit more emulation to break it down into packets
and then stitch them back together, right now the -net user stuff other
than masquerading is packet based rather than stream based.  The virtual
DNS server, virtual dhcp server, etc...)

So the _ideal_ solution would be to be able to have a qemu option that
could fake up a 9p server on the way samba works now (iana gave
it port 564), so we wouldn't even need to run diod on the host's
loopback but just go "-v9fs security_model=mapped,path=/dir/to/export"
and then mount it in the target system from

> It wants to link to libfl. I'm building it statically with the cross
> compiler just in case I need to export something from the target.
> Niklas

I'm having some problem where building qemu myself, it's not including
virtfs support.  I have no idea why, it did last time but I've
reinstalled my laptop since and am probably missing some unmentioned
prerequisite library.  Sigh...



More information about the Aboriginal mailing list