-
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
vagrant up : The following SSH command responded with a non-zero exit status. #1659
Comments
And there is no default sync folder for path /vagrant |
And shutdown -h now |
Please attach debug logs by setting VAGRANT_LOG=debug |
@dengzhp I've done this to myself any number of times by messing up the /etc/sudoers or /etc/sudoers.d. I did it today, which is why I landed here. Somewhere in /etc/sudoers (or /etc/sudoers.d if it's included) you have to have
without that, the vagrant ssh (without tty) fails mysteriously. I once again had built a machine without my puppet vagrant module, which adds this in. @mitchellh if there's not already an FAQ on this, it's a good topic for one. I seem to do it over and over again :-) |
@rfay Thanks for you reminding. Yes. The cause is that I forgot adding the user to the sudoers. |
Adding |
This seems to have been sorted out :) |
@rfay :- In your solution: #1659 (comment) Do you change the /etc/sudoers file on the host machine or the guest VM ? |
It's the guest that's the problem here. |
OK thanks rfay (I find this happens from time to time - whether on host or guest is not specified - so thanks) but I can't get into the machine (e.g. via) ssh to change it, the failure I am having with non-zero exit status seems to have stopped the vm being created properly in order to log in to change that file. Ideally, I'd want to know where in the Vagrant scripts I can make adjustments to add in "vagrant ALL=(ALL) NOPASSWD:ALL" so that this is part of the automation. Others here confirm this works for them but surely we want this to be part of the automation? After all this is what Vagrant is all about. |
ssh root@ip or ssh vagrant@ip. The password is 'vagrant'. If you have the problem I had, then your problem is that you have replaced the sudoers file or otherwise damaged it. (or /etc/sudoers.d of course) |
Maybe this will be usefull for someone. I've fix the problem putting
.. on the end(!) of the sudoers file as metiononed in this tutorial: http://brianfisher.name/content/create-vanilla-ubuntu-precise-vagrant-base-box I don't know is it only refer to ubuntu but works for me. |
I'm still getting the error when trying to run "vagrant up" command in Mac OS. Error: ==> default: Mounting NFS shared folders... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! mount -o 'vers=3,udp' 192.168.100.1:'/Users/user1/vagrant/myproject/docroot' /var/www/site/docroot Stdout from the command: Stderr from the command: stdin: is not a tty mount.nfs: mount to NFS server '192.168.100.1:/Users/user1/vagrant/myproject/docroot' failed: timed out, giving up @rfay : I tried by adding the below entry in the sudoers file, but it still didn't help me. vagrant ALL=(ALL) NOPASSWD:ALL Defaults:vagrant !requiretty Guys, please let me know if there are any other alternative solutions for this. Thanks |
@pachabhaiya you seem to have an NFS mount problem. On your workstation host, you'll probably need to clean up /etc/exports, and in your Vagrantfile, stop mounting the docroot for now. Your problem doesn't really have to do with this issue. But I did see a damaged host /etc/exports due to a vagrant upgrade recently. |
Thanks @rfay . Clearing /etc/exports and commenting "docroot" solves the problem. |
@pachabhaiya You'll have to debug your NFS situation, but it's not related to this issue, so let's not continue here. You will probably want to back up to using Virtualbox mounts for now, then read the various resources on the web and see how to get NFS working. Basically: See if you can manually mount your NFS mount on the guest. When you solve that problem, you'll have solved everything. |
Thanks @rfay . |
@pachabhaiya Hi! Are you solved your problem with NFS? I has the same on Mac OS X |
Yes @bocharsky-bw. It's solved in mine Mac OS X. Firewall rules were creating those problem. Turned the firewall rules off and the problem was solved. :) |
Oh, @pachabhaiya, thanks very much! I turned off my firewall, add slashes to sync folders and when restart my Mac - it works! :) |
I got similar error, but it's caused by ssh-agent. |
Solved (in our case) by editing /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/guests/debian/cap/configure_networks.rb and replacing comm.sudo("su -c 'cat /tmp/vagrant-network-interfaces > /etc/network/interfaces'") with comm.sudo("cat /tmp/vagrant-network-interfaces > /etc/network/interfaces") |
@dbanttari Thank you, this error began randomly last week and your comment solved it. |
Hi, all! Recieve after start: The following SSH command responded with a non-zero exit status. hostname -f Stdout from the command: Stderr from the command: sudo: no tty present and no askpass program specified try change hostname to 'server', didt'n work. |
In my case I did "sudo service nfs-xxxx-kernel restart" and it start working. Kinda weird tho |
I encountered this issue recently on OS X 10.10.5 with VirtualBox 5.0.10 and Vagrant 1.8. Checking |
recently I 've made a |
I had this same issue and updating Oracle VirtualBox and Vagrant fixed it for me. |
@nicolasgarnil where do I have to add this line vagrant ALL=(ALL) NOPASSWD:ALL? |
@rfay 's solution here seems to be working for me. However as a relative |
This issue has been resolved. I guess .. you miss "Password-less Sudo" part In another way echo vagrant ALL=NOPASSWD:ALL > /etc/sudoers.d/vagrant |
…No PASS - to get rid of the TTY error - hashicorp/vagrant#1659
I have this issue: And after this show this issue: Please I need help with this |
I too have this problem:
Config generated by puphpet,
|
I think we can resolve by this
|
I ran into this today. I cannot I'm also getting
|
I got the same issue....Solved by restart my laptop......I dont know what to say....restarting is always a good solution... |
I am using Ubuntu and i am getting the same error
|
Hi @alpharameeztech - That error will likely be fixed if you upgrade your version of Vagrant to the latest. |
@briancain I am using the latest version
|
@alpharameeztech - the latest version is Thanks. |
Hey @briancain. Thank you for the update. I am gonna try and will let you know then :) |
@briancain Gracias amigo :) the issue got resolved with a vagrant update. |
Updating from 2.0.2 to 2.2.0 solved my problem |
for me it was the guest additions and: |
This is how I fixed it per this comment above Open the sudoers file (with visudo or you will break things). Add the following lines ABOVE the include to sudoers.d Save, and ignore the prompt to edit the README Reboot your system |
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. |
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces
The text was updated successfully, but these errors were encountered: