Developing for IIS on Windows Guest from Windows Host

296 views
Skip to first unread message

Jamie Jackson

unread,
Jul 24, 2015, 5:03:30 PM7/24/15
to Vagrant
As has been mentioned before, using standard VirtualBox shares from a Windows guest to a Windows host is problematic when developing for IIS. (The permissions don't work out.)

I've seen recommendations in a few places to manually configure an SMB share on the host, and to use that from the guest; however, I don't know how to approach the permissions.
  • For which user should the host share be created? (Domain user? Machine user?)
  • On the guest, how does IIS access the share (UNC? a Mapping?)?
  • Does the IIS application pool need special configuration?
I also tried type: "smb", to see how it configures things, but a) it didn't seem to work (wouldn't get past the port mapping) and most importantly b) it needs to run as administrator, and I don't want to run Vagrant as admin.

In other words, I'm not really interested in getting type: "smb" to work as a permanent solution, I'm just looking for the right strategy to set it up manually.

Thanks,
Jamie

Marco De Bortoli

unread,
Jul 24, 2015, 6:19:05 PM7/24/15
to Vagrant
Hi Jamie,

the only thing that I found to work quite fine and without too much hassle on windows was the use of rsync.
You develop locally and rsync takes cares to copy things over when required. It doesn't require too much configuration and permissions works alright.

I hope that helps.

Cheers,
Debo

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8918a711-ba50-4ea3-b822-11257f38072b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joaquin Menchaca

unread,
Jul 27, 2015, 2:23:11 AM7/27/15
to Vagrant, jamie...@gmail.com
I have not played with Windows since 2012, so my information is guesswork (disclaimer).  In a SaaS environment, I am not sure if we pulled it down from a shared drive (like S: mapped to a server \\someserver\goodies).  Some of the deploy or change configuration was through bubble gum and scripts using batch, powershell, rake, and psake, partially to build versioned code and assets (for rollback capability and cache busting).  Powershell has a remote execution capability that helped in some of this.

For access, obviously, you need an account that has administrator access.  For a vagrant system, the vagrant account should have this capability as part of building a vagrant compatible vagrant system.

For deployments, there may be a way to push them over using windows remoting, or with cygwin sshd, winsshd, or use a deploy tool like Octopus Deploy (https://octopusdeploy.com/).  Alternatively, you can package up the code + assets into a package like NuGet, MSI, 7Zip, or Chocolately.   Then use a change configuration agent (Puppet, Chef, CFEngine) pull it down.

On the topic of IIS application pool (and workers) this is something you can configure in the GUI, which will modify an xml file (found in %WinDir%\System32\Inetsrv\Config) that can be copied off and reused.  If is error prone to modify that directly, but sometimes is required for advanced configurations.  There's a IIS admin command line tool that does a decent job of this, which we used.  At the time, the powershell wrappers were not all that intuitive or robust (win2008r2).  There's also a cert utility that is good for installed certs for the web services into the store so that can be accessible (and referenced) in the IIS's xml configuration.

Jamie Jackson

unread,
Jul 27, 2015, 1:44:26 PM7/27/15
to vagra...@googlegroups.com
Is there a writeup of using rsync with a Windows host/Windows guest?

I happen to already have cygwin (with rsync) on the host, but I'm not sure what is required on the guest side.

Thanks,
Jamie

Marco De Bortoli

unread,
Jul 27, 2015, 3:30:06 PM7/27/15
to vagra...@googlegroups.com
About the configuration of rsync you should find everything on the Vagrant website, for the guest you should just simply add to your provisioner a step to install rsync. I don't remember now what I've used but I can tell you tomorrow if that's ok.

Cheers,
Debo

Marco De Bortoli

unread,
Jul 29, 2015, 3:58:31 PM7/29/15
to vagra...@googlegroups.com
Hi Jamie,

sorry for the delay, so what I've used on the guest is the rsync version available here

http://www.mingw.org/wiki/MSYS

I installed it using a custom powershell provisioner made by me.

If the project is quite big and you are having problems with performance you might also want to have a look into this plugin

https://github.com/smerrill/vagrant-gatling-rsync

I didn't try it myself so I can't say whether it's good or not.

I hope it helps.

Best,
Debo

Jamie Jackson

unread,
May 17, 2016, 2:44:12 PM5/17/16
to Vagrant
Thanks, Debo.

By the way, a colleague came upon a weird workaround:

  • Use a standard share in the Vagrantfile, say: config.vm.synced_folder "website", "c:/website_vbox_share"
  • In the guest, create a symlink to yet another spot: mklink /D "c:\website_symlink" "c:\website_vbox_share"
  • In the guest, create a share from that symlink: net share website=C:\website_symlink
  • In the guest's IIS, point the web root to the new, local share: \\localhost\website
I don't have a provisioner for all of that yet, but those are the nuts and bolts.

Super-straightforward, huh? :-/

Jamie

Jamie Jackson

unread,
May 17, 2016, 3:50:46 PM5/17/16
to vagra...@googlegroups.com

I meant to ask you: Could you share that rsync provisioner?

Reply all
Reply to author
Forward
0 new messages