Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"vagrant up" hangs and does not detect outdated PowerShell on Windows 7 #9056

Closed
interfrastic opened this issue Oct 13, 2017 · 10 comments · Fixed by #9470
Closed

"vagrant up" hangs and does not detect outdated PowerShell on Windows 7 #9056

interfrastic opened this issue Oct 13, 2017 · 10 comments · Fixed by #9470

Comments

@interfrastic
Copy link

interfrastic commented Oct 13, 2017

Vagrant version

Vagrant 2.0.0

Host operating system

64-bit Windows 7 Professional Service Pack 1

Guest operating system

hashicorp/precise64

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "hashicorp/precise64"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

Debug output

https://gist.github.com/interfrastic/b3e23db685271c6eccf7f8696d9f6be4

Expected behavior

When I ran the "vagrant up" command, the code in PR #8839 (the fix for #8783) should have determined that my PowerShell version (2.0) is lower than the minimum required version (3.0) and raised an error.

Actual behavior

The "vagrant up" command hung with no output for 16 hours before I finally interrupted it.

Steps to reproduce

  1. Install VirtualBox.

  2. Install Vagrant.

  3. Open a Command Prompt window and enter the following commands:

    cd/d %TMP%
    mkdir vagrant-test
    cd vagrant-test
    vagrant init hashicorp/precise64
    vagrant up

References

@dnorenavega-lightbox
Copy link

dnorenavega-lightbox commented Jan 22, 2018

this works for me update to ps 3

@TomyLobo
Copy link

TomyLobo commented Jan 23, 2018

I think his point was that Vagrant should have errored out instead of blocking (what I presume is) a build slave for 16 hours.

@chrisroberts chrisroberts modified the milestones: 2.0.2, 2.0.3 Jan 30, 2018
@interfrastic
Copy link
Author

Yes, I understand that the underlying problem can be solved by upgrading PowerShell; this bug report only covers the fact that Vagrant freezes for hours instead of detecting the outdated PowerShell version and displaying an error.

briancain added a commit to briancain/vagrant that referenced this issue Feb 14, 2018
…version

Prior to this commit, the function used to determine the version of
Powershell would loop forever inside the Subprocess.execute function
because the process would never exit. This commit fixes that by passing
in a ruby block to capture the version from stdout instead of trying to
capture it from the returned process when it exits.
briancain added a commit to briancain/vagrant that referenced this issue Feb 14, 2018
…version

Prior to this commit, the function used to determine the version of
Powershell would loop forever inside the Subprocess.execute function
because the process would never exit. This commit fixes that by passing
in a ruby block to capture the version from stdout instead of trying to
capture it from the returned process when it exits.
briancain added a commit to briancain/vagrant that referenced this issue Feb 14, 2018
…S version

Prior to this commit, the function used to determine the version of
Powershell would loop forever inside the Subprocess.execute function
because the process would never exit. This commit fixes that by passing
in a ruby block to capture the version from stdout instead of trying to
capture it from the returned process when it exits.
briancain added a commit to briancain/vagrant that referenced this issue Feb 14, 2018
…S version

Prior to this commit, the function used to determine the version of
Powershell would loop forever inside the Subprocess.execute function
because the process would never exit. This commit fixes that by passing
in a ruby block to capture the version from stdout instead of trying to
capture it from the returned process when it exits.
@briancain briancain self-assigned this Feb 14, 2018
briancain added a commit to briancain/vagrant that referenced this issue Feb 22, 2018
…S version

Prior to this commit, the function used to determine the version of
Powershell would loop forever inside the Subprocess.execute function
because the process would never exit. This commit fixes that by passing
in a ruby block to capture the version from stdout instead of trying to
capture it from the returned process when it exits.
@func0der
Copy link

Sorry, just to so that I understand the merge correctly: You have just added an error message to the whole thing, instead of fixing the problem of Vagrant not being able to determine older versions of Powershell?
Or am I missing something here?

@briancain
Copy link
Member

@func0der - the function used to determine the version of Powershell would loop forever inside the Subprocess.execute function because the powershell process would never actually exit. That commit fixes that by passing in a ruby block to capture the version from the stdout instead of trying to capture it from the returned process when it should of exited. The timeout is if the version check never exits, and if nothing was put to stdout.

@func0der
Copy link

@briancain Thank you for the clarification :)

@ramprsad1433
Copy link

@briancain
I'm Getting Upgrade version3
$ vagrant up
The version of powershell currently installed on this host is less than
the required minimum version. Please upgrade the installed version of
powershell to the minimum required version and run the command again.

Installed version: 2

Minimum required version: 3

Currently my laptop 0S:win7 Sp1
Please share us SP3 url through email.
My email :mcitpram1433@gmail.com

@briancain
Copy link
Member

@ramprsad1433 - You should be able to get the update by running Windows update, thanks!

@TomyLobo
Copy link

@briancain That is not my experience with Windows 7 powershell upgrades :)
I had to install it manually.

@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants