Please note that the Vagrant issue tracker is reserved for bug reports and
enhancements. For general usage questions, please use the Vagrant mailing list:
https://groups.google.com/forum/#!forum/vagrant-up. Thank you!
Vagrant 1.9.7
Windows 7 Professional
Ubuntu Server 14.04 ("ubuntu/trusty64" box)
Comments were removed.
$infoScript = <<SCRIPT
echo 'IP-addresses of the vm ...'
ifconfig
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "public_network"
config.vm.synced_folder "www", "/var/www"
config.vm.synced_folder "phpconfig", "/etc/php5/apache2"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y apache2 php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
SHELL
config.vm.provision "shell", inline: $infoScript,
run: "always"
end
https://gist.github.com/daffy1234/373f51a56ba183b886d045da99643011
The machine should be provisioned and come up successfully.
After the initial "vagrant up" command, absolutely no output is produced. vagrant.exe seems to open ruby.exe and powershell.exe. Killing powershell.exe twice is a workaround, and it gets the machine provisioned and booting normally. This issue does not occur after the machine has successfully booted at least once.
Downgrading to Vagrant 1.9.6 is another workaround.
I've hit the same issue on a fresh Windows 7 install with Vagrant 1.9.7.
Same here. It hangs here:
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]::GetCurren
t())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)"]
INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: True
Same issue on Windows 7 x64, even running vagrant status
I have this issue as well.
Same here, going back to 1.9.6 resolved for me as well.
I have similar issue... have not tried vagrant 1.9.6 as yet. Will do and update
I've got the same issue.
The last message with --debug key is like the posted above:
DEBUG subprocess: stdout: False
Also for me the same issue:
vagrant up --debug
....last 3 lines from debuggin output:
INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: True
Have the same problem.
As has been commented on https://github.com/mitchellh/vagrant/issues/8777, killing the powershell.exe process allows vagrant to continue, should you really NEED the latest version for some other reason.
Hello, same issue appeared today. Fix that worked for me was to update Windows PowerShell (was 2009). Now it is 2016 version and Vagrant works perfect. You can update it by installing WMF: https://msdn.microsoft.com/en-us/powershell/mt173057.aspx
upgrading powershell helps (install WMF 5)
you commented half an hour earlier :D
Update Windows Powershell to ver 5, the problem was solved.
Vagrant: Vagrant 1.9.7
Host OS: Windows 7 Professional 64bit
Guest OS: Ubuntu Server 14.04 ("ubuntu/trusty64" box)
Upgrading powershell cannot be a final fix for this bug. I recommend to show a warning in vagrant, asking the user to upgrade power shell...
WMF 5.1 + .NET 4.6.1 works for me too on Win 7 SP1. Even with that, after launching 'vagrant up', it freezes for ~20 sec, while powershell.exe eats up to 50% of i5 CPU resources. I don't remember such behavior on earlier versions.
I had the same problem running vagrant up for "ubuntu/trusty64" it would hang on:
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: True.
I installed WMF like @bozemojmaciej suggested and the problem is fixed!!
I am also facing 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
Had the same issue on my windows 7 machine.
Updated Windows Poweshell to version 5 and all works now.
Thanks a lot.
Updating Powershell on Host Machine or guest VM?
host
Thanks @pscheit
I have Updated Windows Poweshell to version 5 on host machine(Vagrant installed machine), now it was working now.
But I am getting another issue,
INFO synced_folders: Synced Folder Implementation: smb
INFO synced_folders: - /vagrant: . => /vagrant
INFO synced_folders: Invoking synced folder prepare for: smb
INFO interface: output: Preparing SMB shared folders...
INFO interface: output: ==> default: Preparing SMB shared folders...
INFO interface: detail: You will be asked for the username and password to use for the SMB
folders shortly. Please use the proper username/password of your
Windows account.
INFO interface: detail: default: You will be asked for the username and password to use for the SMB
default: folders shortly. Please use the proper username/password of your
default: Windows account.
default:
INFO interface: ask: Username:
INFO interface: ask: default: Username:
Prompting you for Samba folder credentials is normal. It is asking for an account on your host to connect to. You can put the credentials in the vagrant file but it isn't very secure to do so.
One work around I have is I store credentials in some environment variables and pass those into the vagrantfile. I set the environment variables when I open powershell to help keep them only to my vagrant session.
Example:
Vagrant.configure("2") do |config|
config.vm.box = "Windows2012R2"
config.vm.network "public_network", :bridge => "NAT
config.vm.synced_folder ".", "/vagrant", type: "smb", smb_username: ENV["smb_username"], smb_password: ENV["smb_password"]
end
end
Confirm same hanging issue on Win 7 x64 with Vagrant 1.9.7.
Its working for me after updating windows powershell.
Vagrant: Vagrant 1.9.7
Host OS: Windows 7 Professional 32bit
Guest OS: Ubuntu Server 14.04 ("ubuntu/trusty32" box)
Thanks @wiltaylor
My issue is resolved.
Upgrading PowerShell fixed for me. Was running PowerShell 2. Upgraded to PowerShell 5 with the Windows Management Framework (WMF) 5.1 and vagrant no longer got hung up at "vagrant up" command.
Vagrant 1.9.8
Windows 7 Professional 64bit
VirtualBox 5.1.26
Using trusty64 as host vm
Here's the guide I used to upgrade PowerShell. The frameworks in this post are outdated but the rest is correct. http://mikefrobbins.com/2015/01/08/how-to-check-the-powershell-version-and-install-a-new-version/
Upgrading powershell should resolve the issue. The latest release (1.9.8) includes this PR #8839 that checks the powershell version and raises an error if the minimum is not satisfied. Cheers!
@chrisroberts even on 1.9.8 I still need to kill powershell.exe in order to see the warning...
@chrisroberts On 2.0.0 I also need to kill powershell.exe to see this warning.
@kylerdmoore The link in your post is broken.
http://mikefrobbins.com/2015/01/08/how-to-check-the-powershell-version-and-install-a-new-version/
@chrisroberts I have 2.0.0 installed and I don't see any warning. Not even if I kill the process. Updating PS to v5 helps
Last working version for Windows 7 seems to be 1.9.5. Haven't tested 1.9.6 yet, but its broken since 1.9.7.
@chrisroberts your PR is not doing what you described. There wasn't any exceptions/warnings on last version 2.0.0, windows 7, getting here is what help me to solve the problem.
here is a faster and easier way of applying the workaround about installing new version of powershell.
do at your own risk, worked for me (not having any critical powershell-based startup scripts)
vagrant loaded ok
With latest v6.0.0-rc, @dmz9 technic failed: vagrant up
ends in error with:
Failed to locate the powershell executable on the available PATH. Please
ensure powershell is installed and available on the local PATH, then
run the command again.
And indeed, there is no powershell.exe
but a pwsh.exe
in C:\Program Files\PowerShell\6.0.0-rc
. If I duplicate pwsh.exe
to powershell.exe
in C:\Windows\System32\WindowsPowerShell\v1.0
after step 4, then vagrant up
fails with:
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: N/A
Minimum required version: 3
Finally, after following a solution in Stackoverflow, it finally worked: I installed .NET Framework 4.5.
So i updated powershell, and i type vagrant ssh into my terminal, which logs me into my machine. while i am logged in, the command prompt disappears. anyone else seeing this?
It is very interesting, vagrant up just hanging there forever, only saw exception when I killed all powershell process,
ERROR vagrant: #<Vagrant::Errors::PowerShellInvalidVersion: 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: N/A
Minimum required version: 3>
checked my powershell is 2,
$PSVersionTable.PSVersion
Solved the issue by upgraded WMF to 4.0.
I am facing the same issue now.
Today, I've up my Vagrant VMs.
I've halted them.
I've destroyed one VM and try a "vagrant up" to recreate.
Failed to locate the powershell executable on the available PATH. Please
ensure powershell is installed and available on the local PATH, then
run the command again.
Vagrant version : 2.0.1
Windows version : 10 Pro, 64bits
PowerShell version : 5.1.16299.98
Same problem.
Updated from Vagrant 1.8.5 to Vagrant 2, new Vagrantfile worked, but on 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: N/A
Minimum required version: 3
Vagrant Version 2.0.3
Windows version: 10 Home, 64bits
PowerShell version: 5.1.16299.251
Hi @navigatrum - this issue has already been reported in #9629. Thanks!
Restarting the pc in case of windows after adding the box before running vagrant up
did a fix for me.
In my case, this issue was solved by updating powershell and .Net framework
Fixed this by adding "%SYSTEMROOT%System32WindowsPowerShellv1.0" to the environment PATH
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.
Most helpful comment
Hello, same issue appeared today. Fix that worked for me was to update Windows PowerShell (was 2009). Now it is 2016 version and Vagrant works perfect. You can update it by installing WMF: https://msdn.microsoft.com/en-us/powershell/mt173057.aspx