IIS on Virtualbox VM, web root on host machine - iis

I am running an instance of Windows 2008 R2 server (IIS 7.5) on a Virtual Machine.
I have created a new website that resides on the host (//VBOX/d_drive/web). IIS seems to have problems with this, throwing 500.19 errors.
I have tried to use a UNC share.
I have given all permissions to IISUSRS, Network Service, etc.
I have tried to change the Application Pool impersonation.
Nothing solves the problem (moving to an UNC share and mapping a drive to it at least fixed another issue: IIS wouldn't even write a web.config before this)
Anyone has hints? Thanks.

After attempting several routes, I found one and only one perfect solution:
1) Create a new windows user with administrative rights on the Virtual Machine
2) Create the same user on the host machine, with a matching password
3) On the Virtual Machine, set the Application Pool to impersonate this new user
4) On the host machine, give to the user full rights to the shared folder
I have stumbled on multiple questions about this same exact problem, both here and on ServerOverflow and ServerFault all with no answers, or solutions that only proposed to change the whole setup. I hope this will help.

Related

Website not working in IIS 7 using the IIS Manager

I have Microsoft Windows server 2008 R2 and have the IIS 7 running.
I have coded a web application on a seperate laptop and would like to publish it now on my server (serves as AD, DNS, File Server, IIS) that runs locally and has no external access. We will be using the application internally only.
I have followed the steps to install a website on IIS, however, it does not work. Below are the steps I have done.
Created a folder hierarchy and pasted the code files there. (check below image. The code files are inside wwwroot)
Create a new website from the IIS Manager as the below image.
The wwwroot folder has SYSTEM permission and it inherits the permissions from the parent. (Does it need to have other permissions?!?)
Whenever I visit the website, I get an error that the page is not found.
UPDATE
Upon #Ravi A's answer below, I have tried his steps as the below image, but the username is not found and the error persists.
Any ideas what is wrong?
windows iis website
You need to add a binding in your DNS i.e. ping mysite.local should resolve to the server IP, in your case since it's a intranet it should resolve to 192.168.1.253.
See here on how to do it. You need access to DNS Manager.
Also since you are not clear on DNS mapping leave the hostname empty and use machine name or IP to browse the site.

Unable to access IIS Metabase

I have Visual Studio 2013 and a pretty basic MVC web application.
When I am connected to my work network (hard wire or VPN) I can open up VS without issue. However when not connected to my work network I get the following error:
---------------------------
Microsoft Visual Studio
---------------------------
Creation of the virtual directory http://localhost:54156/ failed with the error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
---------------------------
OK
---------------------------
I've tried granting my user rights to IIS via the aspnet_regiis -ga mydomain\myuser and that did not help.
I am certainly running VS as an administrator. It works just fine when connected to the network. Our security and server teams do not seem to understand why this would behave this way.
Is this IIS Express? I (and those I work with) often get a similar error due to the domain login script encrypting My Documents. It's fixed by simply decrypting
Documents\IISExpress\config\applicationhost.config
Not sure if that's the issue here though;
Ultimately I believe this to be an issue between our network policies and the IIS and .NET installs.
When I was off network it could not access the cached user folders. Switching from having the home drives on network to having them local did not fix the issue (assuming some files were still referencing the network location).
I had my system refreshed and started with my user folders as local and have not had the issue since.
I know it's an old question, but at my location the user profile is stored on the network. When I checked to see if the IISExpress application was encrypted as Chad Schouggins suggested, I didn't even have a documents folder. Ultimately, the answer was really simple:
turn the machine off and back on again.

IIS Application Using Shared Folder in VirtualBox VM

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?
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:
Make C:\vagrant a network share and set the permissions to be
accessible by the user running IIS \\localhost\vagrant.
Set the webroot for site to be the network share \\localhost\vagrant
In theory the following may work for your situation:
Create a symlink to the network share, IE: mklink /j "\\VBOXSVR\code" C:\code\
Make C:\code a network share accessible by IIS, \\localhost\code
Make sure the user running IIS will have permissions to the network share
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.
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).
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.

Getting VBox IIS to use shared volume for website physcial path

Im trying to use a VM as the webserver to test code and design changes made to content on development systems. The following what I am doing.
Create Windows 7 Enterprise VM on Virtual Box
On Virtual Box share the Web development folder on Host system
in IIS on VBox I select the share \Vboxsvr\WebDev\Site1 as the physical path for the website. IIS doesn't complain it can't see this volume when I do this.
when I try to preview the site on the Vbox Guest I get a 500.19 error , it appears that it can't read the files. I am suspecting permissions issues, any idea how to resolve this?
(By the way I have tried this With VMware as well but iis won't even recognize shared folders.)

Wmi Security on Windows 8

I have some problems regarding WMI scripting on Windows 8. More precisely, remote connection from Win7(not that relevant) to Windows 8. Note that the following issues do not happen when the client machine runs Windows 7.
First one is getting data regarding the current shares on that machine. Specifically, I am trying to get the Path property of the shares, that is local path.
In windows 7 it works perfectly, in windows 8 however it returns null(ran with wbemtest from remote computer).
First I thought that there is a problem with the WMI system. Then I ran the same query directly on the win8 machine. That returned the actual local path of the share. This led me to believe that there are problems with the WMI security on that machine.
Another issue I have with WMI on win8 is that it does not allow me to run things as Administrator, even though the user used to log is is the Administrator.
Regarding the security settings on the win8 machine, I gradually lowered them to try the exact position in which I can operate. I have reached the level where Everyone has every access, so it is the lowest security possible. Hope someone can help.
After a few days of just playing with security around Wmimgmt.msc and dcomcnfg I finally found a way to run wmi as administrator on a remote machine. Although this is not exactly what I did, I found that this works great: I activated the Administrator account: net user administrator /active:yes. Then I entered User accounts and set a password for the Administrator account. I then opened Wmimgmt.msc and set allow on all security for the Root node and cimv2 node. After this Wmi remotely(logged on as administrator) works as a charm

Resources