-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Issues with shell when SSH-ing into Vagrant #9143
Comments
Similar behavior for me with: I'm using the box 'ubuntu/xenial64'. After the box is up and running, calling 'vagrant ssh' logs into the machine, shows all the information which is shown by ubuntu when logging in, but not the shell prompt. Worked with vagrant 2.0.0 without problems. |
Same behavior here. I'm running: Windows 10 - fully patched While ...
RUNNING HANDLER [vagrant_configure : restart network] **************************
changed: [default]
PLAY RECAP *********************************************************************
default : ok=56 changed=52 unreachable=0 failed=0
AEONFLUX@DESKTOP-3D4EIEA MINGW64 ~/Desktop/python-vagrant-centos7 (virtualbox-5.2)
$ vagrant ssh
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/premkproject
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/postmkproject
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/initialize
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/premkvirtualenv
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/postmkvirtualenv
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/prermvirtualenv
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/postrmvirtualenv
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/predeactivate
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/postdeactivate
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/preactivate
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/postactivate
virtualenvwrapper.user_scripts creating /home/vagrant/.virtualenvs/get_env_details
[after getting no bash prompt for 10 minutes, I hit Control+C here]
AEONFLUX@DESKTOP-3D4EIEA MINGW64 ~/Desktop/python-vagrant-centos7 (virtualbox-5.2)
$ vagrant ssh
[nothing, it just hangs here] I will note, however, that if I SSH to the VM's hostname from PuTTy, I can get in and get a bash prompt. I'll test from work on my Mac as well. Here's the Vagrant file I'm using: https://github.com/wharton/python-vagrant-centos7/blob/virtualbox-5.2/Vagrantfile Thanks, as always, for your efforts! |
I confirm: Win7 x64, Git 2.15.0.windows.1, Vagrant 2.0.1 - no shell prompt after vagrant ssh login. |
I've confirmed it works fine on my Mac. I'm wondering if it might be a terminal issue? I'm going to try setting git-bash to use |
It seems to be a terminal issue. I'm able to For those looking for a workaround, click the icon in the git-bash terminal upper left, Options, Terminal and select |
@FlipperPA Thank you, the workaround works for me as well! I had my cygwin terminal set to |
Same issue, Windows 10 (build 1703), Vagrant 2.0.1, Git bash 2.15.0, Virtualbox 5.2.0. The terminal resey didn't seem to work for me. |
I am getting the same issue. This is with git-bash, v2.9.0, virtualbox 5.1.30, and vagrant 2.0.1 on Windows 7 fully patched. Using Powershell 5, it works with vagrant ssh. Windows cmd vagrant ssh works. SSH (not vagrant ssh) to the 127.0.0.1 box from git command line, windows cmd, or Powershell works. Only vagrant ssh fails. It does not provide a command prompt, and will not accept commands. Loading the gui, and logging in there works. Changing the terminal type to xterm-256color does not change the behaviour. Updating to git-bash 2.15.0.windows.1 did not change anything |
Same issue here on windows 8, using cygwin, vagrant 2.0.1, while trying to launch debian/stretch64 wich was working fine on vagrant 1.8.5. |
The workaround worked for me, but not a colleague. Another workaround: |
For some reason, it isn't creating a pseudo terminal:
A more general workaround is to dump vagrant's ssh config and tell ssh to use it:
|
Now I see that vagrant ships with an msys environment, and it's running that ssh and not cygwin's by default, which is apparently problematic when calling from inside cygwin. If I call that ssh.exe directly ( You can tell Vagrant to prefer your system tools with the
or put this into your .bash_profile:
|
Nice, the |
Hi everyone, I'm trying to vagrant ssh to create a new database with mysql, the above command worked for me, but now I'm stucked in the password field. It just wont take anything, is like if the keyboard wasn't working when I type the pass.
I'm running Git Bash as admin (and tried with no admin privileges). Windows command line and Node.js command prompt, and Windows Powershell do the same thing when I get to the password field. Windows 10 - 64bit I would really appreciate any help on this matter. Thank you! |
Hoping for a proper fix :) |
Hi, I had a similar problem on Windows 7 - do "vagrant ssh" and it zipped to the next line and did not start vagrant. I could directly ssh vagrant@127.0.0.1 etc! What I found is I had (BOTH!) cygwin and msys in my path and they both has ssh.exe programs. I removed them from the path and now vagrant ssh works. So something requires that the internal ssh and presumably the hidden .ssh directory must be in the hashicorp\ directory tree. |
Same here |
The best solution for me is to use:
Otherwise our developers on windows can't run there virtual machine correctly. |
Same problem here, with these versions: Windows 10 Pro 64-bit version 1709, build 16299.15 Using |
Updated to Vagrant 2.0.2 and it seems to have fixed the issue for me. Hopefully it's resolved it for others too? |
Hi there. The 2.0.2 release of Vagrant has an updated approach to the ssh client. The installer package ships with its own vendored ssh client so things are functional if the user has not yet installed an SSH package. This caused issues in special environments like cygwin or msys2, which could be rectified with wrapping the ssh process within a winpty process. However, this was also fragile and did not consistently work in all setups. So the 2.0.2 release removed the winpty wrapping and will search first for an ssh client on the host's path, and then fall back to the vendored ssh client as a last resort. Apologies for the troubles encountered within different shell environments. This update should resolve most of the issues that were encountered. Cheers! |
hey guys,
Get cloud support with Ubuntu Advantage Cloud Guest: 0 packages can be updated. |
@HSarode-Compumatrice This was fixed in version 2.0.2 - upgrade Vagrant. :) |
hey @FlipperPA Thank you so much,upgrading vagrant it worked,it basically for ubuntu xenial 16.04.3 box !!! |
I had a similar problem with the latest version of Vagrant 2.0.2 running on Windows 7 host, with Archlinux/Arlinux box. The prompt appeared intermittently and was sometimes corrupted. I installed OpenSSH for windows from http://www.mls-software.com/opensshd.html and all seems good now. |
I am having this same problem. I have tried installing cygwin and using OS: Win 7 Home Premium Version 6.1 (Build 7601: Service Pack 1) |
My team and I have been experiencing this issue frequently recently. The hosts we've been using are ubuntu and macos, the guest is always ubuntu 16.04. The versions of vagrant I've tested: 2.0.2, 1.95. I'm commenting now because the hang happened again, and
The vagrant up looks like this:
After the default boot-timeout (300 seconds), this happens:
When SSH does not hang, the delay for SSH working is about 5 seconds. |
the fix is for when you successfully login but there is no prompt. |
i brought up gui vm window and found that i had virtualization off in bios. turned on and booted first time. try opening virtualbox manager and click show to watch the prograss of booting. no it doesnt lockup at ssh generating keys |
I have this error using Vagrant 2.0.4. I tried everything. Nothing works.
|
@montao that looks like a different problem. Try |
thanks but didnt worked out, first question: where to put "VAGRANT_PREFER_SYSTEM_BIN=1" whether in vagrant file or some where else .please suggest |
The problem is, that The better solution is, in your
That's correct "-tt", not "-t" to enforce creating it. This is working in Git Bash perfectly! |
Thanks @dkarvounaris, your solution works for me |
Remember to check that virtualization is enabled in BIOS. I had the same problem, but got it working by going to BIOS > Advance mode > Advance tab > CPU Configuration > Intel Virtualization Technology (or other virtualization setting). found the tip here |
Could we get a |
WSL `vagrant.exe ssh` doesn't provide a command prompt/never logs in, adding this argument to the Vagrant file fixes this problem. See: hashicorp/vagrant#9143 (comment)
I had a similar issue to this one. I had just reinstalled my OS and transported my ssh keys from the old installation in. The ownership and mode on the ssh keys were not properly set, and vagrant could not access them. I just did this: sudo chown -R $USER:$USER ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
chmod 644 ~/.ssh/*.pub |
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. |
Running Vagrant 2.0.1
Windows 7 (fully updated)
Using homestead so Ubuntu 16
I'll update the ticket with my vagrant file once I'm infront of my machine.
Debug output
Provide a link to a GitHub Gist containing the complete debug output:
https://www.vagrantup.com/docs/other/debugging.html. The debug output should
be very long. Do NOT paste the debug output in the issue, just paste the
link to the Gist.
Expected behavior
Vagrant up appeared to run fine. However when SSH-ing into the Homestead box I got an issue.
Actual behavior
The default shell didn't load correctly. Left with a blank terminal screen
Steps to reproduce
The text was updated successfully, but these errors were encountered: