I'm running Fedora 22 (64 bit, 16gb memory, ext4 boot disk) with a cinnamon desktop and I would like to use Virtual Machine Manager to run Windows 7 as a guest. However, I'm having trouble filesharing between the Fedora 22 host and the virtual machine (Windows 7). Before posting this, I searched this forum; this question has apparently already been answered, more than once.
However, one answer referred to a webpage within http://www.linux-kvm.com, which is offline. A second answer referred to http://www.linux-kvm.org/page/9p_virtio. This webpage is apparently out of date; it shows a [add : filesystem] example with type=passthrough, and no driver specified. The current virtual machine manager (virt-manager) forces type=mount, and provides Driver choices of default, handle, or path.
Anyway, I installed samba and Virtual Machine Manager via
sudo dnf install system-config-samba sudo dnf install virt-manager
I then created the /mnt/disk1 (with 1 file) and /myshareddisk1 (empty) directories and used chmod 777 on both of them. Then I added the following trailer to /etc/samba/smb.conf:
[mydisk1] comment = My Disk1 path = /mnt/disk1 public = yes writeable = yes
Then I used the following commands to enable the samba access to /mnt/disk1.
semanage fcontext -a -t samba_share_t "/mnt/disk1(/.*)?" restorecon -R -v /mnt/disk1
Then, I used the following commands to create samba passwords for the root user, and my other user, steve.
smbpasswd -a root smbpasswd -a steve
I then started samba and made /myshareddisk1 a mount of /mnt/disk1 via
systemctl start smb mount //localhost/mydisk1 /myshareddisk1 -o user=steve
I then verified the samba process via both
smbclient -U steve -L localhost ls /myshareddisk1 : the /mnt/disk1 file was displayed.
I then started the virtual machine service (systemctl start libvirtd) and started the virt-mgr application. Then I created a new virtual machine, and used a Windows 7 iso to install Windows 7 into this machine. The Windows 7 virtual machine runs ok.
SO FAR, EVERYTHING WAS FINE. HOWEVER THIS IS ALL WORTHLESS TO ME IF I CAN'T FILE SHARE BETWEEN FEDORA AND WINDOWS.
Using the virt-mgr gui, I tried to add a samba file system to the Windows 7 virtual machine; an error message was generated.
Error starting domain: internal error: process exited while connecting to monitor: 2016-05-23T23:54:21.548427Z qemu-system-x86_64: -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0, mount_tag=shared,bus=pci.0,addr=0x8: Virtio-9p Failed to initialize fs-driver with id:fsdev-fs0 and export path:/home/steve/shared02 2016-05-23T23:54:21.548491Z qemu-system-x86_64: -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0, mount_tag=shared,bus=pci.0,addr=0x8: Device 'virtio-9p-pci' could not be initialized
I then google researched, and discovered that (perhaps) virt-mgr doesn't like the source directory /home/steve/shared02, because it is not owned by the root user. I then tried a source directory of /mnt/disk1. This allowed virt-mgr to start the Windows 7 virtual machine, but did not provide any file sharing access. Then, I tried a source directory of /myshareddisk1, which (before the samba mounting) was owned by the root. This re-generated the error:
Error starting domain: internal error: process exited while connecting to monitor: ...
I then altered the mounting (mount //localhost/mydisk1 /myshareddisk1 -o user=root) and repeated the process: virt-mgr still produced the Error starting domain message. I then experimented within virt-mgr with various drive/mode combinations for the file system to be added - no joy.
Questions: If possible, please give direct answer(s) rather than referring to a webpage.
I prefer a gui such as virtual machine manager, rather than qemu commands in a terminal. Has anyone accomplished what I want? Alternatively, is there a bug in virtual machine manager, under Fedora 22?
Assuming that file sharing under virtual machine manager is unworkable, is there a different gui which will work? Cinnamon's boxes application doesn't seem to allow much customization, so that would be my last gui choice.
Assuming no gui is feasible, what terminal command(s) (e.g. qemu commands) should I run to accomplish what I want? If a sample command is provided here, I can probably reverse engineer customizing it. Command(s) would have to allow Windows 7 to be installed from iso, Windows 7 to be shut down (with image saved) and then the image of (the now installed) Windows 7 to be re-started.