hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.28k stars 4.43k forks source link

Vagrant up hangs forever on Windows 7, Vagrant 1.9.7, VirtualBox 5.1.22.r115126 #8777

Closed hopoffbaby closed 7 years ago

hopoffbaby commented 7 years ago

Vagrant version

C:\MyFiles\VagrantLSF>vagrant -v Vagrant 1.9.7

Host operating system

Windows 7 64bit

Guest operating system

Centos/7

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
end

Debug output

https://gist.github.com/hopoffbaby/be10d4873bdbe00cba23a58b48e00166

Expected behavior

Start virtual box vm with centos 7

Actual behavior

hang indefinitely after: DEBUG push: finalizing INFO subprocess: Starting process: ["C:\windows\System32\WindowsPowerShell\v1.0\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)"] INFO subprocess: Command not in installer, restoring original environment... DEBUG subprocess: Selecting on IO DEBUG subprocess: stdout: False

Steps to reproduce

  1. install vagrant & virtual box - latest
  2. vagrant up --debug
pnedkov commented 7 years ago

Same issue here. I started seeing this yesterday with Vagrant 1.9.6. I upgraded to 1.9.7 but I got the same result - it hangs after SSH auth method: private key. The new VM has booted and accessible over the network. On the other hand vagrant ssh does gives me: ssh_exchange_identification: read: Connection reset by peer

I am on Arch Linux and using VirtualBox 5.1.22.r115126.

I run vagrant up --debug and here is the error: https://pastebin.com/7SSegYjH

hopoffbaby commented 7 years ago

It seems that this issue is caused by 1.9.7. downgrading to 1.9.6 avoids this issue

pnedkov commented 7 years ago

For me the problem started yesterday with 1.9.6. I upgraded to 1.9.7 - same problem. I just downgraded to 1.9.5 - same problem.

pnedkov commented 7 years ago

I found what is causing my problem. It is the network adapter type. I am using 82545EM. When I changed it to 82540EM it works back again even with Vagrant 1.9.7. HTH

Parithi commented 7 years ago

@pnedkov I'm new to vagrant, can you tell me how to change the network adapter type?

I'm having the same setup, following @hopoffbaby and downgrading to vagrant 1.9.6 fixed my issue. But now stuck with vagrant ssh instead.

vagrant ssh --debug gives the following :

Please view this gist

MaxLap commented 7 years ago

Had the same issue, downgrading to 1.9.6 solved the issue.

After a windows update restarted my PC when things when running, i had to vagrant destroy to start it over. When I did, i had mounting issues, so i trying to update VirtualBox to 5.1.22 and vagrant to 1.9.7.

After doing so, all the commands hung and had no output. Using the debug, it also finished with

INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: False

(Sorry, I didn't think of copying the exact Starting Process line i was getting, and since vagrant needs a reboot to install and to uninstall, I don't have it)

I tried repair and reinstall of vagrant 1.9.7 and nothing changed. Downgrading to 1.9.6 solved that issue. Now, for some reason, vagrant ssh won't give me a prompt when used from gitbash, but it does from cmd. So i'll stay with that for now, i just want to run tests on this.

On Windows 7 Pro 64bit. VirtualBox 5.1.22 It's for a rails dev box, which uses Ubuntu Zesty 17.04.

pnedkov commented 7 years ago

@Parithi

vb.customize ["modifyvm", :id, "--nictype1", "82540EM"]

Refer to my vagrant repo if you want the complete Vagrantfile. I am not saying this will solve everyone's problem. But in my case 82545EM was the issue.

ikus060 commented 7 years ago

Seams to be duplicate of #8783

digash commented 7 years ago

Same issue here. I noticed that it gets hung on powershell, killing the powershell using process explorer allows the vagrant to continue with no issue.

inverbis commented 7 years ago

Cheers @digash, saved me from banging my head into the wall

pscheit commented 7 years ago

killing powershell did not help, because i need vagrant to know that i am administrator so it is able to use smb. I am on vagrant 1.9.6 and it is still happening

thanamanil commented 7 years ago

I exactly had the same problem with vagrant 1.9.7 on 2 of my machines. Downgrading the Vagrant to 1.9.3 fixed the issue.

nurid commented 7 years ago

The same problem with me (vagrant version 1.9.7; windows 7 64bit). here are the last lines of vagrant up --debug:

...

DEBUG push: finalizing
 INFO subprocess: Starting process: ["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoLogo", "-NoProfi

le", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)"]
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: False

.

thanamanil commented 7 years ago

@nurid: Try downgrading the vagrant version. I had the same issue and it was resolved after downgrading.

pscheit commented 7 years ago

upgrade powershell to fix it

nurid commented 7 years ago

@thanamanil : Thanks, it works. I downgraded the software from vagrant 1.9.7 to 1.9.6.

@pscheit : Thanks, my powershell version is 2.0 (c) 2009; I haven't tried your suggestion.

I checked the version as per this article: https://4sysops.com/archives/powershell-versions-and-their-windows-version/ using a command inside the powershell console window: $PSVersionTable

And I found the latest powershell update info: https://docs.microsoft.com/en-us/powershell/wmf/5.0/requirements in case I need it in the future.

pscheit commented 7 years ago

I have a windows 7 installation where vagrant version 1.8.6 had the same behaviour

tlongren commented 7 years ago

@nurid, updating powershell, as suggested by @pscheit, resolved this for me.

marcoebbinghaus commented 7 years ago

Downgrade to 1.9.6 solved the same issue for me too, thanks. Was stuck with 1.9.7 at the same line nurid stated.

ashokvaddevalli commented 7 years ago

I am also getting same issue on using Vagrant 1.9.6 version.

INFO subprocess: Starting process: ["C:\Windows\System32\WindowsPowerShell\v1.0\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)"] INFO subprocess: Command not in installer, restoring original environment... DEBUG subprocess: Selecting on IO DEBUG subprocess: stdout: True

goodwinb99 commented 7 years ago

Colleague of mine had the same issue. Upgrading from PowerShell 2.0 to 5.1 resolved the issue.

ashokvaddevalli commented 7 years ago

Ok. Thanks.

I am getting another issue Synced Folders on below.

=> default: Machine booted and ready! INFO warden: Calling IN action: # INFO provision: Checking provisioner sentinel file... INFO warden: Calling IN action: # INFO synced_folders: SyncedFolders loading from cache: false INFO subprocess: Starting process: ["C:\Windows\System32\WindowsPowerShell\v1.0\/powershell.EXE", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)"] INFO subprocess: Command not in installer, restoring original environment... DEBUG subprocess: Selecting on IO DEBUG subprocess: stdout: True

flashfs commented 7 years ago

Same problem here.. it just hangs. Vagrant 1.9.7, Windows 7 and Power Shell 2.0.

 INFO subprocess: Starting process: ["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoLogo", "-NoP
rofile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "(new-object System.Security.Principal.WindowsPrin
cipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole
]::Administrator)"]
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: True
tiagolpadua commented 7 years ago

Samething here, in Windows 10 works fine, but in Windows 7 it hangs

ghost commented 7 years ago

Same problem here. Windows, latest vagrant.

jmontilla202 commented 7 years ago

Windows 7 Pro 64-bit (recent fresh install) VirtualBox 5.1.26 Vagrant 1.9.8

Issue resolved by upgrading Powershell from 2.0 to 5.0 ...

image

image

chrisroberts commented 7 years ago

Closing as a duplicate of #8783

https://github.com/mitchellh/vagrant/issues/8783#issuecomment-325411772

Cheers!

Sathiyarajan commented 7 years ago

Killing the powershell.exe process from Windows Task Manager has resolved the issue in Windows 7.

ghost commented 7 years ago

For me, the issue was actually a ssh process inside the VM that couldn't connect to the destination and would put it in a loop lasting 45 min!

On Nov 7, 2017 4:37 AM, "sathyadev" notifications@github.com wrote:

Killing the powershell.exe process from Windows Task Manager has resolved the issue in Windows 7.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hashicorp/vagrant/issues/8777#issuecomment-342441971, or mute the thread https://github.com/notifications/unsubscribe-auth/AHbQCTLz_g2OtN1HfMWMK7VW1a38rTP5ks5s0DLUgaJpZM4OXEq2 .

KingGeneral commented 6 years ago

first you need to force close the powershell with taskmanager like @digash say.

then it will show the error where it stuck. for me i need to upgrade my powershell, then restart the computer run the vagrant up,

if stuck then after you type vagrant up, search power shell , run windows powershell ISE now it works

Gaurav2586 commented 6 years ago

Updating powershell to v3.0 solved this issue: http://www.microsoft.com/en-us/download/details.aspx?id=34595

felixtheflex commented 6 years ago

Yep updating powershell did the trick :-)

kclay commented 6 years ago

Thanks @Gaurav2586 just ran into this problem!

oussaka commented 6 years ago

Updating powershell to 4 or 5 solved this issue.

prondubuisi commented 6 years ago

Solved it by updating powershell here https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-windows?view=powershell-6 it took me to this link https://www.microsoft.com/en-us/download/confirmation.aspx?id=54616

renatoadsumus commented 6 years ago

Same problem here. Windows, latest Vagrant 2.0.2, Oracle Virtual Box 5.2.8 and PowerShell 2.0.

I have done update to PowerShell 5.0 and "vagrant up" have back working normally.

choco upgrade powershell

glmagicworks commented 6 years ago

This fix is from a Google+ group. Just run:

vagrant up --provider virtualbox

Be happy! https://groups.google.com/forum/#!topic/vagrant-up/MAbhSWNIxYk

shahker141 commented 6 years ago

Hi gabriellacerda,

Thank you very much, this is fixed the issue.

LiuHD commented 6 years ago

it works!!! just follow gabriellacerda, vagrant up --provider virtualbox

ghost commented 4 years ago

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.