IIS in Windows 10 VirtualBox guest has VirtualPath on Ubuntu 16.04 VirtualBox host

"Connect as"... lets IIS in VirtualBox Guest deliver files from a ZFS disk on Ubuntu 16.04 VirtualBox host



( artwork credit to Theo Junior )


This is the system:

Host Operating System: Ubuntu 16.04 LTS
VirtualBox is installed on this host.

Guest Operating System: Windows 10 Pro
Microsoft IIS is running in this guest.
Drive C: with \Windows is a .VDI VirtualBox drive.  IIS is happy to serve any files from a regular .VDI or .VDMK disk.

However 500GB+ project files are stored by Ubuntu on a ZFS disk (in case-insensitive mode by the way).  These files are available on both systems in various ways for different purposes.  

For editing purposes, a VirtualBox shared folder surfaces the project files as Drive D: but those files are not available for use by the part of IIS that serves up files over http.  (They can be seen by IIS Manager because of the way VirtualBox Guest Additions works, but not at the time the worker process needs to get them.)  

For http server purposes, an Ubuntu Network Share surfaces the same files.  IIS can then serve the files either for the root of the web site or for any virtual path.  Details below.


Tried; Does NOT Work

Here all the ways that do NOT work... with error codes provided in case you are having the same problem.

Physical Path set to D:\temp gives this error: 

Error Code   0x80070003
Config Error   Cannot read configuration file
Config File   \\?\D:\temp\web.config

Physical Path set to \\vboxsrv\d\temp gives this error:

Handler   Not yet determined
Error Code   0x80070001 

Physical path set to \\localhost\ddup\temp (where ddup is a shared folder on Windows pointing to D:\ shared by \\vboxsrv\d); that gives this error:

Error Code   0x80070005
Config Error   Cannot read configuration file due to insufficient permissions
Config File   \\?\UNC\localhost\ddup\temp\web.config


Ubuntu Local Network Share with Suitable Username On Windows

On Ubuntu 16.04, I used the built-in Files utility to create the network share.  Navigate to the folder, right click, select Local Network Share.  

In the Folder Sharing Dialog:

[x] Share this folder
    Share name: hello
    Comment: for use by IIS in Windows

[  ] Allow others to create and delete files in this folder
[x] Guest access (for people without a user account)

( Note, when I did not allow Guest access, I got http status code 403.1 with 
Error Code   0x80070005 )


Click the [Modify Share] button to save your definition of the Local Network Share.

In the Windows guest system, create a Windows user whose name matches a valid account name on the Ubuntu host.  The easiest is to make the username the same as your usual non-root username on Ubuntu. That account probably has rights to the files in question.  ( Credit to Lexi Li for the tip about the matching username )

In IIS, when configuring the web site, the Physical Path is set to \\192.168.0.3\hello\temp  to get to the files. Obviously you need to put in your own network ip number and your own share name instead of 192.168.0.3 and the word 'hello'.


Furthermore, in IIS, you click on the [Connect as] button and fill in the SAME credentials, again.  These credentials go across when Windows asks Ubuntu to access the files.  


Then it works.  http://localhost/robots.txt can be served up from the file on the VirtualBox Host system.


Comments

Popular Posts