Vagrant: Vagrant share is not a recognized command

Created on 28 Feb 2017  ยท  10Comments  ยท  Source: hashicorp/vagrant

It's pretty much all in the title, when I run vagrant share it just looks like it's not a recognised command. I can't find anywhere online about this command being taking out of Vagrant, and it's still included in the docs. Am I missing something?

Vagrant version

1.8.1

Host operating system

Ubuntu 16.04 64bit (Elementary OS)

Guest operating system

Ubuntu 16.04

Vagrantfile (standard Scotchbox)

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

    config.vm.box = "scotch/box"
    config.vm.network "private_network", ip: "192.168.33.10"
    config.vm.hostname = "scotchbox"
    config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

    # Optional NFS. Make sure to remove other synced_folder line too
    #config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

end

Expected behavior

The vagrant share command should be recognised and executed as described in the docs

Actual behavior

The command is not recognized (below):

~/dev$ vagrant share
Usage: vagrant [options] <command> [<args>]

    -v, --version                    Print the version and exit.
    -h, --help                       Print this help.

Common commands:
     box             manages boxes: installation, removal, etc.
     destroy         stops and deletes all traces of the vagrant machine
     global-status   outputs status Vagrant environments for this user
     halt            stops the vagrant machine
     help            shows the help for a subcommand
     init            initializes a new Vagrant environment by creating a Vagrantfile
     login           log in to HashiCorp's Atlas
     package         packages a running vagrant environment into a box
     plugin          manages plugins: install, uninstall, update, etc.
     port            displays information about guest port mappings
     powershell      connects to machine via powershell remoting
     provision       provisions the vagrant machine
     push            deploys code in this environment to a configured destination
     rdp             connects to machine via RDP
     reload          restarts vagrant machine, loads new Vagrantfile configuration
     resume          resume a suspended vagrant machine
     snapshot        manages snapshots: saving, restoring, etc.
     ssh             connects to machine via SSH
     ssh-config      outputs OpenSSH valid configuration to connect to the machine
     status          outputs status of the vagrant machine
     suspend         suspends the machine
     up              starts and provisions the vagrant environment
     version         prints current and latest Vagrant version

For help on any individual command run `vagrant COMMAND -h`

Additional subcommands are available, but are either more advanced
or not commonly used. To see all subcommands, run the command
`vagrant list-commands`.

Steps to reproduce

  1. Run vagrant share

Most helpful comment

Have you tried manually installing the vagrant-share plugin?

vagrant plugin install vagrant-share

This doesn't answer the underlying issue, and I'm unsure why it didn't come with your version of vagrant, but this should at least get you up and running. Hope it helps.

All 10 comments

Have you tried manually installing the vagrant-share plugin?

vagrant plugin install vagrant-share

This doesn't answer the underlying issue, and I'm unsure why it didn't come with your version of vagrant, but this should at least get you up and running. Hope it helps.

If vagrant was not installed from the official installer the vagrant-share plugin will not be available. If for some reason the plugin was uninstalled or corrupted, https://github.com/mitchellh/vagrant/issues/8311#issuecomment-283105074 will get it installed again.

Cheers!

I think I must have installed Vagrant via apt-get. Reinstalling via the Vagrant website fixed the issue.

It also happened to me too. I am running windows and installed it from the vagrant website.

I've just installed it from the .deb file and ran into the same issue. After installing the vagrant-share plugin, I get this

Vagrant Share now defaults to using the `ngrok` driver.
The `classic` driver has been deprecated.

For more information about the `ngrok` driver, please
refer to the documentation:

  https://www.vagrantup.com/docs/share/

The executable 'ngrok' Vagrant is trying to run was not found
in the PATH variable. The 'ngrok' executable is required to
run Vagrant share. If 'ngrok' is currently installed in a
non-standard location, append that location to the PATH
variable and run this command again. If 'ngrok' is not
currently installed, it can be downloaded from the ngrok
website:

  https://ngrok.com/download

I'm downloading ngrok, but you may have to check again if vagrant share should be working out of the box as you say :+1:

I'm having some trouble with ngrok and vagrant, i can't really figure out what to do next.

https://imgur.com/a/niNbEIo

ngrok in under my home dir / App

@mattiasghodsian This error is mostly because the path to ngrok binary is not present in $PATH.

In my case I solved it following these instructions https://gist.github.com/diegoquintanav/4875c3186dbdb2cc8822f849e499ce9e

Hope it helps!

@mattiasghodsian This error is mostly because the path to ngrok binary is not present in $PATH.

In my case I solved it following these instructions https://gist.github.com/diegoquintanav/4875c3186dbdb2cc8822f849e499ce9e

Hope it helps!

excuse me, @diegoquintanav . could you explain what is usr/local/bin mean and $path mean? idk just me or there are still people who don't understand too. thanks

@midingblk sure! `

$PATH is a symbol (or an alias) used in some linux distros to refer to a group of paths that are pre-loaded into your shell (think of bash, for instance), so to speak. This is so you can refer to them more easily (Check yours by running echo $PATH). In the case of ngrok and in other executable binaries in linux in general, you can execute them it by doing

$ my/path/to/bin/ngrok

But adding ngrok to your $PATH lets you execute it directly,

$ ngrok

Since vagrant share executes (probably) ngrok in the background, it will crash if when running the second, there is nothing with that name already preloaded.

This is where usr/local/bin comes in handy. This is used in Ubuntu (in other linux distros is probably something else but I don't know), to refer to general system wide applications. This path is preloaded into your $PATH by default so any executable binaries you place there will be accesible by its name from the shell.

You can find more info on what usr/local/bin is meant for in this link https://askubuntu.com/questions/308045/differences-between-bin-sbin-usr-bin-usr-sbin-usr-local-bin-usr-local.

And check more about $PATH in https://stackoverflow.com/questions/16560332/what-is-this-path-in-linux-and-how-to-modify-it

I hope this made it more clear.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bbaassssiiee picture bbaassssiiee  ยท  3Comments

dorinlazar picture dorinlazar  ยท  3Comments

OtezVikentiy picture OtezVikentiy  ยท  3Comments

lebogan picture lebogan  ยท  3Comments

barkingfoodog picture barkingfoodog  ยท  3Comments