0

Using Vagrant, I have a fileshare setup with SMB from host-to-guest (h2g) between a virtual machine running on Microsoft's Hyper-V Hypervisor, and Windows Operating Systems on both, host & guest machines.

Inside my virtual machine, I can access my website files from C:\vagrant\FileShare\site1 and read/write/modify any file or folder from host or guest successfully. Awesome.

Now I want to setup an IIS website instance to point to my Fileshare located at C:\vagrant\FileShare\site1\wwww so I went ahead and did this in IIS manually with default settings, default application pool, and the correct paths. I also assigned read/write permissions for IUSR, NETWORK, NETWORK SERVICE, and IIS_IUSRS just to avoid any permission issues.

However, when I test out the site I do seem to get permission errors as IIS presents the following error:

IIS Permission problem

0x80070005 - Cannot read configuration file due to insufficient permissions

Is it actually possible to setup an IIS website with Vagrant and Windows? Or is this a limitation with Vagrant?

One solution I've seen people suggest is using a filesync program inside the guest OS so that the files are available on the host Operating Filesystem. However, this isn't practical as it adds more complexity to the setup and takes twice the amount of storage space, which was my reason for switching to a Vagrant setup in the first place.

In linux Vagrant, it's possible to setup a fileshare for a webserver with the following config, where fmode = file mode and dmode = directory mode

config.vm.synced_folder folder_source folder_destination,
    id: "vagrant-root",
    owner: "vagrant",
    group: "www-data",
    mount_options: ["dmode=775,fmode=664"]

But in Windows with an IIS setup I just can't figure out how to do this. Can anyone give any suggestions before I completely give up and go back to developing locally?

Thank you.

Joel Murphy
  • 2,472
  • 3
  • 29
  • 47
  • The error page should also show you a file path. What's that? – Lex Li Jul 17 '19 at 13:30
  • Hi @LexLi , it's \\?\C:\vagrant\FileShare\site1\www\web.config. The file exists and the groups which I listed above have permissions to the file. Do you have any idea how I can debug this further? – Joel Murphy Jul 17 '19 at 13:36
  • Yourself probably has no way to debug it effectively, https://groups.google.com/forum/#!msg/vagrant-up/3FROWa-S7DA/gGm1-4FnBQAJ It sounds like a design flaw of vagrant. People reported success with other file sync technologies, so you should switch to. – Lex Li Jul 17 '19 at 13:47

0 Answers0