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 · 76 comments

Comments

@chakming
Copy link

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

This comment has been minimized.

Copy link

commented May 25, 2013

+1 I am having exactly the same problem here

@bezelga

This comment has been minimized.

Copy link

commented May 25, 2013

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

@chakming

This comment has been minimized.

Copy link
Author

commented May 26, 2013

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

@ghost

This comment has been minimized.

Copy link

commented May 27, 2013

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

@hdalgrav

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Author

commented Jun 1, 2013

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

@mjackson

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jun 20, 2013

Same issue here.

@sentience

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jun 20, 2013

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

@mjackson

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 9, 2013

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

@kayzee

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 10, 2013

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

@dieterve dieterve referenced this issue Jul 11, 2013

Closed

NFS mount error #17

@mitchellh

This comment has been minimized.

Copy link
Member

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.

@mitchellh mitchellh closed this Jul 20, 2013

@mdepuy

This comment has been minimized.

Copy link

commented Jul 29, 2013

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

@atipugin

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 16, 2013

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

@benjifisher

This comment has been minimized.

Copy link

commented Jan 16, 2015

@parfienczyk : Your solution worked for me. I halted all running VM's, ran "sudo ifconfig ... down" for all the vboxnet networks, and "vagrant up" worked. Previously, I rebooted my host machine, as suggested by @sentience , but I did not like that solution.

@timhtheos

This comment has been minimized.

Copy link

commented Mar 4, 2015

Been to https://github.com/mikebell/drupaldev-nginx/issues/18 that points me to this page. Yep, my host file has been jacked up. Fixing it up solves the problem. Thanks.

@leoj3n

This comment has been minimized.

Copy link

commented Mar 4, 2015

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

@jamime

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 10, 2015

restarting my machine helped ...

@tonystar

This comment has been minimized.

Copy link

commented Aug 5, 2015

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

@dadasoz-cuelogic

This comment has been minimized.

Copy link

commented Oct 27, 2015

Try -

VAGRANT_USE_VBOXFS=true vagrant up

@ducnguyenhuy-agilityio

This comment has been minimized.

Copy link

commented Feb 27, 2016

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

@dgpro

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Mar 21, 2016

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

@erikaheidi

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

@Beerusm

This comment has been minimized.

Copy link

commented Nov 13, 2016

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

@lightster

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Mar 7, 2017

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

#5424 (comment)

@chadfurman

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.