Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1392 from oxyc/issue-1375
Browse files Browse the repository at this point in the history
Issue #1375: Allow /vagrant synced folder to be overridden
  • Loading branch information
geerlingguy committed May 31, 2017
2 parents ee8eaaf + d10662f commit 33b971d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ Vagrant.configure('2') do |config|
config.hostmanager.aliases = aliases
end

# Sync the project root directory to /vagrant
unless vconfig['vagrant_synced_folders'].any? { |synced_folder| synced_folder['destination'] == '/vagrant' }
vconfig['vagrant_synced_folders'].push(
'local_path' => host_project_dir,
'destination' => '/vagrant'
)
end

# Synced folders.
vconfig['vagrant_synced_folders'].each do |synced_folder|
options = {
Expand All @@ -91,9 +99,6 @@ Vagrant.configure('2') do |config|
config.vm.synced_folder synced_folder.fetch('local_path'), synced_folder.fetch('destination'), options
end

# Allow override of the default synced folder type.
config.vm.synced_folder host_project_dir, '/vagrant', type: vconfig['vagrant_synced_folder_default_type']

config.vm.provision provisioner do |ansible|
ansible.playbook = playbook
ansible.extra_vars = {
Expand Down
24 changes: 24 additions & 0 deletions docs/getting-started/installation-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ If encryption is not the issue then it's likely that either NFS isn't running co

After attempting any of the above fixes, run `vagrant reload --provision` to restart the VM and attempt mounting the synced folder again, or `vagrant destroy -f && vagrant up` to rebuild the VM from scratch.

### NFS shares are slow or hang due to UDP protocol

If the default transport protocol UDP is causing slowness or failures to mount NFS shared folders, you can switch to NFSv4 and TCP by configuring your `vagrant_synced_folders` like the example below:

```
vagrant_synced_folders:
# The default share.
- local_path: .
destination: /var/www/drupalvm
type: nfs
create: true
options_override:
nfs_version: 4
nfs_udp: false
# Manually specify the /vagrant share to override the defaults
- local_path: .
destination: /vagrant
type: nfs
options_override:
nfs_version: 4
nfs_udp: false
```

## Intel VT-x virtualization support

On some laptops, Intel VT-x virtualization (which is built into most modern Intel processors) is enabled by default. This allows VirtualBox to run virtual machines efficiently using the CPU itself instead of software CPU emulation. If you get a message like "VT-x is disabled in the bios for both all cpu modes" or something similar, you may need to enter your computer's BIOS or UEFI settings and enable this virtualization support.

0 comments on commit 33b971d

Please sign in to comment.