ILikeTurtles
ILikeTurtles

Reputation: 1022

How to config synced folder with nfs in vagrant

config.vm.synced_folder configuration["projects-folder"],
    "/var/www/projects", create: true, group: "www-data",
    owner: "www-data", :mount_options => ["dmode=777","fmode=666"]

config.vm.synced_folder "./localhost", "/var/www/localhost",
    create: true, group: "www-data", owner: "www-data",
    :mount_options => ["dmode=777","fmode=666"]

My configuration file looks like above. If I wanted to use nfs for these folders, would I do that inside the mount options? Just add nfs=true inside mount options?

Upvotes: 0

Views: 2496

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53713

You need to set the type as nfs - see https://www.vagrantup.com/docs/synced-folders/nfs.html#enabling-nfs-synced-folders

config.vm.synced_folder "./localhost", "/var/www/localhost", type: "nfs"
    create: true, group: "www-data", owner: "www-data",
    :mount_options => ["dmode=777","fmode=666"]

Upvotes: 1

Related Questions