diff --git a/plugins/guests/freebsd/guest.rb b/plugins/guests/freebsd/guest.rb index 084197762..204dc5483 100644 --- a/plugins/guests/freebsd/guest.rb +++ b/plugins/guests/freebsd/guest.rb @@ -13,17 +13,6 @@ module VagrantPlugins def halt vm.channel.sudo("shutdown -p now") - - # Wait until the VM's state is actually powered off. If this doesn't - # occur within a reasonable amount of time (15 seconds by default), - # then simply return and allow Vagrant to kill the machine. - count = 0 - while vm.state != :poweroff - count += 1 - - return if count >= vm.config.freebsd.halt_timeout - sleep vm.config.freebsd.halt_check_interval - end end # TODO: vboxsf is currently unsupported in FreeBSD, if you are able to diff --git a/plugins/guests/linux/guest.rb b/plugins/guests/linux/guest.rb index b586f93fe..cb53875ac 100644 --- a/plugins/guests/linux/guest.rb +++ b/plugins/guests/linux/guest.rb @@ -35,17 +35,6 @@ module VagrantPlugins def halt @vm.communicate.sudo("shutdown -h now") - - # Wait until the VM's state is actually powered off. If this doesn't - # occur within a reasonable amount of time (15 seconds by default), - # then simply return and allow Vagrant to kill the machine. - count = 0 - while @vm.state != :poweroff - count += 1 - - return if count >= @vm.config.linux.halt_timeout - sleep @vm.config.linux.halt_check_interval - end end def mount_shared_folder(name, guestpath, options) diff --git a/plugins/guests/openbsd/guest.rb b/plugins/guests/openbsd/guest.rb index 5fb8af200..a43ed6f10 100644 --- a/plugins/guests/openbsd/guest.rb +++ b/plugins/guests/openbsd/guest.rb @@ -7,17 +7,6 @@ module VagrantPlugins class Guest < VagrantPlugins::GuestLinux::Guest def halt vm.channel.sudo("shutdown -p -h now") - - # Wait until the VM's state is actually powered off. If this doesn't - # occur within a reasonable amount of time then simply return which - # will cause Vagrant to force kill the machine. - count = 0 - while vm.state != :poweroff - count += 1 - - return if count >= 30 - sleep 1 - end end end end diff --git a/plugins/guests/solaris/guest.rb b/plugins/guests/solaris/guest.rb index e85a731c5..a8497bb14 100644 --- a/plugins/guests/solaris/guest.rb +++ b/plugins/guests/solaris/guest.rb @@ -45,35 +45,7 @@ module VagrantPlugins # # does not exist in /etc/user_attr. TODO def halt - # Wait until the VM's state is actually powered off. If this doesn't - # occur within a reasonable amount of time (15 seconds by default), - # then simply return and allow Vagrant to kill the machine. - count = 0 - last_error = nil - while vm.state != :poweroff - begin - vm.channel.execute("#{vm.config.solaris.suexec_cmd} /usr/sbin/poweroff") - rescue IOError => e - # Save the last error; if it's not shutdown in a reasonable amount - # of attempts we will re-raise the error so it's not hidden for - # all time - last_error = e - end - - count += 1 - if count >= vm.config.solaris.halt_timeout - # Check for last error and re-raise it - if last_error != nil - raise last_error - else - # Otherwise, just return - return - end - end - - # Still opportunities remaining; sleep and loop - sleep vm.config.solaris.halt_check_interval - end # while + vm.channel.execute("#{vm.config.solaris.suexec_cmd} /usr/sbin/poweroff") end def mount_shared_folder(name, guestpath, options)