Configuring Shared Folders

Steps to Configuring Shared Folders in Laravel Homestead:

  1. Run init.bat command from the Homestead directory to create the Homestead.yaml configuration file.

init.bat
Run init.bat command from the Homestead directory.
  1. Run code . command from the Homestead directory to open the repository in VS Code.

  1. Select Homestead.yaml file to display configuration.

  1. Update the folders: configuration with the below configuration:

  1. Create a directory/folder mapping to share your Laravel project/code between your host and Homestead guest machine. In this example, I mapped the C:\code folder to the /home/vagrant/code folder in the Homestead virtual machine.

  1. Update the sites: configuration, by adding your project name.

In this example, we named the project mylaravelapp which will be discussed in detail in Creating a Laravel project in Homestead.

  1. Your Homestead.yaml configuration will look like this:

  1. Save the changes to the Homestead.yaml file and exit.

  2. You need to install the vagrant-winnfsd plugin for type: "nfs" configuration by running the following command in your terminal:

  1. This required restarting the computer after the installation.

That's it! You have successfully configured shared folders in Laravel Homestead on a Windows machine.

In the next topic, we will generate SSH Keys. SSH keys are a pair of cryptographic keys (a public key and a private key) that can be used to authenticate with remote servers or services, without the need for a password.

Last updated