Error with vagrant 1.9.3 and virtualbox "Renaming the Windows guest failed. Most often this is because you've specified a FQDN instead of just a host name."

462 views
Skip to first unread message

athreya vc

unread,
Apr 12, 2017, 1:04:31 PM4/12/17
to Vagrant
Hi,
I am trying setup a vagrant machine windows 2012r2. I am using


vagrant -v
Vagrant 1.9.3

vagrant plugin list
vagrant-butcher (2.2.1)
vagrant-cachier (1.2.1)
vagrant-omnibus (1.5.0)
vagrant-share (1.1.7, system)
vagrant-vbguest (0.13.0)

Virtualbox version is 5.

the vagrant up <windows box> fails at

"Renaming the Windows guest failed. Most often this is because you've specified a FQDN instead of just a host name."

the whole setup is, after the machine is setup it should integrate with chef.

I have setup the "winrm" as a communicator.


Regards,

athreya vc

unread,
Apr 12, 2017, 1:17:20 PM4/12/17
to Vagrant
==> testwin: Waiting for machine to boot. This may take a few minutes...
    testwin: WinRM address: 127.0.0.1:2202
    testwin: WinRM username: localadmin
    testwin: WinRM execution_time_limit: PT2H
    testwin: WinRM transport: negotiate
==> testwin: Machine booted and ready!
==> testwin: Checking for guest additions in VM...
==> testwin: Setting hostname...
==> testwin: Saved client key to /home/testlab/testlab/lab/.vagrant/butcher/testwin-client.pem

After this I get the Error

athreya vc

unread,
Apr 13, 2017, 7:25:28 AM4/13/17
to Vagrant
I don't know what changed. This whole stuff used to work with vagrant 1.6.3, Ruby 2.0.0 and Vbox 4.3. Now to rollback things, it is throwing nokogiri plugin error

athreya vc

unread,
Apr 13, 2017, 12:32:29 PM4/13/17
to Vagrant
I am now trying to revert to 1.6.3 I am not sure whether winRM is working as expected. However on other machine with 1.6.3 it works without any errors.

vagrant plugin install  vagrant-butcher --plugin-version 2.0.0 --verbose
Installing the 'vagrant-butcher --version '2.0.0'' plugin. This can take a few minutes...
Fetching source index from http://gems.hashicorp.com/
Fetching gem metadata from https://rubygems.org/...............
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using public_suffix 2.0.5
Using addressable 2.5.1
Using builder 3.2.3
Using gyoku 1.3.1
Using mini_portile 0.6.0
Using nokogiri 1.6.2.1
Using akami 1.3.1
Using buff-extensions 0.5.0
Using hashie 3.5.5
Using varia_model 0.3.2
Using buff-config 0.4.0

Gem::InstallError: buff-ignore requires Ruby version >= 2.1.
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing buff-ignore (1.2.0), and Bundler cannot continue.
Make sure that `gem install buff-ignore -v '1.2.0'` succeeds before bundling.

athreya vc

unread,
Apr 14, 2017, 8:02:37 AM4/14/17
to Vagrant
Ok I am made some debugging

with vagrant 1.6.3 ,

if ($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 0 }
DEBUG winrmshell: Output: {:data=>[], :exitcode=>0}
 INFO guest: Detected: windows!
DEBUG guest: Searching for cap: change_host_name
DEBUG guest: Checking in: windows
DEBUG guest: Found cap: change_host_name in windows
 INFO guest: Execute capability: change_host_name [#<Vagrant::Machine: win001 (VagrantPlugins::ProviderVirtualBox::Provider)>, "testwin001.homelab.com"] (windows)
DEBUG winrmshell: cmd executing:
wmic computersystem where name="%COMPUTERNAME%" call rename name="testwin001.homelab.com"
DEBUG winrmshell: Output: {:data=>[{:stdout=>"Executing

On 1.93,

VagrantPlugins::ProviderVirtualBox::Provider)>, "testwin001.homelab.com"] (windows)
DEBUG winrmshell: Output: {:data=>[], :exitcode=>1}
DEBUG winrm: powershell executing:
            $computer = Get-WmiObject -Class Win32_ComputerSystem
            $retval = $computer.rename("testwin001.homelab.com").returnvalue
            if ($retval -eq 0) {
              shutdown /r /t 5 /f /d p:4:1 /c "Vagrant Rename Computer"
            }
            exit $retval

DEBUG winrmshell: Output: {:data=>[], :exitcode=>87}
ERROR warden: Error occurred: Renaming the Windows guest failed. Most often this is because you've

Regards,

athreya vc

unread,
Apr 14, 2017, 11:58:44 AM4/14/17
to Vagrant
Can I get some help with this please ?

It seems to be for some reason the powerShell script I am supplying to change the hostname to FQDN is not working.

Vagrant 1.6.3 + VBox 4.3  + ruby 2.0 => all Works

Vagrant 1.9.3 or anything which is not 1.6.3 + VBox 4.3  + ruby 2.0(any ruby, tried with 2.2, 2.4) => NOT working

Tried to roll back to 1.6.3 , but vagrant-butcher will not install, some dependencies will not be met.

Regards,

Alvaro Miranda Aguilera

unread,
Apr 14, 2017, 3:05:51 PM4/14/17
to vagra...@googlegroups.com
get into latest vagrant version

do vagrant plugin list

remove all plugin other than vagrant share

do vagrant plugin update

try again

winrm is not part of core vagrant, so maybe having the old plugin and the new version cause issues

Alvaro

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/111eafdb-37e4-4545-8ab2-62a5673307ab%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

athreya vc

unread,
Apr 14, 2017, 11:23:44 PM4/14/17
to Vagrant
Hi, 

Thanks for the Reply. 

I am wondering with 1.6.3 vagrant is using a different way to communicate to the guest VM and 1.9.3 it has changed, 
I have now cleaned up all the old plugins.

Now I have the latest version 
vagrant -v
Vagrant 1.9.3
With below plugins 
vagrant plugin list
vagrant-butcher (2.2.1)
vagrant-share (1.1.7, system)
vagrant-vbguest (0.13.0)

I have cleared all the Plugins from the Previous. 

Same error 

Renaming the Windows guest failed. Most often this is because you've
specified a FQDN instead of just a host name.

Ensure the new guest name is properly formatted. Standard names may
contain letters (a-z, A-Z), numbers (0-9), and hypens (-), but no
spaces or periods (.). The name may not consist entirely of digits.
 INFO interface: Machine: error-exit ["VagrantPlugins::GuestWindows::Errors::RenameComputerFailed", "Renaming the Windows guest failed. Most often this is because you've\nspecified a FQDN instead of just a host name.\n\nEnsure the new guest name is properly formatted. Standard names may\ncontain letters (a-z, A-Z), numbers (0-9), and hypens (-), but no\nspaces or periods (.). The name may not consist entirely of digits."]

In Debug, 

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

athreya vc

unread,
Apr 14, 2017, 11:29:39 PM4/14/17
to Vagrant
Debug Log

DEBUG winrmshell: Output: #<WinRM::Output:0x00000004260ff8 @data=[{:stderr=>"At line:1 char:3\r\n+ if test -r /etc/os-release; then\r\n+   ~\nMissing '(' after 'if' in if statement.\r\n\r\nAt line:2 char:24\r\n+ source /etc/os-release && test 'xlinux' = \"x$ID\" && exit\r\n+                        ~~\nThe token '&&' is not a valid statement separator in this version.\r\n\r\nAt line:2 char:50\r\n+ source /etc/os-release && test 'xlinux' = \"x$ID\" && exit\r\n+                                                  ~~\nThe token '&&' is not a valid statement separator in this version.\r\n\r\nAt line:4 char:3\r\n+ if test -x /usr/bin/lsb_release; then\r\n+   ~\nMissing '(' after 'if' in if statement.\r\n\r\nAt line:5 char:56\r\n+ /usr/bin/lsb_release -i 2>/dev/null | grep -qi 'linux' && exit\r\n+                                                        ~~\nThe token '&&' is not a valid statement separator in this version.\r\n\r\nAt line:7 char:3\r\n+ if test -r /etc/issue; then\r\n+   ~\nMissing '(' after 'if' in if statement.\r\n\r\nAt line:8 char:35\r\n+ cat /etc/issue | grep -qi 'linux' && exit\r\n+                                   ~~\nThe token '&&' is not a valid statement separator in this version.\r\n\r\n\n    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException\n    + FullyQualifiedErrorId : MissingOpenParenthesisInIfStatement,Microsoft.PowerShell.Commands.InvokeExpressionCommand\n"}], @exitcode=0>
 WARN winrmshell: Detected ParserError, setting exit code to 1
DEBUG guest: Trying: esxi
DEBUG guest: Trying: solaris11
DEBUG guest: Trying: bsd
DEBUG guest: Trying: windows
DEBUG winrmshell: [WinRM] opening remote shell on http://127.0.0.1:55985/wsman
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x00000004139710 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><Version N=\"protocolversion\">2.2</Version><Version N=\"PSVersion\">2.0</Version><Version N=\"SerializationVersion\">1.1.0.1</Version></MS></Obj>", @destination=1, @type=65538, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x00000004133bd0 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><Obj N=\"ApplicationPrivateData\" RefId=\"1\"><TN RefId=\"0\"><T>System.Management.Automation.PSPrimitiveDictionary</T><T>System.Collections.Hashtable</T><T>System.Object</T></TN><DCT><En><S N=\"Key\">DebugMode</S><I32 N=\"Value\">1</I32></En><En><S N=\"Key\">DebugStop</S><B N=\"Value\">false</B></En><En><S N=\"Key\">PSVersionTable</S><Obj N=\"Value\" RefId=\"2\"><TNRef RefId=\"0\" /><DCT><En><S N=\"Key\">PSVersion</S><Version N=\"Value\">2.0</Version></En><En><S N=\"Key\">PSCompatibleVersions</S><Obj N=\"Value\" RefId=\"3\"><TN RefId=\"1\"><T>System.Version[]</T><T>System.Array</T><T>System.Object</T></TN><LST><Version>1.0</Version><Version>2.0</Version><Version>3.0</Version><Version>4.0</Version></LST></Obj></En><En><S N=\"Key\">BuildVersion</S><Version N=\"Value\">6.3.9600.16394</Version></En><En><S N=\"Key\">CLRVersion</S><Version N=\"Value\">4.0.30319.42000</Version></En><En><S N=\"Key\">WSManStackVersion</S><Version N=\"Value\">3.0</Version></En><En><S N=\"Key\">PSRemotingProtocolVersion</S><Version N=\"Value\">2.2</Version></En><En><S N=\"Key\">SerializationVersion</S><Version N=\"Value\">1.1.0.1</Version></En></DCT></Obj></En><En><S N=\"Key\">DebugBreakpointCount</S><I32 N=\"Value\">0</I32></En></DCT></Obj></MS></Obj>", @destination=1, @type=135177, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x0000000407bd00 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><I32 N=\"RunspaceState\">2</I32></MS></Obj>", @destination=1, @type=135173, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] remote shell created with shell_id: D5F3BBCD-AB9D-4BC1-A2EF-7058F714A906
DEBUG winrmshell: [WinRM] Command created for             $p = "$Env:SystemRoot"
            if ((Test-Path $p) -and (get-item $p).PSIsContainer) {
              exit 0
            }
            exit 1


if (!$?) { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } } with id: 0F07AD8A-FC5F-4983-AD5C-4E5AE9998CD9
DEBUG winrmshell: [WinRM] creating command_id: 0F07AD8A-FC5F-4983-AD5C-4E5AE9998CD9 on shell_id D5F3BBCD-AB9D-4BC1-A2EF-7058F714A906
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] cleaning up command_id: 0F07AD8A-FC5F-4983-AD5C-4E5AE9998CD9 on shell_id D5F3BBCD-AB9D-4BC1-A2EF-7058F714A906
DEBUG winrmshell: Output: #<WinRM::Output:0x000000033384b8 @data=[], @exitcode=0>
 INFO guest: Detected: windows!
