You are not logged in.

#1 2017-08-27 01:26:13

Omar007
Member
Registered: 2015-04-09
Posts: 368

Share data between Arch Host & Windows VM, in VM as local device

I'm currently running an Arch Linux system with a VM for Windows usage and I'm looking for a way to share data between them regardless of whether or not the VM is running.
If that was all, NFS or SMB would've been fine but sadly there are numerous programs under Windows that either don't detect network drives or do detect them but do not allow you to use them.
As such the shared data would have to be represented as a local device within the VM as opposed to a remote (network) share.

I've currently looked at the following options but none seem to help me accomplish what I need:

  1. Add storage device to the VM -> Needs an image or block device etc, can't be used by anything other than the VM while it is running

  2. NFS -> Accessible by host and VM at the same time but not usable by several programs in the VM that do not allow (or even detect) network drives

  3. SMB -> Same as NFS

  4. iSCSI -> Same as adding a storage device to the VM

I've also thought about turning things around; create an image on the host, attach as device to the VM, share the folder from the VM to the host. However, the problem with that is that the VM will always have to be running to access the data and the image file will never shrink/free the space on the host after removing data.
(theoretically you could completly zero the free space after deletion, shutdown the VM and then shrink the image but this will take quite a while and would create a ton of writes every time you delete some data and requires at least twice the image size of disk space in total on the host)

Is anyone aware of a way to share data between the host and VM, while having the data be presented as a local device as opposed to a remote device inside the VM?

Offline

#2 2017-08-27 02:55:54

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Share data between Arch Host & Windows VM, in VM as local device

Hi,
You can try to assign a drive letter to your network share or try to access it with a symlink in newer windows versions. (mklink)
https://serverfault.com/questions/10819 … 054#289054

Last edited by progandy (2017-08-27 03:00:00)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2017-08-27 10:43:55

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Share data between Arch Host & Windows VM, in VM as local device

Assigning a drive letter does not make it a local device. It's still a remote device but now has a drive letter that just makes it easier for you to use it. From the system's perspective nothing has changed.
The same sadly goes for the symlink. As soon as you try to access the symlink it has to resolve to the remote location, regardless of whether you symlinked to a remote location directly or through a drive letter that references a remote location.

Offline

#4 2017-08-27 23:03:15

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Share data between Arch Host & Windows VM, in VM as local device

I use Arch as a host and Windows as a guest (work makes us use Windows, so ...). I have a location on my Arch Linux machine that is a folder I share via assigning a drive letter in the Windows VM.

Am I missing something as to why this doesn't work for you? For the VM to be running, the host HAS to be running -- so the drive is available. Fils put on the "shared" location are accessible from both locations.


Matt

"It is very difficult to educate the educated."

Offline

#5 2017-08-28 08:28:06

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Share data between Arch Host & Windows VM, in VM as local device

The problem isn't in whether or not it is accessible, it is in how it is accessible. All of the mentioned methods do make the data available in some form or another but not in the way I need it to.
In short, I need the exposure method of an image file or iSCSI (regarded as a 'local' (block?) device in the VM) but shared and accessible by the host regardless of whether or not the VM is running (in other words, the host should be the 'owner' of the files). See my first post for more details.

Last edited by Omar007 (2017-08-28 08:33:41)

Offline

#6 2017-08-28 11:17:42

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Share data between Arch Host & Windows VM, in VM as local device

Did you try the mklink method? Depending on the software it may circumvent network storage restrictions..

You can also try to use dokan (similar to FUSE) and mirror your share.
http://dokan-dev.github.io/
https://github.com/dokan-dev/dokany/wik … or-example


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2017-08-28 12:39:24

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Share data between Arch Host & Windows VM, in VM as local device

I did.

Omar007 wrote:

...
The same sadly goes for the symlink. As soon as you try to access the symlink it has to resolve to the remote location, regardless of whether you symlinked to a remote location directly or through a drive letter that references a remote location.


I'll give dokan a shot when I get back home. It sounds promising for sure.


UPDATE:
Dokan is indeed accomplishing what I need for the most part.
I pay in CPU cycles (I've seen it go up to 10%) and it seems to have some issues around running programs or updates on the mirrored drive, but just opening/loading up files can now be done perfectly fine! smile

Last edited by Omar007 (2017-08-31 16:02:17)

Offline

Board footer

Powered by FluxBB