Laravel – A Vagrant environment or target machine is required

homesteadlaravelvagrantvagrantfile

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.

Best Answer

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