DEBUG guest: Searching for cap: change_host_name
DEBUG guest: Checking in: windows
DEBUG guest: Found cap: change_host_name in windows
 INFO guest: Execute capability: change_host_name [#<Vagrant::Machine: win001 (VagrantPlugins::ProviderVirtualBox::Provider)>, "testwin001.homelab.com"] (windows)
DEBUG winrmshell: [WinRM] opening remote shell on http://127.0.0.1:55985/wsman
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x0000000330b2b0 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><Version N=\"protocolversion\">2.2</Version><Version N=\"PSVersion\">2.0</Version><Version N=\"SerializationVersion\">1.1.0.1</Version></MS></Obj>", @destination=1, @type=65538, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x00000003308f60 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><Obj N=\"ApplicationPrivateData\" RefId=\"1\"><TN RefId=\"0\"><T>System.Management.Automation.PSPrimitiveDictionary</T><T>System.Collections.Hashtable</T><T>System.Object</T></TN><DCT><En><S N=\"Key\">DebugMode</S><I32 N=\"Value\">1</I32></En><En><S N=\"Key\">DebugStop</S><B N=\"Value\">false</B></En><En><S N=\"Key\">PSVersionTable</S><Obj N=\"Value\" RefId=\"2\"><TNRef RefId=\"0\" /><DCT><En><S N=\"Key\">PSVersion</S><Version N=\"Value\">2.0</Version></En><En><S N=\"Key\">PSCompatibleVersions</S><Obj N=\"Value\" RefId=\"3\"><TN RefId=\"1\"><T>System.Version[]</T><T>System.Array</T><T>System.Object</T></TN><LST><Version>1.0</Version><Version>2.0</Version><Version>3.0</Version><Version>4.0</Version></LST></Obj></En><En><S N=\"Key\">BuildVersion</S><Version N=\"Value\">6.3.9600.16394</Version></En><En><S N=\"Key\">CLRVersion</S><Version N=\"Value\">4.0.30319.42000</Version></En><En><S N=\"Key\">WSManStackVersion</S><Version N=\"Value\">3.0</Version></En><En><S N=\"Key\">PSRemotingProtocolVersion</S><Version N=\"Value\">2.2</Version></En><En><S N=\"Key\">SerializationVersion</S><Version N=\"Value\">1.1.0.1</Version></En></DCT></Obj></En><En><S N=\"Key\">DebugBreakpointCount</S><I32 N=\"Value\">0</I32></En></DCT></Obj></MS></Obj>", @destination=1, @type=135177, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x00000002eacc00 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><I32 N=\"RunspaceState\">2</I32></MS></Obj>", @destination=1, @type=135173, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] remote shell created with shell_id: BCAB89AB-0027-473D-8ED4-62B7CD799241
DEBUG winrmshell: [WinRM] Command created for if ([System.Net.Dns]::GetHostName() -eq 'testwin001.homelab.com') { exit 0 } exit 1

if (!$?) { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } } with id: 92242FAE-9D8F-47BD-A5A9-0B8BC1B7443F
DEBUG winrmshell: [WinRM] creating command_id: 92242FAE-9D8F-47BD-A5A9-0B8BC1B7443F on shell_id BCAB89AB-0027-473D-8ED4-62B7CD799241
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] cleaning up command_id: 92242FAE-9D8F-47BD-A5A9-0B8BC1B7443F on shell_id BCAB89AB-0027-473D-8ED4-62B7CD799241
DEBUG winrmshell: Output: #<WinRM::Output:0x000000040c68a0 @data=[], @exitcode=1>
DEBUG winrm: powershell executing:
            $computer = Get-WmiObject -Class Win32_ComputerSystem
            $retval = $computer.rename("testwin001.homelab.com").returnvalue
            if ($retval -eq 0) {
              shutdown /r /t 5 /f /d p:4:1 /c "Vagrant Rename Computer"
            }
            exit $retval

DEBUG winrmshell: [WinRM] opening remote shell on http://127.0.0.1:55985/wsman
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x000000040bb4c8 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><Version N=\"protocolversion\">2.2</Version><Version N=\"PSVersion\">2.0</Version><Version N=\"SerializationVersion\">1.1.0.1</Version></MS></Obj>", @destination=1, @type=65538, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x000000040ba258 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><Obj N=\"ApplicationPrivateData\" RefId=\"1\"><TN RefId=\"0\"><T>System.Management.Automation.PSPrimitiveDictionary</T><T>System.Collections.Hashtable</T><T>System.Object</T></TN><DCT><En><S N=\"Key\">DebugMode</S><I32 N=\"Value\">1</I32></En><En><S N=\"Key\">DebugStop</S><B N=\"Value\">false</B></En><En><S N=\"Key\">PSVersionTable</S><Obj N=\"Value\" RefId=\"2\"><TNRef RefId=\"0\" /><DCT><En><S N=\"Key\">PSVersion</S><Version N=\"Value\">2.0</Version></En><En><S N=\"Key\">PSCompatibleVersions</S><Obj N=\"Value\" RefId=\"3\"><TN RefId=\"1\"><T>System.Version[]</T><T>System.Array</T><T>System.Object</T></TN><LST><Version>1.0</Version><Version>2.0</Version><Version>3.0</Version><Version>4.0</Version></LST></Obj></En><En><S N=\"Key\">BuildVersion</S><Version N=\"Value\">6.3.9600.16394</Version></En><En><S N=\"Key\">CLRVersion</S><Version N=\"Value\">4.0.30319.42000</Version></En><En><S N=\"Key\">WSManStackVersion</S><Version N=\"Value\">3.0</Version></En><En><S N=\"Key\">PSRemotingProtocolVersion</S><Version N=\"Value\">2.2</Version></En><En><S N=\"Key\">SerializationVersion</S><Version N=\"Value\">1.1.0.1</Version></En></DCT></Obj></En><En><S N=\"Key\">DebugBreakpointCount</S><I32 N=\"Value\">0</I32></En></DCT></Obj></MS></Obj>", @destination=1, @type=135177, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] polling for pipeline state. message: #<WinRM::PSRP::Message:0x0000000442a410 @data="\xEF\xBB\xBF<Obj RefId=\"0\"><MS><I32 N=\"RunspaceState\">2</I32></MS></Obj>", @destination=1, @type=135173, @pipeline_id="00000000-0000-0000-0000-000000000000", @runspace_pool_id="00000000-0000-0000-0000-000000000000">
DEBUG winrmshell: [WinRM] remote shell created with shell_id: A7F93B3D-C2D6-44EA-A8AB-B221A0C1ABD6
DEBUG winrmshell: [WinRM] Command created for             $computer = Get-WmiObject -Class Win32_ComputerSystem
            $retval = $computer.rename("testwin001.homelab.com").returnvalue
            if ($retval -eq 0) {
              shutdown /r /t 5 /f /d p:4:1 /c "Vagrant Rename Computer"
            }
            exit $retval


if (!$?) { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } } with id: 051C1478-DC21-4CD7-AE99-AAEEB279E7CE
DEBUG winrmshell: [WinRM] creating command_id: 051C1478-DC21-4CD7-AE99-AAEEB279E7CE on shell_id A7F93B3D-C2D6-44EA-A8AB-B221A0C1ABD6
DEBUG winrmshell: [WinRM] Waiting for output...
DEBUG winrmshell: [WinRM] Processing output
DEBUG winrmshell: [WinRM] cleaning up command_id: 051C1478-DC21-4CD7-AE99-AAEEB279E7CE on shell_id A7F93B3D-C2D6-44EA-A8AB-B221A0C1ABD6
DEBUG winrmshell: Output: #<WinRM::Output:0x0000000321dba0 @data=[], @exitcode=87>
ERROR warden: Error occurred: Renaming the Windows guest failed. Most often this is because you've
specified a FQDN instead of just a host name.

Alvaro Miranda Aguilera

unread,
Apr 15, 2017, 5:56:14 AM4/15/17
to vagra...@googlegroups.com
Hello

When I wrote my previous mail i dd a typo, sorry

winrm is NOW part of vagrant core, that changed

so in old version and some plugins the wayt you setup stuff may be different

this works for me


Vagrant.configure("2") do |config|

  config.vm.box = "ferventcoder/win2008r2-x64-nocm"

  config.winrm.username = "vagrant"

  config.winrm.password = "vagrant"

  config.vm.communicator = "winrm"

  config.vm.guest = :windows

  config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true

  config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true

  config.vm.provision "shell", inline: "Write-Host Hello World"

  config.vm.provision "shell", inline: "(Get-UICulture).Calendar | ConvertTo-Json"

end


athreya vc

unread,
Apr 15, 2017, 11:35:37 AM4/15/17
to Vagrant
Hi,

For me I keep getting this

==> win001: Starting Chef Client, version 12.10.24
 INFO interface: info: [2017-04-15T16:33:21+01:00] INFO: *** Chef 12.10.24 ***
 INFO interface: info: ==> win001: [2017-04-15T16:33:21+01:00] INFO: *** Chef 12.10.24 ***
==> win001: [2017-04-15T16:33:21+01:00] INFO: *** Chef 12.10.24 ***
 INFO interface: info: [2017-04-15T16:33:21+01:00] INFO: Platform: i386-mingw32
 INFO interface: info: ==> win001: [2017-04-15T16:33:21+01:00] INFO: Platform: i386-mingw32
==> win001: [2017-04-15T16:33:21+01:00] INFO: Platform: i386-mingw32
 INFO interface: info: [2017-04-15T16:33:21+01:00] INFO: Chef-client pid: 2240
 INFO interface: info: ==> win001: [2017-04-15T16:33:21+01:00] INFO: Chef-client pid: 2240
==> win001: [2017-04-15T16:33:21+01:00] INFO: Chef-client pid: 2240

DEBUG winrmshell: [WinRM] Waiting for output...

It seems to me winrm is not working at all. I am trying some more.

Regards,

Alvaro Miranda Aguilera

unread,
Apr 15, 2017, 12:37:49 PM4/15/17
to vagra...@googlegroups.com
did you try my example?



--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/05821761-03b1-40c2-8597-e06b44723fbb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

athreya vc

unread,
Apr 15, 2017, 3:28:11 PM4/15/17
to Vagrant
Thanks for helping me out here.

Yes I did and it did work with this.  "win001" works. If I have to make it "win001.homelab.com" it fails.

Vagrant.configure("2") do |config|

  config.vm.box = "livedrive-vagrantlab-win2012r2-v6"

  config.winrm.username = "Administrator"

  config.vm.hostname = "win001" # If I put win001.homelab.com it will fail

  config.winrm.password = "Liverp00l"


  config.vm.communicator = "winrm"

  config.vm.guest = :windows

  config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true

  config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true

  config.vm.provision "shell", inline: "Write-Host Hello World"

  config.vm.provision "shell", inline: "(Get-UICulture).Calendar | ConvertTo-Json"

end

Now I am confused :(.  My setup is, there is a PowerShell script which renames the VM. AFter renaming Chef Provisioning takes place, and I see client.pem is also not getting copied.


To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Apr 15, 2017, 4:18:53 PM4/15/17
to vagra...@googlegroups.com

athreya vc

unread,
Apr 16, 2017, 7:54:16 AM4/16/17
to Vagrant
Hi,

This is my Vagrantfile. Your example works, however with this I get Error

#$chef_server_url = "https://api.chef.io/organizations/test-lab-athreya"
#$chef.validation_client_name = "test-lab-athreya-validator"
#$chef.client_key_path = "/etc/chef/client.pem"
#$chef.validation_key_path = "/home/learn/Downloads/validation.pem"
$env_domain                  = 'homelab.com'

guests = {
 :ubuntu => {
   :singleton => true,
   :box => 'hashicorp/precise64',
   :public_network => { :bridge => 'wlp3s0', :ip => '192.168.1.12', :netmask => '255.255.255.0', :gw => '192.168.1.254' },
   :chef_recipes => ["motd"],
   :vb_memory => 1024
    },
 :win => {
   :singleton => true,
   :box => 'kensykora/windows_2012_r2_standard',
   :public_network => { :bridge => 'wlp3s0', :ip => '192.168.1.14', :netmask => '255.255.255.0', :gw => '192.168.1.254' },
   :chef_recipes => ["chocolatey"],
   :vb_memory => 4096
   }
}

Vagrant.configure("2") do |global_config|
  guests.each_pair do | name, options |
    names = [name]
    names.each do |name|
     global_config.vm.define name do |config|
      guest_is_windows = options[:box].include? 'windows'
    config.vm.hostname = "#{name}.homelab.com"
        config.vm.box = options[:box]
    config.butcher.enabled = true
    config.butcher.verify_ssl = false
        config.omnibus.chef_version = :latest
        pub=options [:public_network]
        config.vm.network 'public_network', :bridge => pub[:bridge], :ip => pub[:ip], :netmask => pub[:netmask], :gw => pub[:gw]
        if guest_is_windows

         config.winrm.username = "vagrant"
       config.winrm.password = "vagrant"
       config.vm.communicator = "winrm"
       config.vm.guest = :windows
       config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true
       config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
     config.vm.hostname = "#{name}"
     $hostname = "#{name}.homelab.com"
     config.vm.provision "shell", inline: "(Get-WmiObject Win32_ComputerSystem).Rename($hostname)"
        else
         config.ssh.username = "vagrant"
         config.vm.hostname = "#{name}.homelab.com"
        end

    config.vm.provision :chef_client do |chef|
      chef.node_name = "#{name}"
         if guest_is_windows
        chef.provisioning_path = 'c:\\chef'
         else
             chef.provisioning_path = "/etc/chef"
         end
      chef.chef_server_url = "https://api.chef.io/organizations/test-lab-athreya"
      chef.validation_client_name = "test-lab-athreya-validator"
     chef.validation_key_path = "/home/learn/Downloads/validation.pem"
         options[:chef_recipes].each do | recipe |
        chef.add_recipe recipe
     end
    end
     end
  end
 end
end

 INFO interface: error: Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
 INFO interface: Machine: error-exit ["VagrantPlugins::Chef::Provisioner::Base::ChefError", "Chef never successfully completed! Any errors should be visible in the\noutput above. Please fix your recipes so that they properly complete."]




--
Alvaro

Alvaro Miranda Aguilera

unread,
Apr 16, 2017, 8:21:03 AM4/16/17
to vagra...@googlegroups.com
Hello

If you remove the hostname from Vagrant and try to setup it manually or with chef, does that work?

As in, are you able to winrm after the hostname has been changed?


athreyavc

unread,
Apr 16, 2017, 8:50:25 AM4/16/17
to vagra...@googlegroups.com
I just tried that,

Removed the renaming part, just left it to "win". to keep it simple.  Still the error is same.

When I call the winrm using the example you gave before, all works perfectly. I am so assuming WinRM should be fine.

However, chef provision fails.

GuestMemoryBalloon=0
GuestOSType="Windows81_64"
GuestAdditionsRunLevel=2
GuestAdditionsVersion="5.0.4 r102546"
GuestAdditionsFacility_VirtualBox Base Driver=50,1492346276243
GuestAdditionsFacility_VirtualBox System Service=50,1492346293202
GuestAdditionsFacility_Seamless Mode=0,1492346276241
GuestAdditionsFacility_Graphics Mode=0,1492346276239
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000000039cff38>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Chef never successfully completed! Any errors should be visible in the

output above. Please fix your recipes so that they properly complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Chef never successfully completed! Any errors should be visible in the

output above. Please fix your recipes so that they properly complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Chef never successfully completed! Any errors should be visible in the

output above. Please fix your recipes so that they properly complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Chef never successfully completed! Any errors should be visible in the

output above. Please fix your recipes so that they properly complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Released process lock: machine-action-8489c4c1e9cdf8e3c145edc3b65e2671
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 3 hooks defined.
 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x00000002bd38f8>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<VagrantPlugins::Chef::Provisioner::Base::ChefError: Chef never successfully completed! Any errors should be visible in the

output above. Please fix your recipes so that they properly complete.>
ERROR vagrant: Chef never successfully completed! Any errors should be visible in the

output above. Please fix your recipes so that they properly complete.
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/provisioners/chef/provisioner/chef_client.rb:108:in `run_chef_client'


ERROR vagrant: Chef never successfully completed! Any errors should be visible in the

--
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 a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/8GClmp8qcnU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezwqYt7x_xzfa0-BYeo8yw6SF9pMHbGV7k4zkV_N-apWQ%40mail.gmail.com.

Alvaro Miranda Aguilera

unread,
Apr 16, 2017, 9:32:17 AM4/16/17
to vagra...@googlegroups.com
Thanks

Can you open a issue on GitHub and share a reproducible project?


Thanks!
Alvaro

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAK-gxkPNMuDrAk9vbR9nrg-tg%3DSGKs4NwGVTbt1Tu6zsa2swHQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

athreyavc

unread,
Apr 16, 2017, 9:39:36 AM4/16/17
to vagra...@googlegroups.com
Hi Sure, I can Open a Bug. Meanwhile any other version you know I can use?

I really need to get this working.  It was somehow working with 1.6.3, but now vagrant-butcher seem to be not compatible with version 1.6.3
Just can't get it installed. 

Regards,

athreya vc

unread,
Apr 17, 2017, 12:37:59 PM4/17/17
to Vagrant
Hi, 

I have made a good progress on this and it seem to be working for me now 


Thanks a lot helping me out. 

Regards,

A
Reply all
Reply to author
Forward
0 new messages