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?

azurefrog
  • 10,785
  • 7
  • 42
  • 56
Jared
  • 397
  • 1
  • 3
  • 11

3 Answers3

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.

dtripler
  • 81
  • 1
  • 2
  • Awesome, thank you for this -- this solved a longstanding frustrating vagrant issue. However, I'm noticing performance for this method is really slow. Wondering if you've got any insight or in your use of this method have found workarounds to improving it? For example, basic requests to a static HTML file take 1-2 seconds to load. Haven't even tried an ASP.Net site yet. – Ken Sykora Sep 01 '14 at 18:33
  • Sadly this was a workaround so it does not have the best performance. I do remember having performance issues at first. If I remember right I did the following: I increased the vm specs to have 3GB of memory and 4 processors, tweaks the app pool to recycle after an hour, added localhost entry in the the host file, and edited the registry per [this MS doc](http://technet.microsoft.com/en-us/library/dd296694(v=ws.10).aspx) despite it being for IIS 6.0 – dtripler Sep 03 '14 at 12:49
  • This worked for me with the exception that I had to run my mklink command with the /d switch, not /j. – Jordan Oct 24 '17 at 17:50
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).

Matthew Fellows
  • 3,669
  • 1
  • 15
  • 18
-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.

Radu Cosnita
  • 330
  • 2
  • 4
  • Was this a built-in 'Guest' account? My installation of Windows Server 2008 R2 doesn't have a 'Guest' account. So I'm wondering whether it would work if I created one? – Jonathan Jul 03 '15 at 05:51
  • @Radu Having currently exaclty the same problem, what you had. Can you please explain, what you men with "configure your application pool identity to Guest user"? I `opened the IIS Manager -> my System -> Application Pools` and found there my fresh set up website. The right mouseclick displays a context menu with some points, that might be relevant: `Set Application Pool Defaults...`, `Basic Settings...`, `Advanced Settings...` How to configure now the application pool identity to Guest user? Thanks. – automatix Feb 03 '16 at 15:23
  • @jonathanconway did you figure it out? – Rob May 21 '16 at 15:51
  • Can you please clarify your answer a little bit, because it is really not clear what you did exactly? – Mladen B. Dec 01 '16 at 15:26