IIS Application Using Shared Folder in VirtualBox VM - iis

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.

Related

How to set up a development environment for React when IT won't allow you to install anything on your Windows workstation

I am working for a client that does not allow setting up anything on the native Windows workstation.
I am, however, allowed to set up a virtual machine on which I can install anything I want.
So, I've set up a Linux VM and installed the React environment.
However, I would like to be able to use the native Windows tools that are allowed for development, since installing and using them on the VM is painfully slow.
I'm currently modifying the code with a native Windows IDE, then pushing the changes to a Git repository, then pulling the changes down to the Linux VM to see them work. However, for debugging, where changes are added, removed, modified, etc... this is also painfully slow.
I tried to set up a shared folder to work on the code locally and having it update on the Linux VM dynamically, but that doesn't work because "npx create-react-app" does a bunch of things, like set up symlinks, that either don't work on a shared folder or aren't allowed by IT. I'm guessing it's the shared Windows folder that's limiting this. I also tried to set up a Samba share of the Linux folder, but I think this is blocked by IT, because I just can't see it from my Windows machine, and network discovery is turned on.
So, now that you know my pain, what would be the best way to set up a React development environment in this situation? Help...
I almost understands nothing about linux and VM, but here is something you can do.
When creating a react application with create-react-app, when you run npm start, your application will be hosted in localhost:3000.
So to do what you want, you need to set up the enviroment in the VM (e.g. create-react-app) and then configure (this is the part I don't understand how to do) your VM in a way you can access the VM's localhost and the files of your project.
This way you can edit the files of the VM and also see the app changing in the windows browser.
How to share VM's folder with host
How access VM's localhost

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.

IIS on Virtualbox VM, web root on host machine

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.

Launching an app using its URL on OpenShift Origin

I'm learning to use the open source version of OpenShift. I have downloaded the linux image and started it on a virtual machine (named VM1) on my PC, which runs Windows 7. On another VM (named VM2) I have installed another linux OS and configured the JBoss IDE to work with OpenShift. Then I have successfully created and hosted an app on my local OpenShift PaaS cloud. Here is where the problem starts:
On VM2 (the one running linux where I developed the app) I have no problem accessing my account webpage on OpenShift, viewing what apps I have created and testing them.
From any other PC on my network I can log in to the OpenShift web console and view my apps by simply entering the IP of VM1 (in my case 192.168.1.107). There I can see the URL to launch my app: http://localtest2-mydomain.openshift.local/ . But when I click on it, I get a message saying that the web page is not available. Again, if I use this link in VM2, it works like a charm.
I tried changing the system32\drivers\etc\hosts file so that and link ending in openshift.local will be sent to the IP address of VM1, but it doesn't work. Can anyone help me?
As far as I know, you can not use wildcards in your hosts file, you would need to specify the entire url in your hosts file for it to find it correctly. Give that a try and see if it helps.

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

Resources