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?

2
  • Hi, did you solve this problem? Commented Apr 13, 2014 at 5:15
  • same problem here, it used to work for me, not sure what changed now, any luck resolving it? Commented Jul 27, 2014 at 9:14

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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.
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 despite it being for IIS 6.0
This worked for me with the exception that I had to run my mklink command with the /d switch, not /j.
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).

Comments

-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.

4 Comments

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?
@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.
@jonathanconway did you figure it out?
Can you please clarify your answer a little bit, because it is really not clear what you did exactly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.