By default vagrant mounts the host folder to /vagrant directory of the Virtual machine where you have the vagrantfile. This allows us to share files and codebase to the virtual machine without dealing with file transfer utilities or SCP command.
But you might face error sometimes that it does not mount the host directory to the vagrant folder. This happens mostly due to os update. To resolve this follow the steps given below.
Step 1: Shh into the vagrant box.
1 |
<code class="lang-bash"><code class="lang-bash">vagrant ssh</code></code> |
step 2: execute the following command.
1 |
<code class="lang-bash"><code class="lang-bash">sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions</code></code> |
Step 3: Exit from VM
1 |
<code class="lang-bash"><code class="lang-bash">exit</code></code> |
Step 3: Reload the configuration using the following command.
1 |
<code class="lang-bash"><code class="lang-bash">vagrant reload</code></code> |
That’s it! Now the vagrant folder will be mounted to the host folder.
If the problem is not solved using slotion1, you should try the steps given below.
Step1: execute the following command.
1 |
<code class="lang-bash">cd /opt/VBoxGuestAdditions-*/init </code> |
Step 2: Setup VBoxGuestAdditions
1 |
<code class="lang-bash">sudo ./vboxadd setup</code> |
Step 3: Exit VM
1 |
exit |
Step 4: Reload VM
1 |
vagrant reload |
Now ssh into the VM and try accessing /vagrant.
The Best Tutorials & Tips to Speedup Your DevOps Workflow.
Created by Bibin Wilson.