winfsp / cgofuse

Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
https://winfsp.dev
MIT License
527 stars 84 forks source link

sharing mounted drive #31

Closed gshenai1 closed 5 years ago

gshenai1 commented 5 years ago

I am able to run the example/hellofs and mount it on my windows computer. However, when I try to share the drive, I get an error message "The device or directory does not exist". Any suggestions on how to get the mounted drive to be shared?

billziss-gh commented 5 years ago

To share the drive you must ensure that the drive is created by the SYSTEM account, which creates drives in the global drive namespace. You must also create the file system as a disk file system (I.e. no “volume prefix”). Then you can use Explorer or NetShareAdd to share the drive.

Please see the documentation for DefineDosDeviceW to understand more about drive namespaces.

gshenai1 commented 5 years ago

Thanks @billziss-gh. I am trying to play with the hellofs program. I will create the drive through SYSTEM account as suggested by you. However running hellofs automatically creates a drive. In the hellofs, how can I create a "disk file system" and can I map it to a pre-created drive (created by SYSTEM account)? Is there an example that I can look at?

billziss-gh commented 5 years ago

Sorry for the delay in response. I am just back from vacation.

I recommend focusing on memfs as hellofs is a very basic toy file system.

To start memfs (or hellofs) simply supply the X: drive you want in the command line. This will create a disk file system by default.

> memfs X:

By default the X: drive gets created in your account's "drive namespace" and cannot be shared. If you start it under the SYSTEM account (e.g. using psexec from sysinternals) it will be created as a global drive and you will be able to share it.

gshenai1 commented 5 years ago

Thank you, Bill, for your response. Trust you had a good vacation. I was able to get it to work using psexec. Appreciate much.