Nabil Kadimi February 2016

Vagrant - How to use nfs for all synced folders?

I want to instruct Vagrant (through Vagrantfile) to use nfs for all synced_folder declared.

I guess it will be something like this:

vm.synced_folder.each do ...
    ... use nfs
end

But I don't know ruby's syntax.


Now experimenting with:

  # Use nfs for better performance
  config.vm.synced_folder.each do |id, options|
    if ! options[:type]
      options[:type] = "nfs"
    end
  end

Answers


Frédéric Henri February 2016

One thing you can try is to declare all the sync folder you want to make and then loop through that - something like

sharedfolderlist = {
  "/folder_vm_1" => "folder_from_host/",
  "/folder_vm_1" => "/can_be_full_path_folder_from_host/",
}

sharedfolder.each do |vm, host|
  config.vm.synced_folder host, vm, nfs: true
end

Its not brilliant but could do the job.

Post Status

Asked in February 2016
Viewed 1,734 times
Voted 9
Answered 1 times

Search




Leave an answer