Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Vagrant environment or target machine is required

I am trying to set up homestead. I have tried to add new custom domain but I forgot that I have to run the command vagrant provision and I got an error, so I have decided to uninstall Vagrant VirtualBox and start from scratch but I have realy messed the things up.

Now I have installed VirtualBox, Vagrant. I have cloned the repository of homestead on my home directory. I filled the Homestead.yaml but when I start with vagrant up I get this error

A Vagrant environment or target machine is required to run this command. Run vagrant init to create a new Vagrant environment. Or, get an ID of a target machine from vagrant global-status to run this command on. A final option is to change to a directory with a Vagrantfile and to try again. Also I have tried to require homestead through composer but I`am still getting the same error.

When I try with vagrant init a new box is created and when I start vagrant up I am not in the homestead box but in the one that I last created.

I am really confused and I don`t know what I am missing. Any help will be appreciated.

edit.

Also when I try with homestead up, the virtual machine is running and I am able to connect through ssh but when I type custom domains I get "No input file specified."

update:

In the ~/.homestead directory I have executed vagrant init laravel/homestead and now I can start the the machine and to connect through ssh but I can`t go to a registered custom domain - the page is not available.

Update 2:

Also I just checked and on the homestead server my Code folder is empty. In the Homestead.yamlfile I have folders - map: ~/Code to: /home/vagrant/Code

All my projects are there in the local folder and I have no idea why they are not on vagrant.

like image 640
Радослав Ангелов Avatar asked Jan 12 '16 13:01

Радослав Ангелов


3 Answers

99% you're in wrong directory. Make sure that the directory includes Vagrantfile.

like image 167
S1awek Avatar answered Oct 10 '22 00:10

S1awek


Can you run vagrant global-status to see if there is already a Vagrant server running? Then you can use vagrant up [server-id] to get into the existing one.

like image 25
Jeff Avatar answered Oct 09 '22 23:10

Jeff


As someone said earlier, you could be in the wrong directory. Actually going to the right directory containing the 'Vagrantfile' was all that solved my problem.

like image 2
aye decoder Avatar answered Oct 10 '22 00:10

aye decoder