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

Issues with shell when SSH-ing into Vagrant #9143

Closed mark1282 closed 6 years ago

mark1282 commented 7 years ago

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

  1. Vagrant up
  2. vagrant ssh
49handyman commented 6 years ago

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

montao commented 6 years ago

I have this error using Vagrant 2.0.4. I tried everything. Nothing works.


$ VAGRANT_PREFER_SYSTEM_BIN=1 vagrant ssh
ssh_exchange_identification: read: Connection reset by peer
jk3us commented 6 years ago

@montao that looks like a different problem. Try vagrant ssh -- -v and get more info from ssh and see if you can narrow it down from there. Open a new issue if you need to.

HSarode-Compumatrice commented 6 years ago

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

dkarvounaris commented 6 years ago

The problem is, that ssh thinks this is no terminal and such does not create TTY … there's an ssh config file option RequestTTY which can be used, which does the same things like the "-t" and "-T" parameters for ssh. See https://man.openbsd.org/ssh_config#RequestTTY . However...

The better solution is, in your Vagrantfile set the option for its ssh configuration, as it's mentioned here: https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html I added after this line at this location in my Vagrantfile

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.ssh.extra_args = "-tt"
   ….

That's correct "-tt", not "-t" to enforce creating it.

This is working in Git Bash perfectly!

ivan-brko commented 6 years ago

Thanks @dkarvounaris, your solution works for me

tuomitie commented 6 years ago

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

Trollwut commented 5 years ago

Could we get a vagrant ssh -tt to get the same behaviour as in config.ssh.extra_args = "-tt"?

kindlehl commented 5 years ago

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
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.