Vagrant 1.6.x with windows guest and virtualbox

1,038 views
Skip to first unread message

Nick Anderson

unread,
Jun 10, 2014, 3:46:18 PM6/10/14
to vagra...@googlegroups.com
I am trying to build a Windows Server 2012 vm that I can use with Vagrant and Virtualbox.

It's not clear to me what I need to do. Here are the things I have done on the Windows vm that I am preparing as a basebox.

Disable password complexity requirements
Set minimum password age to 0
Set Administrator password to 'vagrant'
Create vagrant user
Set vagrant users password to 'vagrant'
Enable remote desktop
Add the vagrant user to the allowed list of remote desktop users
Allow all connections from computers running any version of RDP (or my linux client cant rdp successfully)
Install ruby 1.9.3 from rubyinstall.org
Install winrm with geminstall -rwinrm
Configure winrm with winrm quickconfig
Disable UAC
Disable Server Manager on login
Disable Shutdown Tracker
Ensure that network is set to "Private"
Install Virtualbox guest tools

I export the vm as a box, import it to vagrant 
I think generate a vagrant config using vagrant init <name of windows box>
And then I added config.cm.communicator = "winrm"
Finally I vagrant up my env.

The VM comes up without issue, but Vagrant just sits waiting for the machine to boot until it times out.
vagrant rdp does nothing

I am able to manually log in with rdesktop if I specifically forward a port
config.vm.network "forwarded_port", guest: 3389, host: 53389

Then rdesktop localhost:53389 will give me the windows login screen.

I have tried with and without the vagrant-windows plugin.

I am running vagrant 1.6.3 on Ubuntu.

It seems like I am missing some basic thing. Have I missed some documentation somewhere?

Alvaro Miranda Aguilera

unread,
Jun 11, 2014, 5:49:31 AM6/11/14
to vagra...@googlegroups.com
I think a bit more information can be useful

can you do:

vagrant halt
VAGRANT_LOG=debug vagrant up

and provide a link to pastebin or gist?



--
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.
For more options, visit https://groups.google.com/d/optout.

Shawn Neal

unread,
Jun 11, 2014, 9:09:50 AM6/11/14
to vagra...@googlegroups.com
Did you fully configure winrm as per https://github.com/winrb/vagrant-windows#winrm-configuration?
Setting the network to private, not sure about that one. Usually work is used.
Firewall?

IMO the easiest way to create a Vagrant base box is to use Packer with packer-windows (https://github.com/joefitzgerald/packer-windows)

Nick Anderson

unread,
Jun 11, 2014, 9:13:48 AM6/11/14
to vagra...@googlegroups.com
On Wednesday, June 11, 2014 4:49:31 AM UTC-5, Alvaro Miranda Aguilera wrote:
can you do:
VAGRANT_LOG=debug vagrant up

Sure, here is a gist of the debug level output.

I find the "DEBUG subprocess: Waiting for process to exit. Remaining to timeout:" line interesting. The timeout never really seems to count down past 31999.

A slice from 'grep "DEBUG subprocess: Waiting for process to exit. Remaining to timeout:"'

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000

Nick Anderson

unread,
Jun 11, 2014, 9:28:50 AM6/11/14
to vagra...@googlegroups.com
On Wednesday, June 11, 2014 8:09:50 AM UTC-5, Shawn Neal wrote:

I did try those at one point. I am not sure I have done that on this attempt. It's not clear if any of those instructions are relevant if I am using Vagrant 1.6+. The top of the page says "This plugin is deprecated, please use Vagrant 1.6+ which natively supports Windows guests over WinRM." and the only info in the vagrant documentation I could find was the reference to config.vm.communicator = "winrm".
 
Setting the network to private, not sure about that one. Usually work is used.

It was something I found from other threads. The only options are "Not configured", "Private", and "Public". I also saw something about having to have network discovery enabled ( I tried that as well)
 
Firewall?

It's enabled. RDP and Windows Remote Management are allowed.


IMO the easiest way to create a Vagrant base box is to use Packer with packer-windows (https://github.com/joefitzgerald/packer-windows)

Thanks, I will take a look at that. 
2014-06-11-Selection_001.jpg
2014-06-11-Selection_002.jpg
2014-06-11-Selection_003.jpg

Shawn Neal

unread,
Jun 11, 2014, 10:01:25 AM6/11/14
to vagra...@googlegroups.com
The base box instructions on the plugin page will work with Vagrant 1.6+, which you should be using. Basically Vagrant 1.6 has the plugin merged into Vagrant core with some additional functionality.


--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/wuyeXE0Wakg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Denny Pichardo

unread,
Jun 12, 2014, 2:12:32 AM6/12/14
to vagra...@googlegroups.com
Hi Nick,

I recently wrote an article about this on my blog (although mine was based on Windows 2008, but should be the same process)

http://dennypc.wordpress.com/

I ran into a similar issues as you and ran a few additional configuration for winrm on the guest.  I also used Chef's knife windows plugin to verify that winrm was working fine.  Detailed steps are covered on my blog.  Also packer-windows templates are based on SSH at the moment, so if you're trying to use WinRM you might have to roll your own box any ways.
Message has been deleted

Golden

unread,
Sep 18, 2014, 12:15:32 PM9/18/14
to vagra...@googlegroups.com
I don't understand how vagrant can announce that windows guests are natively supported in v1.6+ and there is zero formal documentation on how to create a windows guest properly? I have been fumbling with this for over a day...frustrating..

Golden

unread,
Sep 18, 2014, 3:44:46 PM9/18/14
to vagra...@googlegroups.com
NIck,

Did you ever find a solution to your timeout issue? I have the same things going on where vagrant can't communicate/control my self-created win2012 base box. I am more Linux-oriented and this windows issue is a bit irritating. I have followed several blogs mentioned to no avail.

Michael Zhou

unread,
Jan 29, 2015, 11:20:30 AM1/29/15
to vagra...@googlegroups.com
Understanding this topic is a couple of months old, but I hope this can benefit anyone who is searching for the answer. I fixed the same issue in my case by having these two lines added to my Vagrantfile.

  config.winrm.username = "Administrator"
  config.winrm.password = "supply your administrator password here"

That should allow Vagrant to WinRM into the Windows guest using the supplied credentials. You can use other users created on the base box, but make sure that user is added to administrators group and it has the privilege to remotely execute programs.

Here is my environment:

Vagrant: 1.6.5
Host OS: Windows 7
Guest OS: Windows 2008 R2

Shawn Neal

unread,
Jan 29, 2015, 11:50:08 AM1/29/15
to vagra...@googlegroups.com
Thanks Michael. I'm in the progress of fixing this. Now that the upstream winrm gem properly throws an auth error, we can fail fast in Vagrant instead of retrying to connect without any obvious error to indicate you have the wrong user/pwd.

--
Reply all
Reply to author
Forward
0 new messages