IDTIMW
IDTIMW

Reputation: 227

Laravel can't map folders with Homestead

I installed Vagrant & Virtual Box, I created a SSH key in the default folder (~/.ssh/) and I followed the documentation to configure Laravel 5 with Homestead.

Vagrant up is working, But the folder is not my configure the location of the file.

My Homestead.yaml setting the folder is ~/Documents/develop to /home, But vagrant up setting is /vagrant to /User/Docuements/Homestead

Can anybody help me to find what's wrong with it?

Here is my configure file Homestead.yaml

ip: "192.168.10.10"
  3 memory: 2048
  4 cpus: 1
  5 provider: virtualbox
  6  
  7 authorize: ~/.ssh/id_rsa.pub
  8  
  9 keys:
 10     - ~/.ssh/id_rsa
 11  
 12 folders:
 13     - map: ~/Documents/develop
 14       to: /home
 15  
 16 sites:
 17     - map: goldenquant.app
 18       to: /home/goldenquant/public
 19     - map: blog.app
 20       to: /home/blog/public
 21  
 22 databases:
 23     - homestead

Here is my terminal running vagrant up results.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: Homestead_default_1468067791872_61342
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/Xing/Documents/Homestead

Upvotes: 1

Views: 828

Answers (2)

ldg
ldg

Reputation: 9402

Did you try running vagrant up --debug? (see docs)

But I can imagine trying to map to /home on the VM could be a problem, try a directory inside /home/vagrant and also use a full path for the local part of the map, e.g.,

folders:
    - map: /Users/Xing/Documents/develop
      to: /home/vagrant/develop

Or similar. I'm sure there are more complete docs somewhere but see this for some working examples.

Upvotes: 0

Ohgodwhy
Ohgodwhy

Reputation: 50798

You can actually disable this functionality by telling Vagrant not to generate the new key pair:

config.ssh.insert_key = false

You can see the PR where this happened here

Upvotes: 0

Related Questions