I have recently started experimenting with the support for passthrough filesystems in recent versions of KVM/QEMU/libvirt. Making the filesystems available for read access has "just worked", but I'm a little puzzled about how write access is supposed to work. After mounting the filesystem in the guest:

# mount -t 9p -o trans=virtio /fs/data /mnt

I can modify an existing file if it has mode o+w:

# cd /mnt/work
# ls -l foo
-rw-rw-rw-. 1 root root 17 Dec 20 11:16 foo
# cat foo
this is line one
# echo this is line two >> foo
# cat foo
this is line one
this is line two

But regardless of the directory permissions, I cannot create a new file or directory:

# ls -ld /mnt/work
drwxrwxrwx. 2 root root 4096 Dec 20 11:16 /mnt/work
# cd /mnt/work
# touch bar
touch: setting times of `bar': No such file or directory
# mkdir bar
# mkdir: cannot create directory `bar': Operation not permitted

The documentation I've been able to find (e.g., this) does not explicitly address this issue. I'm hoping someone here at Serverfault can help me set up a passthrough filesystem that will let me grant write access to a user in the guest to a host filesystem.

link|improve this question

35% accept rate
Are you sure you mounted the file system read/write? Can you create files? Are you creating files as root or regular user (yeah I see your # but you might have written that manually)? – Ysangkok Feb 9 at 11:46
feedback

1 Answer

I'm confused.

Your mount command is not kosher as far as I can see

mount -t 9p -o trans=virtio /fs/data/ /mnt -oversion=[some protocol like:9p2000.L]

Next, what does the ' filesystem .... /filesystem ' element look like, since you are using libvirt? That controls access with a security element. ( had to remove the leading < from filesystem to get the word to appear)

link|improve this answer
This is, in fact, a valid mount command. – larsks Jan 3 at 15:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.