Skip to content
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

SSH command responded with a non-zero exit status #1090

Closed
yabasha opened this issue Apr 22, 2019 · 16 comments
Closed

SSH command responded with a non-zero exit status #1090

yabasha opened this issue Apr 22, 2019 · 16 comments

Comments

@yabasha
Copy link

yabasha commented Apr 22, 2019

Versions

  • Vagrant: 2.2.4
  • Provider: Virtualbox Version 6.0.6 r130049 (Qt5.6.2)
  • Homestead: N/A

Host operating system

Windows 10 x64

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: code/
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/public

databases:
    - homestead

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# zray:
#  If you've already freely registered Z-Ray, you can place the token here.
#     - email: foo@bar.com
#       token: foo
#  Don't forget to ensure that you have 'zray: "true"' for your site.

Vagrant destroy & up output

link to a GitHub Gist containing the complete output of vagrant destroy && vagrant up.

Expected behavior

What should have happened? After cloning the repo (homestead: https://github.com/laravel/homestead.git) and run vagrant up after init.bat it works fine, and run vagrant halt as normal; but when run vagrant up after the first time it produce the following error:

E:\homestead (master -> origin)
λ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' version '7.2.1' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 8000 (host) (adapter 1)
    homestead-7: 443 (guest) => 44300 (host) (adapter 1)
    homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
    homestead-7: 4040 (guest) => 4040 (host) (adapter 1)
    homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
    homestead-7: 8025 (guest) => 8025 (host) (adapter 1)
    homestead-7: 27017 (guest) => 27017 (host) (adapter 1)
    homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2222
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
==> homestead-7: Machine booted and ready!
[homestead-7] GuestAdditions seems to be installed (6.0.6) correctly, but not running.
bash: line 5: setup: command not found
==> homestead-7: Checking for guest additions in VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

 setup

Stdout from the command:



Stderr from the command:

bash: line 5: setup: command not found

Actual behavior

What actually happened? clone the repo for a new local project and run vagrant up

Steps to reproduce

  1. Clone the repo
  2. run vagrant up
  3. run vagrant halt
  4. run vagrant up again
  5. the error is displayed

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

More info

I am using homestead since version 4 for all of my local projects, but this issue happened after yesterday update.

@svpernova09
Copy link
Contributor

svpernova09 commented Apr 22, 2019

Possibly a bad box download? Not sure. This is a very nonspecific error. Try removing the box and add it again?

Anyone else able to replicate? I'm not able to:

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Importing base box 'laravel/homestead'...
==> homestead-7: Matching MAC address for NAT networking...
==> homestead-7: Checking if box 'laravel/homestead' version '7.2.1' is up to date...
==> homestead-7: Setting the name of the VM: homestead-7
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 8000 (host) (adapter 1)
    homestead-7: 443 (guest) => 44300 (host) (adapter 1)
    homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
    homestead-7: 4040 (guest) => 4040 (host) (adapter 1)
    homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
    homestead-7: 8025 (guest) => 8025 (host) (adapter 1)
    homestead-7: 27017 (guest) => 27017 (host) (adapter 1)
    homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2222
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
    homestead-7:
    homestead-7: Vagrant insecure key detected. Vagrant will automatically replace
    homestead-7: this with a newly generated keypair for better security.
    homestead-7:
    homestead-7: Inserting generated public key within guest...
    homestead-7: Removing insecure key from the guest if it's present...
    homestead-7: Key inserted! Disconnecting and reconnecting using new SSH key...
==> homestead-7: Machine booted and ready!
==> homestead-7: Checking for guest additions in VM...
    homestead-7: The guest additions on this VM do not match the installed version of
    homestead-7: VirtualBox! In most cases this is fine, but in rare cases it can
    homestead-7: prevent things such as shared folders from working properly. If you see
    homestead-7: shared folder errors, please make sure the guest additions within the
    homestead-7: virtual machine match the version of VirtualBox you have installed on
    homestead-7: your host and reload your VM.
    homestead-7:
    homestead-7: Guest Additions Version: 5.2.8_KernelUbuntu r120774
    homestead-7: VirtualBox Version: 6.0
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Mounting shared folders...
    homestead-7: /vagrant => /Users/joeferguson/Code/homestead
    homestead-7: /home/vagrant/qs => /Users/joeferguson/Code/quickstart-5.7
==> homestead-7: Running provisioner: file...
    homestead-7: /Users/joeferguson/Code/homestead/aliases => /tmp/bash_aliases
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
    homestead-7:
    homestead-7: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBeub1sTnpX7Tp7f0ukLAz7dMn7CS9w6eHmc1wtJNp/iXHzyBRKZ+ov8z+voCVJOrSDyTsG0IKcby8+UxwpzR2nyqiBPw+oaSD1elIHFS48h7Wd5f41S6QeHUlhac20fa5EHTnNw9jphtxDuYPa+xiaNdbdvJKC1jZuipsqc4qlcDC1LISOtIsAzMF1fnByWEe3JBvRxvCmegruu424chIGG23elIoBHsOvY/6BI+5G2BNSBvqzHxfQ2mK6j4tEj2K2s+4M3r4FrgZIYgHxxZtADdNGwditFu5ipfaQSc1n5YFQiI87iTO5OZCBdffMY3qQWaE3ne+hAVDSdJLWFDn halo@mobile-rage-work
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/1l/z5m62sk55kj2ps4st0kgl3100000gn/T/vagrant-shell20190422-97073-1o4lu7o.sh
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Certificate: qs.test
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Site: qs.test
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Checking for old Schedule
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Clear Variables
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Cron
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Nginx
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating MySQL Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Postgres Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Update Composer
    homestead-7: You are already using composer version 1.8.5 (stable channel).
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/1l/z5m62sk55kj2ps4st0kgl3100000gn/T/vagrant-shell20190422-97073-zln5x6.sh
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Update motd
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/1l/z5m62sk55kj2ps4st0kgl3100000gn/T/vagrant-shell20190422-97073-jn2pyh.sh
vagrant up: 01:30

@mrelevance
Copy link

This is happening for me as well, but using Linux for the host OS.

@mrelevance
Copy link

Looks like it could possibly be related to the vagrant-vbguest plugin judging from this issue: dotless-de/vagrant-vbguest#278

@svpernova09
Copy link
Contributor

Looks like it could possibly be related to the vagrant-vbguest plugin judging from this issue: dotless-de/vagrant-vbguest#278

Can you confirm removing the plugin resolves the issue?

@mrelevance
Copy link

Yes, removing the plugin resolves the issue for me.

@svpernova09
Copy link
Contributor

Yes, removing the plugin resolves the issue for me.

Thanks!

@yabasha can you confirm removing the plugin resolves the issue for you as well?

@IllyaMoskvin
Copy link

IllyaMoskvin commented Apr 22, 2019

I had this issue last night. I had to downgrade to VirtualBox 5.2.28, but I did not have to uninstall vbguest. After downgrading, vbguest managed to successfully downgrade GuestAdditions from 6.0.6 to 5.2.28.

For context, I'm running Homestead v8.3.1 and Vagrant v2.2.4, both of which are at the time of writing the most recent releases for each tool. My host is Windows 10 1709 (v10.0.16299).

Per @gadkrumholz from dotless-de/vagrant-vbguest#278:

This is happening again, using VBox 6.0.6 that came out recently... the issue is with an error in the install script of the VBox Guest additions ISO that gets shipped with VBox...

Going back to VBox 5.2.28 works as a workaround.

@svpernova09
Copy link
Contributor

IMHO removing the Vagrant plugin is a better option than downgrading VirtualBox.

@IllyaMoskvin
Copy link

My memory of last night's debugging is foggy, but I thought the core issue was with VBoxGuestAdditions-6.0.6 itself, not the plugin? As in, vbguest just exposes the existing issue by attempting an automatic upgrade, and if one tries to upgrade VBoxGuestAdditions manually, they'll run into the same problem?

@IllyaMoskvin
Copy link

@svpernova09 Per the log you shared above, it looks like your VBoxGuestAdditions is out of date:

==> homestead-7: Checking for guest additions in VM...
homestead-7: The guest additions on this VM do not match the installed version of
homestead-7: VirtualBox! In most cases this is fine, but in rare cases it can
homestead-7: prevent things such as shared folders from working properly. If you see
homestead-7: shared folder errors, please make sure the guest additions within the
homestead-7: virtual machine match the version of VirtualBox you have installed on
homestead-7: your host and reload your VM.
homestead-7:
homestead-7: Guest Additions Version: 5.2.8_KernelUbuntu r120774
homestead-7: VirtualBox Version: 6.0

Apologies if I'm off-base here, but I'm guessing that if you try to upgrade your Guest Additions manually, you may run into the same issue. Might be a good litmus test to see if vbguest is the actual culprit.

@yabasha
Copy link
Author

yabasha commented Apr 22, 2019

@svpernova09 yes by removing the plugin it resolved the issue for me too.

Thanx,

@yabasha yabasha closed this as completed Apr 22, 2019
@svpernova09
Copy link
Contributor

Apologies if I'm off-base here, but I'm guessing that if you try to upgrade your Guest Additions manually, you may run into the same issue. Might be a good litmus test to see if vbguest is the actual culprit.

I've always been under the impression that if you have to upgrade guest tools in your VM you're "doing something wrong". I often ran into this when running the same VM instance for long periods of time. An example here would be the VM that I keep on my MacOS system that runs Windows (And MacOS), these systems are never rebuilt from scratch like vagrant boxes are. Over time I'd expect to have to update the guest additions to these VMs.

For Vagrant, the end user shouldn't have to ever be concerned about guest additions because we ship new base boxes near monthly. Which means we should rarely run into a situation where we're shipping "Stale" images. The reason we're still using 5.x extensions is that our upstream image provider (https://github.com/chef/bento) still uses 5. We made the jump to VirtualBox 6 once we had the all-clear from several users who were guinea pigs to upgrade VirtualBox.

All of that to say you shouldn't need to upgrade the guest additions in Homestead. If you want to, you might run into unintended issues or conflicts like this. My advice to Homestead users is to not mess with VirtualBox extensions unless you're running into hard errors that are easily attributed to guest versions.

@IllyaMoskvin
Copy link

@svpernova09 Thank you for the advice! This is good to know moving forward.

@deviantintegral
Copy link
Contributor

I've always been under the impression that if you have to upgrade guest tools in your VM you're "doing something wrong".

With Windows guests, a popup is shown if the guest additions detect an available upgrade. So at least, there, the upstream developers want users to keep them in sync. However, it was only in much earlier versions of VirtualBox that I've seen serious issues with version mismatches. The 5.x extensions continue to work fine for me on 6.x, at least for Vagrant / headless use.

Does it make sense to add a "troubleshooting" section to the docs? There's some bits of advice here that seem like they could be surfaced.

@piotr-cz
Copy link
Contributor

There is PR for the issue here: dotless-de/vagrant-vbguest#334

@JasonWeakley
Copy link

Roll your VirtualBox back to 6.0.4... I just have the same exact "setup" failure, tried everything from expunging all plugins, to reloading and provisioning 10 times...
https://www.virtualbox.org/wiki/Download_Old_Builds_6_0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants