0

Laravel: 5.6 Vagrant: 2.1.1 When I installed the Vagrant, I noticed that all the files are in C drive (My C drive is SSD and I didn't want to do this). I followed this process and moved both .vagrant.d and .ssh files to E drive. But I have two problems:

Firstly, for running each Vagrant command I need to provide the ID of my box. Otherwise, I get this error:

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.

My second problem which I couldn't fix is: when I did ssh into my box, the Code directory was empty (My sites were gone!) and of course I couldn't access my sites. Instead, I get this error:

No input file specified.

I should mention that I changed the .ssh folder too and made necessary changes to the Homestead.yaml file:

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

authorize: E:\.ssh\id_rsa.pub

keys:
    - E:\.ssh\id_rsa

folders:
    - map: ../laravel-cms
      to: /home/vagrant/code

sites:
    - map: cms.test
      to: /home/vagrant/code/cms/public
    - map: voting-app.test
      to: /home/vagrant/code/voting-app/public

databases:
    - homestead

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

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

How can I fix these two problems?

Kasra GH
  • 157
  • 2
  • 5
  • 22

1 Answers1

0

You have to destroy your vagrant machine before moving it.

But let it where it is now and run vagrant destroy --force. If this does not work open VirtualBox (GUI for your virtual machine) and remove the virtual machine from there. Then try a vagrant up.

Another way to destroy a vagrant machine:

vagrant global-status

There you'll get a list of all your vagrant machines. Those have an id, you have to copy this id and run vagrant destroy <id> --force. Then again vagrant up, which will create a new virtual machine with the correct path.

Andrei Todorut
  • 4,260
  • 2
  • 17
  • 28