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 from host ip instead of machine ip #7055

Closed
joksnet opened this issue Feb 18, 2016 · 2 comments
Closed

NFS mount from host ip instead of machine ip #7055

joksnet opened this issue Feb 18, 2016 · 2 comments

Comments

@joksnet
Copy link

joksnet commented Feb 18, 2016

Vagrant version

Vagrant 1.8.1

Host operating system

I'm using ArchLinux updated to nfs-utils 1.3.3-3.

Guest operating system

I build an ArchLinux image using packer-arch. This image is from January and the first time the vagrant is loaded, the NFS share mounts OK. Then something happen, I got two different cases:

  1. I do an sudo pacman -Syyu inside the VM and when I reload it, the error appears.
  2. I install new software (even if partial updates are not supported in ArchLinux) and for a few times it works well, then the error appears.

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby sw=2 ts=2 :

Vagrant.require_version ">= 1.5"
Vagrant.configure(2) do |config|
  config.vm.box      = "arch"
  config.vm.hostname = "aix.local"

  config.vm.network :private_network, ip: "192.168.17.3"

  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.synced_folder ".", "/home/vagrant/aix", :type => "nfs",
    :linux__nfs_options => ['rw','no_subtree_check','all_squash','insecure']

  config.vm.provider "virtualbox" do |c|
    c.memory = 1024
  end
end

NOTE: I added the insecure because sometimes I was getting the error illegal port XXXXX by suggestion of this comment.

Debug output

Here is vagrant up --debug.

Also, from journalctl I got:

Feb 18 15:35:37 take kernel: VBoxNetFlt: attached to 'vboxnet7' / 0a:00:27:00:00:07
Feb 18 15:35:37 take dhcpcd[422]: vboxnet7: IAID 27:00:00:07
Feb 18 15:35:37 take kernel: device vboxnet7 entered promiscuous mode
Feb 18 15:35:37 take dhcpcd[422]: vboxnet7: soliciting a DHCP lease
Feb 18 15:35:38 take dhcpcd[422]: vboxnet7: soliciting an IPv6 router
Feb 18 15:35:50 take dhcpcd[422]: vboxnet7: no IPv6 Routers available
Feb 18 15:35:54 take sudo[11712]:       jm : TTY=pts/1 ; PWD=/home/jm/Projects/aix_c ; USER=root ; COMMAND=/usr/bin/sed -r -e \^A^# VAGRANT-BEGIN:( 1000)? edbb7423\-58af\-40f8\-b521\-22c756fe3be0^A,\^A^# VAGRANT-END:( 1000)? edbb7423\-58af\-40f8\-b521\-22c756fe3be0^A 
Feb 18 15:35:54 take sudo[11712]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 18 15:35:54 take sudo[11712]: pam_unix(sudo:session): session closed for user root
Feb 18 15:35:54 take sudo[11714]:       jm : TTY=pts/1 ; PWD=/home/jm/Projects/aix_c ; USER=root ; COMMAND=/usr/bin/cp /tmp/exports /etc/exports
Feb 18 15:35:54 take sudo[11714]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 18 15:35:54 take sudo[11714]: pam_unix(sudo:session): session closed for user root
Feb 18 15:35:54 take sudo[11718]:       jm : TTY=pts/1 ; PWD=/home/jm/Projects/aix_c ; USER=root ; COMMAND=/usr/bin/tee -a /etc/exports
Feb 18 15:35:54 take sudo[11718]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 18 15:35:54 take sudo[11718]: pam_unix(sudo:session): session closed for user root
Feb 18 15:35:54 take sudo[11722]:       jm : TTY=pts/1 ; PWD=/home/jm/Projects/aix_c ; USER=root ; COMMAND=/usr/bin/tee -a /etc/exports
Feb 18 15:35:54 take sudo[11722]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 18 15:35:54 take sudo[11722]: pam_unix(sudo:session): session closed for user root
Feb 18 15:35:55 take sudo[11726]:       jm : TTY=pts/1 ; PWD=/home/jm/Projects/aix_c ; USER=root ; COMMAND=/usr/bin/tee -a /etc/exports
Feb 18 15:35:55 take sudo[11726]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 18 15:35:55 take sudo[11726]: pam_unix(sudo:session): session closed for user root
Feb 18 15:35:55 take sudo[11729]:       jm : TTY=pts/1 ; PWD=/home/jm/Projects/aix_c ; USER=root ; COMMAND=/usr/bin/exportfs -ar
Feb 18 15:35:55 take sudo[11729]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 18 15:35:55 take sudo[11729]: pam_unix(sudo:session): session closed for user root
Feb 18 15:35:55 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:35:58 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:36:01 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:36:04 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:36:07 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:36:10 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:36:14 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host
Feb 18 15:36:17 take rpc.mountd[453]: refused mount request from 192.168.17.1 for /home/jm/Projects/aix_c (/home/jm/Projects/aix_c): unmatched host

Do you see all this unmatched host errors? I don't know why NFS is trying to connect from IP 192.168.17.1 which should be my host one. If you see my Vagrantfile the virtual machine IP is 192.168.17.3.

I fixed the error, after each vagrant up I have to:

  1. sudoedit /etc/exports.
  2. Change the expected host from 192.168.17.3 to something like 192.168.17.0/24.
  3. sudo exportfs -rav.
  4. vagrant ssh.
  5. sudo mount -o 'vers=3,udp' 192.168.17.1:'/home/jm/Projects/aix_c' /home/vagrant/aix manually.

Expected behavior

The synced folder should be mounter using NFS.

Actual behavior

This error appear:

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.17.1:'/home/jm/Projects/aix_c' /home/vagrant/aix

Stdout from the command:



Stderr from the command:

mount.nfs: access denied by server while mounting 192.168.17.1:/home/jm/Projects/aix_c

And the synced folder is not mounted.

References

@chrisroberts chrisroberts added this to the 1.8 milestone Oct 3, 2016
@chrisroberts
Copy link
Member

Hi there,

Thanks for reporting this bug. I'm sure this was a real issue when originally reported (our fault for not looking sooner!) but there have been multiple Vagrant releases since the original report. I'm going to close this issue now and request you reopen the issue if you're still experiencing this problem. I'm sorry this wasn't looked at earlier ☹️

Cheers!

@ghost
Copy link

ghost commented Apr 3, 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.

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

No branches or pull requests

3 participants