Linux – Share files between Linux host and Windows guest

file-sharingkvmlinux

I am trying to share files between Linux host and Windows guest and I came across the link:

Use virt-manager to share files between Linux host and Windows guest?

As suggested in the third answer, I followed the steps:

  1. Find the offset of your file system (since it is a disk) using fdisk:

    $ fdisk -lu Win.img
    
  2. Mount the image using command:

    mount Win.img /mntpoint -o ro,loop,offset=32256
    

Here,this seems to be promising approach. I am able to see the files of Windows guest VM on Linux host. However, I am not able to see any changes on host side if I make changes on guest unless I remount the image again.

Is there anyway to refresh that memory so I can see changes on host side too?

Best Answer

No, reading the images is not reliable when the disk is in use by the guest.

If you shut the guest down it'll work fine (because no changes will be made).

If you want live access to the files, you have to ask windows nicely, EG: smbmount or share a linux filesystem to the guest using samba. The latter avoids windows file-locking problems which is convenient for things like logfiles.

Related Question