Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFS mount error: v1.2.2 #1744

Closed
chakming opened this issue May 19, 2013 · 77 comments
Closed

NFS mount error: v1.2.2 #1744

chakming opened this issue May 19, 2013 · 77 comments

Comments

@chakming
Copy link

chakming commented May 19, 2013

I've tried:

  1. fix sudoers issue by setting: vagrant no password + Default !requiretty in VM
  2. install nfs-common in VM
  3. install virtual box guest addition (using vagrant-vbguest) in VM
  4. ensure localMachine having installed nfsd
  5. check /etc/exports and it shows correct settings

but the nfs issue still comes:

mount -o vers=3 192.168.62.1:'/Users/example/Documents/example/example.lamp/example.com' /var/www
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3 192.168.62.1:'/Users/example/Documents/example/example.lamp/example.com' /var/www

Environment:
OS X 10.8.3
vagrant 1.2.2
Virtualbox: 4.2.12 r84980

Vagrantfile + /etc/sudoers in guest + /etc/exports in my mac + vagrant DEBUG log:
https://gist.github.com/chakming/0d955ee0ef698f1b2a48

@bezelga
Copy link

bezelga commented May 25, 2013

+1 I am having exactly the same problem here

@bezelga
Copy link

bezelga commented May 25, 2013

@chakming do you think this is related to 1.2.2? using 1.2.1 works?

@chakming
Copy link
Author

chakming commented May 26, 2013

i've tried downgrade vagrant but seems having the same problem.

@ghost
Copy link

ghost commented May 27, 2013

Same issue with 1.2.2 but not with 1.2.1 (Mac OS 10.8)

@hdalgrav
Copy link

hdalgrav commented May 29, 2013

@chakming Had the same problem and the exact same setup (OS X 10.8.3, Vagrant 1.2.2 VBox 4.2.12 r84980).

By simply adding a trailing slash i was able to get it to work.
So for me the line in the Vagrantfile looks like this:
config.vm.synced_folder "/Users/test/webapp/", "/var/www/", id: "vagrant-root" , :nfs => true

@chakming
Copy link
Author

chakming commented May 30, 2013

@hdalgrav Thanks for the reply.

The trailing slash doesn't work for me and shows following error:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3 192.168.66.1:'/Users/example/Documents/example/example.lamp/web' /var/www

@hdalgrav
Copy link

hdalgrav commented May 31, 2013

It doenst look like you have inserted the trailing slash after your pathname, or maybe it is Vagrant stripping them out, but that would be weird since i am able to reproduce the error by simply removing my trailing slashes.

@chakming
Copy link
Author

chakming commented Jun 1, 2013

@hdalgrav nope i did. but the error didn't have the trailing slash lol

@mjackson
Copy link

mjackson commented Jun 6, 2013

I'm getting the same error. Running Mac OSX 10.8.4, Vagrant 1.2.2, and VirtualBox 4.2.8 r83876.

Digging a bit deeper, it tells me that "the requested NFS version or transport protocol is not supported":

$ vagrant up
...
[couch] Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3 192.168.100.1:'/Users/michael/Projects/mobile' /vagrant
$ vagrant ssh couch
...
vagrant@couch:~$ sudo mount -v -o vers=3 192.168.100.1:'/Users/michael/Projects/mobile' /vagrant
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Thu Jun  6 04:18:31 2013
mount.nfs: trying text-based options 'vers=3,addr=192.168.100.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Program not registered
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Program not registered
mount.nfs: requested NFS version or transport protocol is not supported

On the host:

$ cat /etc/exports
# VAGRANT-BEGIN: bc4a44a2-2d5c-46e7-8978-9f09774d117f
"/Users/michael/Projects/mobile" 192.168.100.1 -mapall=501:20
# VAGRANT-END: bc4a44a2-2d5c-46e7-8978-9f09774d117f

Does nfsd on Mac OSX support version 3? How can we check?

@Bowbaq
Copy link

Bowbaq commented Jun 13, 2013

Same problem here, OSX 10.8.3, Vagrant 1.2.2, Vbox 4.12

The error is:

vagrant@precise64:~$ sudo mount -vvv -o vers=3 10.0.0.1:'/Users/bowbaq/Dropbox/dev/projet/yujia-bowbaq' /var/www/yujia
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: no type was given - I'll assume nfs because of the colon
mount: spec:  "10.0.0.1:/Users/bowbaq/Dropbox/dev/projet/yujia-bowbaq"
mount: node:  "/var/www/yujia"
mount: types: "nfs"
mount: opts:  "vers=3"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "10.0.0.1:/Users/bowbaq/Dropbox/dev/projet/yujia-bowbaq"
mount: external mount: argv[2] = "/var/www/yujia"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,vers=3"
mount.nfs: timeout set for Thu Jun 13 00:20:48 2013
mount.nfs: trying text-based options 'vers=3,addr=10.0.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.0.0.1 prog 100005 vers 3 prot UDP port 54126
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 10.0.0.1:/Users/bowbaq/Dropbox/dev/projet/yujia-bowbaq
# /etc/exports
# VAGRANT-BEGIN: 905bcf70-a146-4273-8e54-73a29c8caa32
"/Users/bowbaq/Dropbox/dev/projet/yujia-bowbaq" 10.0.0.1 -mapall=501:20
# VAGRANT-END: 905bcf70-a146-4273-8e54-73a29c8caa32

@aramonc
Copy link

aramonc commented Jun 13, 2013

Just to add to this since I'm having a similar issue.

I downgraded to 1.1.5 and now I get the following message

[default] Mounting NFS shared folders...
Mounting NFS shared folders failed. This is most often caused by the NFS
client software not being installed on the guest machine. Please verify
that the NFS client software is properly installed, and consult any resources
specific to the linux distro you're using for more information on how to
do this.

@sentience
Copy link

sentience commented Jun 20, 2013

Same issue here.

@sentience
Copy link

sentience commented Jun 20, 2013

Managed to resolve this by rebooting my machine.

OS X 10.8.4, Vagrant 1.2.2, VirtualBox 4.2.12

@mjackson
Copy link

mjackson commented Jun 20, 2013

@sentience When all else fails... ;) Thanks for the tip. Will try this afternoon.

@mjackson
Copy link

mjackson commented Jun 20, 2013

@sentience Hmm, no dice. Can I ask what private_network IP you're using? Maybe that has something to do with it...

@sentience
Copy link

sentience commented Jun 21, 2013

It’s 10.0.0.23. Excerpt from my Vagrantfile:

  config.vm.network :private_network, ip: "10.0.0.23"
  config.vm.network :forwarded_port, guest: 80, host: 8080
  config.vm.network :forwarded_port, guest: 3306, host: 3307
  config.vm.hostname = "myapp-vm"
  config.vm.synced_folder ".", "/home/vagrant/myapp", :nfs => true

@dblessing
Copy link

dblessing commented Jun 21, 2013

Seeing this issue here, too. Restart, downgrade, none of that works. Other tips? Is this an env issue or bug?

@dblessing
Copy link

dblessing commented Jun 21, 2013

Just after posting, I found this. Run this command to check for conflicting exports - sudo nfsd checkexports. Manually removed the conflicting export and reloaded...life is good.

@markeganfuller
Copy link

markeganfuller commented Jul 9, 2013

@bke-drewb 's solution worked for me. For reference exports are stored in /etc/exports

@kayzee
Copy link

kayzee commented Jul 9, 2013

@bke-drewb @markeganfuller thanks for the reference. I commented out the line in the exports file and it still didn't resolve the problem. Was there something more to do?

@markeganfuller
Copy link

markeganfuller commented Jul 9, 2013

@kayzee I removed the line entirely, someone else with the same problem removed the virtualbox machine that it was related to and that worked for them. Beyond that I don't know without further research.

@jmshelby
Copy link

jmshelby commented Jul 10, 2013

I was getting the same problem, for me, it was because I was specifying a symbolic link on my host system, I put in the direct location, all is good.

@markeganfuller
Copy link

markeganfuller commented Jul 10, 2013

Ah yes symlinks are awkward with NFS, best to only use relative symlinks to files within the share.

@mitchellh
Copy link
Member

mitchellh commented Jul 20, 2013

All SORTS of bug fixes that fix many causes of this error are in 1.2.4 and more are coming in 1.2.5. Please try those versions and if the problem persists, then please open another issue with debug level logs.

@mdepuy
Copy link

mdepuy commented Jul 29, 2013

@bke-drewb 's solution worked for me after I restarted my laptop. Thanks everyone.

@atipugin
Copy link

atipugin commented Aug 15, 2013

Same issue here, nfsd's checkexports and restart doesn't make any effect :(

10.8.4, Vagrant 1.2.7, VirtualBox 4.2.16 r86992

@atipugin
Copy link

atipugin commented Aug 16, 2013

Ok, my bad, after installing nfs-common on vm's ubuntu - everything seems to work!

@leoj3n
Copy link

leoj3n commented Mar 4, 2015

Note to self: Disable PF firewall (IceFloor.app)!

@jamime
Copy link

jamime commented Mar 25, 2015

As this is a popular issue for nfs mounts, when receiving the error: mount.nfs: requested NFS version or transport protocol is not supported. It can also be caused by having duplicate network mounts within VirtualBox. For example if a machine has been destroyed incorrectly.

@tgroff
Copy link

tgroff commented Apr 4, 2015

Ubuntu 14.04, being from the land of Linux I don't often think of rebooting, but that's exactly what fixed it - NFS mount worked fine after rebooting! oy!

@ethier
Copy link

ethier commented Apr 8, 2015

Tried everything here, but going back to:

config.vm.network :private_network, type: :dhcp

From a static IP assignment:

config.vm.network :private_network, ip: '172.16.231.130'

... is what did the trick for me.

@jasongabler
Copy link

jasongabler commented Apr 9, 2015

Thank you @thgrendel ! I edit my hosts file many times a day while testing various deployments behind load balancers. It looks like at some point I fouled up the localhost entry from 127.0.0.1 to 27.0.0.1. Fixed that and NFS came back for vagrant.

@mtoigo
Copy link

mtoigo commented Apr 14, 2015

Fixing my /etc/hosts file on my mac fixed this for me too. I had temporarily pointed localhost to somewhere other than 127.0.0.1 and switching it back resolved this.

@setaloro
Copy link

setaloro commented Jun 6, 2015

My problem was, that IP adress was 192.168.100.1
The VM need the end "xxx.xxx.xxx.1"
Changed End IP to another and now works

@j3rrey
Copy link

j3rrey commented Jul 10, 2015

restarting my machine helped ...

@tonystar
Copy link

tonystar commented Aug 5, 2015

Confirming: switching localhost back to 127.0.0.1 in /etc/hosts resolved this.

@dadasoz-cuelogic
Copy link

dadasoz-cuelogic commented Oct 27, 2015

Try -

VAGRANT_USE_VBOXFS=true vagrant up

@ducnguyenhuy-agilityio
Copy link

ducnguyenhuy-agilityio commented Feb 27, 2016

Adding private_network IP into /ect/hosts worked for me. (Mac OSX + Vagrant box running below Ubuntu 14.04)

@dgpro
Copy link

dgpro commented Mar 10, 2016

Similar issue on Windows 7

mount -o 'vers=3,udp,nolock' [removed]:'/C/[removed]' /var/www
Stderr from the command:
mount.nfs: access denied by server while mounting [removed]

Fixed by... restarting PC...

@ronilaukkarinen
Copy link

ronilaukkarinen commented Mar 14, 2016

Emptying /etc/exports fixed this for me, thanks @gnutix. It seems if you have multiple vagrant boxes, there can be conflicts.

@ianoshorty
Copy link

ianoshorty commented Mar 21, 2016

Just chipping in to say @gnutix and @ronilaukkarinen solution worked for me with Roots/Trellis.

@erikaheidi
Copy link

erikaheidi commented Apr 1, 2016

Confirming that this error happens also if you are working on an encrypted home directory on Ubuntu. I moved the project to outside the encrypted home and it worked just fine.

@n0impossible
Copy link

n0impossible commented Apr 13, 2016

I have the same error when running vagrant up

==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o 'actimeo=1' 192.168.2.1:'/Users/n0impossible/Documents/htdocs' /home/vagrant/htdocs

Stdout from the command:

Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

i checked my /etc/hosts file

i127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

see?

i127.0.0.1 localhost

my bad, typo when i edit this file using vi editor

i fixed my /etc/hosts file, do vagrant up and work fine.

--Cheers--

@bartmcleod
Copy link

bartmcleod commented May 23, 2016

Today, I finally realized I had to fix the hosts file on the host machine. Indeed, there was no entry 127.0.0.1 locahost After I added it, nfs worked for me too, however, I am still a bit sceptical, since this error just comes and goes as it pleases.

@vrwired
Copy link

vrwired commented Jul 26, 2016

My issue resolved by changing IP to end in 3 and not 1. I'm not sure if was necessary to empty /etc/exports, but I did that first and then edited the Vagrantfile like so: config.vm.network :private_network, ip: "10.11.12.3" ... vagrant reload --provision then brought mount up

@beerappasm
Copy link

beerappasm commented Nov 13, 2016

Changing vagrant app directory from home to other directory solved the problem. thanks for the Tip!

@lightster
Copy link

lightster commented Nov 30, 2016

Edit: This issue is so sporadic. After rebooting my Mac, my NFS mount won't let files be deleted sometimes. If I edit and save the file from my VM, it saves successfully and then I can delete it.

Outdated
Yet another possibility: If you use an encrypted sparsebundle on macOS as a mounted directory in your Vagrant VM, you may get permission denied errors when writing to the mounted directory (even with root/sudo). I switched to an unencrypted sparsebundle to fix the issue (since my drive is encrypted anyhow).

@tecnocat
Copy link

tecnocat commented Mar 7, 2017

For Mac OS Sierra this solve my day! (Vagrant 1.9.2)

#5424 (comment)

@chadfurman
Copy link

chadfurman commented May 27, 2017

I had a similar problem in Ubuntu, Vagrant version 1.9.3, VB version 5.1.22

The problem was that my host's OS has changed the ifconfig to the ip command, and vboxnet0 did not have an ip address.

I had to run:

ip a add 192.168.33.1/255.255.255.0 dev vboxnet0 before Vagrant could start the NFS share

There were many other things I tried: starting/stopping the firewall (ufw, iptables, both, neither); adding specific rules to the firewall to allow all traffic to this IP; service start for each of nfs-common, nfs-kernel-server, nfs-server, nfs-client; and clearing out my /etc/exports

It wasn't until I made sure my vboxnet0 had an IP on the host machine that everything worked.

@therobyouknow
Copy link

therobyouknow commented Jun 8, 2018

Thank you to @gitis and @erikaheidi regarding moving it out of encrypted home folder - I also found that I was able to move beyond this issue once I did that.

gitis commented on 4 Sep 2014

I moved the project out of the encrypted home folder and it worked. Thank you, @wellingtonlorindo!

erikaheidi commented on 1 Apr 2016

Confirming that this error happens also if you are working on an encrypted home directory on Ubuntu. I moved the project to outside the encrypted home and it worked just fine.

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days . This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests