fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.08k stars 111 forks source link

mount.nfs, access denied by server while mounting #169

Closed vinigfer closed 1 year ago

vinigfer commented 8 years ago

I'm trying to launch a simple VM with vagrant using Vagrant-cachier plugin to cache all packages that are downloaded from the web, but everytime I run vagrant up I get this error:

==> Region1: 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 'rw,vers=3,tcp,nolock' 10.4.128.1:'/home/dellcloud2/.vagrant.d/cache/ubuntu/trusty64' /tmp/vagrant-cache

Stdout from the command:

Stderr from the command:

stdin: is not a tty mount.nfs: access denied by server while mounting 10.4.128.1:/home/dellcloud2/.vagrant.d/cache/ubuntu/trusty64

My host system is ubuntu 14.04 desktop, and my guest is an ubuntu server 14.04. Already installed nfs-kernel-server package on the host, and I'm using virtualBox for virtualization. What can I do to fix this? Below is my Vagrantfile

config.vm.define "Region1" do |region1|
  region1.vm.box = "ubuntu/trusty64"

if Vagrant.has_plugin?("vagrant-cachier")
  # Configure cached packages to be shared between instances of the same base box.
  # More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
  config.cache.scope = :box

  # OPTIONAL: If you are using VirtualBox, you might want to use that to enable
  # NFS for shared folders. This is also very useful for vagrant-libvirt if you
  # want bi-directional sync
  config.cache.synced_folder_opts = {
    type: :nfs,
    # The nolock option can be useful for an NFSv3 client that wants to avoid the
    # NLM sideband protocol. Without this option, apt-get might hang if it tries
    # to lock files needed for /var/cache/* operations. All of this can be avoided
    # by using NFSv4 everywhere. Please note that the tcp option is not the default.
    mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
  }
  # For more information please check http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
end

region1.vm.network "private_network", ip: "10.4.128.0", netmask: "255.255.240.0", type: "dhcp"
region1.vm.provision "shell", privileged: false, inline: <<-SHELL
  sudo apt-get install -y git-core
  sudo git clone https://git.openstack.org/openstack-dev/devstack
  sudo chown -R vagrant:vagrant devstack
  DEV_DIR=/home/vagrant/devstack
  sed -i -e 's/-git/-https/' $DEV_DIR/stackrc
  cp /vagrant/Region1_local.conf $DEV_DIR/local.conf

  $DEV_DIR/stack.sh

  source $DEV_DIR/userrc_early
  openstack endpoint create identity admin http://100.0.0.11:35357/v2.0 --region RegionTwo
SHELL
end
tuupola commented 8 years ago

To use nfs you should use static ip address. Try removing type: "dhcp" from the network config.

slikk66 commented 7 years ago

Just had this issue. Works on 1.8.7, doesn't work on 1.9.1, no other changes to Vagrantfile or vm config:


The nfsd service does not appear to be running.
Starting the nfsd service
==> 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 vers=3,udp 192.168.99.1:/Users/bob/projects /projects
result=$?
if test $result -eq 0; then
if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/projects
fi
else
exit $result
fi

Stdout from the command:

Stderr from the command:

mount.nfs: access denied by server while mounting 192.168.99.1:/Users/bob/projects```
toddsiegel commented 7 years ago

I just had this as well on 1.9.1, but on 1.9.3 it worked.

fgrehm commented 1 year ago

Hey, sorry for the silence here but this project is looking for maintainers :sweat_smile:

As per https://github.com/fgrehm/vagrant-cachier/issues/193, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue :wave: