Windows Guest - vagrant halt fails

789 views
Skip to first unread message

stoked

unread,
May 13, 2012, 9:14:23 PM5/13/12
to vagra...@googlegroups.com
Hi All,

I've been trying to get the basic vagrant commands working for Windows 2008 R2 guests. I've successfully created a basebox via veewee templates and am able to bring up the box via vagrant. I used Hippie Hacker's windows.rb file to specify Windows guest specific commands but "vagrant halt" still fails for me. If I issue the shtudown command manually it seems to work fine. However, I get the following when issuing a vagrant halt (with debug enabled):

 INFO ssh: Connecting to SSH: 127.0.0.1:2222
 INFO ssh: Execute: shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1 (sudo=false)
DEBUG ssh: Exit status: 1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

How do I log the output of the SSH command to debug this?

Mitchell Hashimoto

unread,
May 15, 2012, 7:56:27 PM5/15/12
to vagra...@googlegroups.com
Run Vagrant with VAGRANT_LOG set to "debug" and the SSH output will be visible!

Best,
Mitchell

stoked

unread,
May 16, 2012, 4:31:10 AM5/16/12
to vagra...@googlegroups.com
Thanks Mitchell,

Actually that was with VAGRANT_LOG=DEBUG.

Below is the full output as of when ssh is invoked, but it doesn't seem to log any ssh errors. I also watched the auth logs on the windows guest and I never saw a vagrant user attempt to login.

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 0
DEBUG virtualbox_4_1:   - [1, "ssh", 2222, 22]
 INFO ssh: Connecting to SSH: 127.0.0.1:2222
 INFO ssh: Execute: shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1 (sudo=false)
DEBUG ssh: Exit status: 1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1>
ERROR vagrant: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
ERROR vagrant: C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:62:in `execute'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/guest/windows.rb:41:in `halt'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/halt.rb:14:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/discard_state.rb:17:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/builder.rb:92:in `call'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in `block in run'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/util/busy.rb:19:in `busy'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in `run'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/vm.rb:192:in `run_action'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/vm.rb:156:in `halt'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/halt.rb:27:in `block in execute'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:116:in `block in with_target_vms'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in `each'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in `with_target_vms'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/halt.rb:24:in `execute'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/cli.rb:42:in `execute'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:167:in `cli'
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/bin/vagrant:43:in `<top (required)>'
C:/vagrant/vagrant/bin//../embedded/bin/vagrant:19:in `load'
C:/vagrant/vagrant/bin//../embedded/bin/vagrant:19:in `<main>'
 INFO interface: error: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1


stoked

unread,
May 16, 2012, 4:37:04 AM5/16/12
to vagra...@googlegroups.com
Also, any thoughts on moving from guest shutdown commands to vboxmanage controlvm "guestname" acpipowerbutton instead?

Mitchell Hashimoto

unread,
May 22, 2012, 12:23:29 PM5/22/12
to vagra...@googlegroups.com
On Wed, May 16, 2012 at 1:37 AM, stoked <darr...@gmail.com> wrote:
> Also, any thoughts on moving from guest shutdown commands to vboxmanage
> controlvm "guestname" acpipowerbutton instead?
>
>
> On Wednesday, May 16, 2012 1:31:10 AM UTC-7, stoked wrote:
>>
>> Thanks Mitchell,
>>
>> Actually that was with VAGRANT_LOG=DEBUG.
>>
>> Below is the full output as of when ssh is invoked, but it doesn't seem to
>> log any ssh errors. I also watched the auth logs on the windows guest and I
>> never saw a vagrant user attempt to login.
>>

Thanks.

Where did you get the Windows guest class you're using to actually do
this by the way?

Have you tried running the command manually in the guest itself to see
why it is failing?

And I'm not against using "acpipowerbutton" as a fallback... perhaps
the fallback order should be:

1. Attempt graceful (via SSH)
2. Attempt ACPI power button
3. Pull the plug.

Mitchell

stoked

unread,
May 27, 2012, 1:33:30 AM5/27/12
to vagra...@googlegroups.com
I used Hippe Hacker's windows guest class  https://github.com/hh/vagrant and modified the vagrant.rb file to include it.

I've run the commands manually and they work without problems. It may be due to requiretty but cygwin doesn't seem to have a sudoers file and googling requiretty and cygwin didn't turn up much.
Reply all
Reply to author
Forward
0 new messages