Ask Your Question
3

shared folder with qemu-kvm

asked 2012-03-27 08:46:39 -0500

skytux gravatar image

How to share a folder between my host and a virtual machine created with qemu-kvm hypervisor trough virt-manager?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2012-03-28 03:24:05 -0500

René Rask gravatar image

updated 2012-03-28 04:51:36 -0500

Same as francisod says virt-manager > view > details > add hardware > file system > select folder as source > select folder name for destination > finish

Source: is the local path you want to share. eg. /tmp
Target is a mount tag for the kvm client. eg. "9p-shared"

When your client is running you can mount "9p-shared" like this:

mkdir /mnt/9p-shared
mount -t 9p -o trans=virtio 9p-shared /mnt/9p-shared

Beware that this is only solves part of the problem. You also need to figure out how file/directory permissions are handled, but this page should help:

http://wiki.qemu.org/Documentation/9psetup

With the above, I can see files and read some of them but no write access. I tested this on Fedora 17 alpha host with a Fedora 16 virtual machine.

edit flag offensive delete link more

Comments

Thanks for your answer René. I didn't know it has to be mounted manually, I thought it was similar to VirtualBox. But when I try to mount I got an error about 9p: mount: unknown filesystem type '9p'. Any idea?

skytux gravatar imageskytux ( 2012-03-28 07:34:43 -0500 )edit

My host is Fedora 16 and the guest is Fedora 17, they are not so old... ok, I will have to figure out what is happening... thanks.

skytux gravatar imageskytux ( 2012-04-05 09:55:29 -0500 )edit

On RHEL 6.4 I'm getting the same problem as @skytux. I tried modprobing 9pnet_virtio, but no luck. Digging further.

clacke gravatar imageclacke ( 2013-06-27 03:29:32 -0500 )edit

It seems 9pnet_virtio is just the transport layer and a 9p module is required .. which is not in the standard kernel package. I wonder why 9pnet_virtio is there when it cannot do anything on its own.

clacke gravatar imageclacke ( 2013-06-27 03:31:55 -0500 )edit
0

answered 2012-03-27 13:49:02 -0500

FranciscoD_ gravatar image

Well:

virt-manager > view > details > add hardware > file system > select folder as source > select folder name for destination > finish

I'm just not sure of the "target/destination folder" part. Not sure what should be put in there.

edit flag offensive delete link more

Comments

I sould have explained that I also tried that, but didn't know how to set target/destination, and without that doesn't work. I googled with no luck.

skytux gravatar imageskytux ( 2012-03-27 14:31:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-03-27 08:46:39 -0500

Seen: 24,821 times

Last updated: Mar 28 '12