IIS Application Using Shared Folder in VirtualBox VM

16

I've got a VirtualBox VM running Windows Server 2008 R2. The server is configured as a domain controller.

I've got source code on my web application on the host machine. I shared a folder to the guest VM that contains the source code. I configured an IIS application on the Guest machine and pointed it to the share (\VBOXSVR\code).

When I run the application, I get the following message:

Module: IIS Web Core
Notification: BeginRequest
Handler: Not yet determined
Error Code: 0x80070001
Config Error: Cannot read configuration file
Config File: \?\UNC\VBOXSVR\code\web.config

I've verified that the user account the app pool is running under can access the Share. Any ideas on how to fix this?

iis
virtualbox
iis-express
asked on Stack Overflow Mar 25, 2014 by Jared • edited Jun 30, 2014 by azurefrog

3 Answers

8

I had a very similar issue when setting up a vagrant box for Windows 2012 R2 with IIS for development purposes. From what I remember I was able to use the following as a workaround, but not something I would want to implement in a production environment:

  1. Make C:\vagrant a network share and set the permissions to be accessible by the user running IIS \\localhost\vagrant.
  2. Set the webroot for site to be the network share \\localhost\vagrant

In theory the following may work for your situation:

  1. Create a symlink to the network share, IE: mklink /j "\\VBOXSVR\code" C:\code\
  2. Make C:\code a network share accessible by IIS, \\localhost\code
  3. Make sure the user running IIS will have permissions to the network share
  4. Set the webroot for the site in IIS to the network share, \\localhost\code

(Optional) I added an entry into the host file (C:\Windows\System32\drivers\etc\host) for localhost. This appeared to improve performance, but it should not be necessary.

Hopefully this will point you in the right direction.

answered on Stack Overflow Aug 25, 2014 by dtripler
1

There seems to be an issue with the way Virtualbox shares the folders between Host and Guest. As I discovered when doing this with a Vagrant setup, if you manually create a UNC share on the Host, connect to that share on the Guest and point IIS at it things go along smoothly.

Note that if you are using Application Pools you should ensure the user assigned to the pool can access the share.

If you want to see what a couple of Powershell scripts looks like to automate the process, take a look in the scripts dir of https://github.com/mefellows/vagrant-smb-plugin.

Alternatively, you could use the rsync synced-folder type which has the advantage of much better performance. You could create a local Windows VM with Packer (example templates).

answered on Stack Overflow Nov 3, 2014 by Matthew Fellows • edited Jan 18, 2015 by Matthew Fellows
-2

After spending a couple of hours on this issue I finally managed to make it work. Configure your application pool identity to Guest user. If you do this everything will work as expected.

I have a setup in which the host os has the code and a virtualbox vm with IIS configured served that code from a shared folder (vbox shared folder). Everything works as expected.

answered on Stack Overflow May 30, 2015 by Radu Cosnita

User contributions licensed under CC BY-SA 3.0