Vagrant Up and annoying NFS password asking












14















Sorry for the language mistakes I've made.
I'm trying to prevent vagrant asking the password when it mounts shared folders by NFS:



 [server] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for timur: #!!!


I've red many online resources like github and other author's posts, but nothing work for me...



I tried the instructions was found here. I don't have deep cli working knowledge. So could anybody give correct solution for my problem?










share|improve this question

























  • Could I kindly request to have the accepted answer now that this has been covered in the Vagrant docs?

    – Taytay
    Nov 2 '16 at 19:20











  • First of all you need to check Is service nfs-server installed on your machine.

    – Gambit
    Dec 4 '18 at 10:50
















14















Sorry for the language mistakes I've made.
I'm trying to prevent vagrant asking the password when it mounts shared folders by NFS:



 [server] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for timur: #!!!


I've red many online resources like github and other author's posts, but nothing work for me...



I tried the instructions was found here. I don't have deep cli working knowledge. So could anybody give correct solution for my problem?










share|improve this question

























  • Could I kindly request to have the accepted answer now that this has been covered in the Vagrant docs?

    – Taytay
    Nov 2 '16 at 19:20











  • First of all you need to check Is service nfs-server installed on your machine.

    – Gambit
    Dec 4 '18 at 10:50














14












14








14


9






Sorry for the language mistakes I've made.
I'm trying to prevent vagrant asking the password when it mounts shared folders by NFS:



 [server] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for timur: #!!!


I've red many online resources like github and other author's posts, but nothing work for me...



I tried the instructions was found here. I don't have deep cli working knowledge. So could anybody give correct solution for my problem?










share|improve this question
















Sorry for the language mistakes I've made.
I'm trying to prevent vagrant asking the password when it mounts shared folders by NFS:



 [server] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for timur: #!!!


I've red many online resources like github and other author's posts, but nothing work for me...



I tried the instructions was found here. I don't have deep cli working knowledge. So could anybody give correct solution for my problem?







command-line virtualbox sudo nfs vagrant






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 29 '14 at 11:17







Timur Fayzrakhmanov

















asked Jan 29 '14 at 10:39









Timur FayzrakhmanovTimur Fayzrakhmanov

17.5k81934




17.5k81934













  • Could I kindly request to have the accepted answer now that this has been covered in the Vagrant docs?

    – Taytay
    Nov 2 '16 at 19:20











  • First of all you need to check Is service nfs-server installed on your machine.

    – Gambit
    Dec 4 '18 at 10:50



















  • Could I kindly request to have the accepted answer now that this has been covered in the Vagrant docs?

    – Taytay
    Nov 2 '16 at 19:20











  • First of all you need to check Is service nfs-server installed on your machine.

    – Gambit
    Dec 4 '18 at 10:50

















Could I kindly request to have the accepted answer now that this has been covered in the Vagrant docs?

– Taytay
Nov 2 '16 at 19:20





Could I kindly request to have the accepted answer now that this has been covered in the Vagrant docs?

– Taytay
Nov 2 '16 at 19:20













First of all you need to check Is service nfs-server installed on your machine.

– Gambit
Dec 4 '18 at 10:50





First of all you need to check Is service nfs-server installed on your machine.

– Gambit
Dec 4 '18 at 10:50










5 Answers
5






active

oldest

votes


















30














The official Vagrant docs now cover this:
https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement



You need to add entries to the /etc/sudoers file, and the way to edit that is to type this at the terminal: sudo visudo



Type your password, and you're editing the file.
You'll want to paste these lines below (depending on whether you are running Vagrant on OS X or Linux.



If you're not familiar with vim, which it opens in, this page helped. Basically, copy the appropriate block of text below. Then, in visudo, go to the spot you want to paste text into the file (the end of the file is fine), and hit "i" to go into insert mode. CMD+V to paste your text. Then, hit ESC, then type :w to save your changes and then :q to quit.



As of version 1.7.3, the sudoers file in OS X should have these entries:



Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE


And Linux should have these entries:



Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0:0 /tmp/*
Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY


Note that these change from one version of Vagrant to another, so the above might be outdated. The important thing is that the docs now cover it.






share|improve this answer


























  • Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

    – Tgr
    Sep 21 '16 at 22:40






  • 1





    Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

    – Emil Vikström
    Sep 6 '17 at 8:18






  • 1





    This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

    – Petr Cibulka
    Dec 10 '17 at 11:47



















2














The exact commands can change between Vagrant versions, so it's impossible to list ones that would always work.



Anyway, the sudoers rules in this gist should be still quite close. Check out /var/log/auth.log if it reveals the actual commands for your Vagrant version and adapt the rules accordingly.






share|improve this answer
























  • Thanks, but I tried this solution a long ago - it is doesn't work for me.

    – Timur Fayzrakhmanov
    Feb 7 '14 at 6:06



















2














For anyone doing this for OSX (I'm on MacOS Sierra Version 10.12.6) I had a hard time with permissions even after adding those lines. This post really helped:



https://github.com/cogitatio/vagrant-hostsupdater/issues/50


Basicly its the fact that you dont have permissions set for the that folder yourself. So you need to run:



sudo chmod +a "$USER allow write,append" /etc/hosts





share|improve this answer































    0














    adding , nfs_export: false at the end of the config.vm.synced_folder-lines in the Vagrantfile, solved it for me.



    If you already have a working nfs-config, and don't need your Vagrant to overwrite it each time you start, then you can just disable the writing to the export-file.



    This also solves the collision problem, if you have more then one Vagrant trying to access the same folder, as for example have 2 almost identical Vagrants, one running php 5.6 and one running php 7.2.






    share|improve this answer































      0














      TL&DR: Add the following override.vm.synced_folder ".", "/vagrant", disabled: true



      Rational: By default the Vagrant tries to detect any NFS / SMB folders. While I can understand why the developers added this feature, for my use-case this is very annoying. The solution is to simply DISABLE NFS folder syncing.



      This can be done by overriding the VM synced folder option. I have attached the following config for digital ocean for your consideration, so you can see the entire configuration.



       config.vm.define "droplet1" do |config|
      config.vm.provider :digital_ocean do |provider, override|
      override.vm.synced_folder ".", "/vagrant", disabled: true
      override.ssh.private_key_path = '~/.ssh/id_rsa'
      override.vm.box = 'digital_ocean'=
      override.vm.box_url = "https://github.com/devopsgroup-io/vagrant-
      digitalocean/raw/master/box/digital_ocean.box"
      override.nfs.functional = false
      provider.image = 'ubuntu-14-04-x64'
      provider.region = 'nyc1'
      provider.size = '512mb'
      end
      end
      end





      share|improve this answer
























      • Gotta love "TL&DR" people! Cheers.

        – Luis Milanese
        Feb 19 at 20:15






      • 1





        Thanks! Don't forget to upvote ;)

        – FlyingV
        Feb 19 at 21:19











      • Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

        – Luis Milanese
        Feb 20 at 18:18











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f412525%2fvagrant-up-and-annoying-nfs-password-asking%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      30














      The official Vagrant docs now cover this:
      https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement



      You need to add entries to the /etc/sudoers file, and the way to edit that is to type this at the terminal: sudo visudo



      Type your password, and you're editing the file.
      You'll want to paste these lines below (depending on whether you are running Vagrant on OS X or Linux.



      If you're not familiar with vim, which it opens in, this page helped. Basically, copy the appropriate block of text below. Then, in visudo, go to the spot you want to paste text into the file (the end of the file is fine), and hit "i" to go into insert mode. CMD+V to paste your text. Then, hit ESC, then type :w to save your changes and then :q to quit.



      As of version 1.7.3, the sudoers file in OS X should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
      Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
      Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
      %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE


      And Linux should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0:0 /tmp/*
      Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
      Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
      Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
      Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
      %sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY


      Note that these change from one version of Vagrant to another, so the above might be outdated. The important thing is that the docs now cover it.






      share|improve this answer


























      • Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

        – Tgr
        Sep 21 '16 at 22:40






      • 1





        Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

        – Emil Vikström
        Sep 6 '17 at 8:18






      • 1





        This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

        – Petr Cibulka
        Dec 10 '17 at 11:47
















      30














      The official Vagrant docs now cover this:
      https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement



      You need to add entries to the /etc/sudoers file, and the way to edit that is to type this at the terminal: sudo visudo



      Type your password, and you're editing the file.
      You'll want to paste these lines below (depending on whether you are running Vagrant on OS X or Linux.



      If you're not familiar with vim, which it opens in, this page helped. Basically, copy the appropriate block of text below. Then, in visudo, go to the spot you want to paste text into the file (the end of the file is fine), and hit "i" to go into insert mode. CMD+V to paste your text. Then, hit ESC, then type :w to save your changes and then :q to quit.



      As of version 1.7.3, the sudoers file in OS X should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
      Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
      Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
      %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE


      And Linux should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0:0 /tmp/*
      Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
      Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
      Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
      Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
      %sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY


      Note that these change from one version of Vagrant to another, so the above might be outdated. The important thing is that the docs now cover it.






      share|improve this answer


























      • Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

        – Tgr
        Sep 21 '16 at 22:40






      • 1





        Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

        – Emil Vikström
        Sep 6 '17 at 8:18






      • 1





        This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

        – Petr Cibulka
        Dec 10 '17 at 11:47














      30












      30








      30







      The official Vagrant docs now cover this:
      https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement



      You need to add entries to the /etc/sudoers file, and the way to edit that is to type this at the terminal: sudo visudo



      Type your password, and you're editing the file.
      You'll want to paste these lines below (depending on whether you are running Vagrant on OS X or Linux.



      If you're not familiar with vim, which it opens in, this page helped. Basically, copy the appropriate block of text below. Then, in visudo, go to the spot you want to paste text into the file (the end of the file is fine), and hit "i" to go into insert mode. CMD+V to paste your text. Then, hit ESC, then type :w to save your changes and then :q to quit.



      As of version 1.7.3, the sudoers file in OS X should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
      Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
      Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
      %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE


      And Linux should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0:0 /tmp/*
      Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
      Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
      Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
      Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
      %sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY


      Note that these change from one version of Vagrant to another, so the above might be outdated. The important thing is that the docs now cover it.






      share|improve this answer















      The official Vagrant docs now cover this:
      https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement



      You need to add entries to the /etc/sudoers file, and the way to edit that is to type this at the terminal: sudo visudo



      Type your password, and you're editing the file.
      You'll want to paste these lines below (depending on whether you are running Vagrant on OS X or Linux.



      If you're not familiar with vim, which it opens in, this page helped. Basically, copy the appropriate block of text below. Then, in visudo, go to the spot you want to paste text into the file (the end of the file is fine), and hit "i" to go into insert mode. CMD+V to paste your text. Then, hit ESC, then type :w to save your changes and then :q to quit.



      As of version 1.7.3, the sudoers file in OS X should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
      Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
      Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
      %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE


      And Linux should have these entries:



      Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0:0 /tmp/*
      Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
      Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
      Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
      Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
      %sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY


      Note that these change from one version of Vagrant to another, so the above might be outdated. The important thing is that the docs now cover it.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 18 '17 at 14:15









      Davіd

      1036




      1036










      answered Sep 3 '14 at 22:57









      TaytayTaytay

      42647




      42647













      • Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

        – Tgr
        Sep 21 '16 at 22:40






      • 1





        Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

        – Emil Vikström
        Sep 6 '17 at 8:18






      • 1





        This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

        – Petr Cibulka
        Dec 10 '17 at 11:47



















      • Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

        – Tgr
        Sep 21 '16 at 22:40






      • 1





        Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

        – Emil Vikström
        Sep 6 '17 at 8:18






      • 1





        This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

        – Petr Cibulka
        Dec 10 '17 at 11:47

















      Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

      – Tgr
      Sep 21 '16 at 22:40





      Weirdly this is not working for me, even though /var/log/auth.log only contains commands which are listed there and I can manually verify that the sudo permissions are working.

      – Tgr
      Sep 21 '16 at 22:40




      1




      1





      Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

      – Emil Vikström
      Sep 6 '17 at 8:18





      Instead of editting the main sudoers file I recommend adding this as a new file in /etc/sudoers.d to avoid future conflicts when updating the OS. On Ubuntu: sudo visudo -f /etc/sudoers.d/vagrant-nfs or OSX: sudo visudo -f /private/etc/sudoers.d/vagrant-nfs

      – Emil Vikström
      Sep 6 '17 at 8:18




      1




      1





      This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

      – Petr Cibulka
      Dec 10 '17 at 11:47





      This helped, thank you! Just a quick comment to your advice to get around vim editor: Just open visudo with sudo EDITOR=nano visudo command, which allows you to bypass vim completely.

      – Petr Cibulka
      Dec 10 '17 at 11:47













      2














      The exact commands can change between Vagrant versions, so it's impossible to list ones that would always work.



      Anyway, the sudoers rules in this gist should be still quite close. Check out /var/log/auth.log if it reveals the actual commands for your Vagrant version and adapt the rules accordingly.






      share|improve this answer
























      • Thanks, but I tried this solution a long ago - it is doesn't work for me.

        – Timur Fayzrakhmanov
        Feb 7 '14 at 6:06
















      2














      The exact commands can change between Vagrant versions, so it's impossible to list ones that would always work.



      Anyway, the sudoers rules in this gist should be still quite close. Check out /var/log/auth.log if it reveals the actual commands for your Vagrant version and adapt the rules accordingly.






      share|improve this answer
























      • Thanks, but I tried this solution a long ago - it is doesn't work for me.

        – Timur Fayzrakhmanov
        Feb 7 '14 at 6:06














      2












      2








      2







      The exact commands can change between Vagrant versions, so it's impossible to list ones that would always work.



      Anyway, the sudoers rules in this gist should be still quite close. Check out /var/log/auth.log if it reveals the actual commands for your Vagrant version and adapt the rules accordingly.






      share|improve this answer













      The exact commands can change between Vagrant versions, so it's impossible to list ones that would always work.



      Anyway, the sudoers rules in this gist should be still quite close. Check out /var/log/auth.log if it reveals the actual commands for your Vagrant version and adapt the rules accordingly.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Feb 5 '14 at 21:31









      tmatilaitmatilai

      1514




      1514













      • Thanks, but I tried this solution a long ago - it is doesn't work for me.

        – Timur Fayzrakhmanov
        Feb 7 '14 at 6:06



















      • Thanks, but I tried this solution a long ago - it is doesn't work for me.

        – Timur Fayzrakhmanov
        Feb 7 '14 at 6:06

















      Thanks, but I tried this solution a long ago - it is doesn't work for me.

      – Timur Fayzrakhmanov
      Feb 7 '14 at 6:06





      Thanks, but I tried this solution a long ago - it is doesn't work for me.

      – Timur Fayzrakhmanov
      Feb 7 '14 at 6:06











      2














      For anyone doing this for OSX (I'm on MacOS Sierra Version 10.12.6) I had a hard time with permissions even after adding those lines. This post really helped:



      https://github.com/cogitatio/vagrant-hostsupdater/issues/50


      Basicly its the fact that you dont have permissions set for the that folder yourself. So you need to run:



      sudo chmod +a "$USER allow write,append" /etc/hosts





      share|improve this answer




























        2














        For anyone doing this for OSX (I'm on MacOS Sierra Version 10.12.6) I had a hard time with permissions even after adding those lines. This post really helped:



        https://github.com/cogitatio/vagrant-hostsupdater/issues/50


        Basicly its the fact that you dont have permissions set for the that folder yourself. So you need to run:



        sudo chmod +a "$USER allow write,append" /etc/hosts





        share|improve this answer


























          2












          2








          2







          For anyone doing this for OSX (I'm on MacOS Sierra Version 10.12.6) I had a hard time with permissions even after adding those lines. This post really helped:



          https://github.com/cogitatio/vagrant-hostsupdater/issues/50


          Basicly its the fact that you dont have permissions set for the that folder yourself. So you need to run:



          sudo chmod +a "$USER allow write,append" /etc/hosts





          share|improve this answer













          For anyone doing this for OSX (I'm on MacOS Sierra Version 10.12.6) I had a hard time with permissions even after adding those lines. This post really helped:



          https://github.com/cogitatio/vagrant-hostsupdater/issues/50


          Basicly its the fact that you dont have permissions set for the that folder yourself. So you need to run:



          sudo chmod +a "$USER allow write,append" /etc/hosts






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 11 '17 at 21:02









          Ruben ArevaloRuben Arevalo

          211




          211























              0














              adding , nfs_export: false at the end of the config.vm.synced_folder-lines in the Vagrantfile, solved it for me.



              If you already have a working nfs-config, and don't need your Vagrant to overwrite it each time you start, then you can just disable the writing to the export-file.



              This also solves the collision problem, if you have more then one Vagrant trying to access the same folder, as for example have 2 almost identical Vagrants, one running php 5.6 and one running php 7.2.






              share|improve this answer




























                0














                adding , nfs_export: false at the end of the config.vm.synced_folder-lines in the Vagrantfile, solved it for me.



                If you already have a working nfs-config, and don't need your Vagrant to overwrite it each time you start, then you can just disable the writing to the export-file.



                This also solves the collision problem, if you have more then one Vagrant trying to access the same folder, as for example have 2 almost identical Vagrants, one running php 5.6 and one running php 7.2.






                share|improve this answer


























                  0












                  0








                  0







                  adding , nfs_export: false at the end of the config.vm.synced_folder-lines in the Vagrantfile, solved it for me.



                  If you already have a working nfs-config, and don't need your Vagrant to overwrite it each time you start, then you can just disable the writing to the export-file.



                  This also solves the collision problem, if you have more then one Vagrant trying to access the same folder, as for example have 2 almost identical Vagrants, one running php 5.6 and one running php 7.2.






                  share|improve this answer













                  adding , nfs_export: false at the end of the config.vm.synced_folder-lines in the Vagrantfile, solved it for me.



                  If you already have a working nfs-config, and don't need your Vagrant to overwrite it each time you start, then you can just disable the writing to the export-file.



                  This also solves the collision problem, if you have more then one Vagrant trying to access the same folder, as for example have 2 almost identical Vagrants, one running php 5.6 and one running php 7.2.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 11 '18 at 8:45









                  Puggan SePuggan Se

                  773714




                  773714























                      0














                      TL&DR: Add the following override.vm.synced_folder ".", "/vagrant", disabled: true



                      Rational: By default the Vagrant tries to detect any NFS / SMB folders. While I can understand why the developers added this feature, for my use-case this is very annoying. The solution is to simply DISABLE NFS folder syncing.



                      This can be done by overriding the VM synced folder option. I have attached the following config for digital ocean for your consideration, so you can see the entire configuration.



                       config.vm.define "droplet1" do |config|
                      config.vm.provider :digital_ocean do |provider, override|
                      override.vm.synced_folder ".", "/vagrant", disabled: true
                      override.ssh.private_key_path = '~/.ssh/id_rsa'
                      override.vm.box = 'digital_ocean'=
                      override.vm.box_url = "https://github.com/devopsgroup-io/vagrant-
                      digitalocean/raw/master/box/digital_ocean.box"
                      override.nfs.functional = false
                      provider.image = 'ubuntu-14-04-x64'
                      provider.region = 'nyc1'
                      provider.size = '512mb'
                      end
                      end
                      end





                      share|improve this answer
























                      • Gotta love "TL&DR" people! Cheers.

                        – Luis Milanese
                        Feb 19 at 20:15






                      • 1





                        Thanks! Don't forget to upvote ;)

                        – FlyingV
                        Feb 19 at 21:19











                      • Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

                        – Luis Milanese
                        Feb 20 at 18:18
















                      0














                      TL&DR: Add the following override.vm.synced_folder ".", "/vagrant", disabled: true



                      Rational: By default the Vagrant tries to detect any NFS / SMB folders. While I can understand why the developers added this feature, for my use-case this is very annoying. The solution is to simply DISABLE NFS folder syncing.



                      This can be done by overriding the VM synced folder option. I have attached the following config for digital ocean for your consideration, so you can see the entire configuration.



                       config.vm.define "droplet1" do |config|
                      config.vm.provider :digital_ocean do |provider, override|
                      override.vm.synced_folder ".", "/vagrant", disabled: true
                      override.ssh.private_key_path = '~/.ssh/id_rsa'
                      override.vm.box = 'digital_ocean'=
                      override.vm.box_url = "https://github.com/devopsgroup-io/vagrant-
                      digitalocean/raw/master/box/digital_ocean.box"
                      override.nfs.functional = false
                      provider.image = 'ubuntu-14-04-x64'
                      provider.region = 'nyc1'
                      provider.size = '512mb'
                      end
                      end
                      end





                      share|improve this answer
























                      • Gotta love "TL&DR" people! Cheers.

                        – Luis Milanese
                        Feb 19 at 20:15






                      • 1





                        Thanks! Don't forget to upvote ;)

                        – FlyingV
                        Feb 19 at 21:19











                      • Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

                        – Luis Milanese
                        Feb 20 at 18:18














                      0












                      0








                      0







                      TL&DR: Add the following override.vm.synced_folder ".", "/vagrant", disabled: true



                      Rational: By default the Vagrant tries to detect any NFS / SMB folders. While I can understand why the developers added this feature, for my use-case this is very annoying. The solution is to simply DISABLE NFS folder syncing.



                      This can be done by overriding the VM synced folder option. I have attached the following config for digital ocean for your consideration, so you can see the entire configuration.



                       config.vm.define "droplet1" do |config|
                      config.vm.provider :digital_ocean do |provider, override|
                      override.vm.synced_folder ".", "/vagrant", disabled: true
                      override.ssh.private_key_path = '~/.ssh/id_rsa'
                      override.vm.box = 'digital_ocean'=
                      override.vm.box_url = "https://github.com/devopsgroup-io/vagrant-
                      digitalocean/raw/master/box/digital_ocean.box"
                      override.nfs.functional = false
                      provider.image = 'ubuntu-14-04-x64'
                      provider.region = 'nyc1'
                      provider.size = '512mb'
                      end
                      end
                      end





                      share|improve this answer













                      TL&DR: Add the following override.vm.synced_folder ".", "/vagrant", disabled: true



                      Rational: By default the Vagrant tries to detect any NFS / SMB folders. While I can understand why the developers added this feature, for my use-case this is very annoying. The solution is to simply DISABLE NFS folder syncing.



                      This can be done by overriding the VM synced folder option. I have attached the following config for digital ocean for your consideration, so you can see the entire configuration.



                       config.vm.define "droplet1" do |config|
                      config.vm.provider :digital_ocean do |provider, override|
                      override.vm.synced_folder ".", "/vagrant", disabled: true
                      override.ssh.private_key_path = '~/.ssh/id_rsa'
                      override.vm.box = 'digital_ocean'=
                      override.vm.box_url = "https://github.com/devopsgroup-io/vagrant-
                      digitalocean/raw/master/box/digital_ocean.box"
                      override.nfs.functional = false
                      provider.image = 'ubuntu-14-04-x64'
                      provider.region = 'nyc1'
                      provider.size = '512mb'
                      end
                      end
                      end






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 27 at 19:56









                      FlyingVFlyingV

                      1011




                      1011













                      • Gotta love "TL&DR" people! Cheers.

                        – Luis Milanese
                        Feb 19 at 20:15






                      • 1





                        Thanks! Don't forget to upvote ;)

                        – FlyingV
                        Feb 19 at 21:19











                      • Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

                        – Luis Milanese
                        Feb 20 at 18:18



















                      • Gotta love "TL&DR" people! Cheers.

                        – Luis Milanese
                        Feb 19 at 20:15






                      • 1





                        Thanks! Don't forget to upvote ;)

                        – FlyingV
                        Feb 19 at 21:19











                      • Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

                        – Luis Milanese
                        Feb 20 at 18:18

















                      Gotta love "TL&DR" people! Cheers.

                      – Luis Milanese
                      Feb 19 at 20:15





                      Gotta love "TL&DR" people! Cheers.

                      – Luis Milanese
                      Feb 19 at 20:15




                      1




                      1





                      Thanks! Don't forget to upvote ;)

                      – FlyingV
                      Feb 19 at 21:19





                      Thanks! Don't forget to upvote ;)

                      – FlyingV
                      Feb 19 at 21:19













                      Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

                      – Luis Milanese
                      Feb 20 at 18:18





                      Because of your "TL&DR" you deserve all the upvotes one can get, but truth is your answer didn't help me. Not because it's not good, but the problem I was having was slightly different from what was asked in the first place. Still, thank you for you good attitude. :)

                      – Luis Milanese
                      Feb 20 at 18:18


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f412525%2fvagrant-up-and-annoying-nfs-password-asking%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                      ComboBox Display Member on multiple fields

                      Is it possible to collect Nectar points via Trainline?