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

Can't disable NFS syncing #900

Closed
slatei opened this issue Jul 17, 2018 · 4 comments
Closed

Can't disable NFS syncing #900

slatei opened this issue Jul 17, 2018 · 4 comments

Comments

@slatei
Copy link

slatei commented Jul 17, 2018

Hi, I am trying to create a VM using Vagrant with libvirt with nfs-kernel-server installed, however I want to sync all folders with rsync without sudo privileges
My current issue is that everything I try to disable NFS pruning has been unsuccessful, and the only thing I can do to force Vagrant to not use NFS is to uninstall nfs-kernel-server, which is undesirable

Please help :)

Steps to reproduce

  1. Install nfs-kernel-server (sudo apt-get install -y nfs-kernel-server)
  2. Install Vagrant version 2.0.3
  3. Setup blank Vagrantfile with NFS exports disabled
  4. Run vagrant up

Expected behaviour

Vagrant should create domain without asking for password

Actual behaviour

==> default: Pruning invalid NFS exports. Administrator privileges will be required...
[sudo] password for user:

System configuration

OS/Distro version:: Ubuntu 16.04, Linux V4.4.0-38

Libvirt version: 1.3.1

Output of vagrant version; vagrant plugin list:
Vagrant 2.0.3

vagrant-libvirt (0.0.43)
vagrant-puppet-install (5.0.0)
vagrant-reload (0.0.1)

Output of VAGRANT_LOG=debug vagrant ... --provider=libvirt

==> default:  -- INPUT:             type=mouse, bus=ps2
 INFO machine: New machine ID: "9ef4cd4c-04f6-431e-8e7c-8223b400df09"
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::Provision:0x000000000387b290>
 INFO provision: Checking provisioner sentinel file...
 INFO warden: Calling IN action: #<VagrantPlugins::PuppetInstall::Action::InstallPuppet:0x0000000003827960>
 INFO warden: Calling IN action: #<VagrantPlugins::ProviderLibvirt::Action::PrepareNFSValidIds:0x00000000037de490>
 INFO warden: Calling IN action: #<VagrantPlugins::SyncedFolderNFS::ActionCleanup:0x0000000003788248>
DEBUG host: Searching for cap: nfs_prune
DEBUG host: Checking in: linux
DEBUG host: Found cap: nfs_prune in linux
 INFO nfs: NFS pruning. Valid IDs: ["9ef4cd4c-04f6-431e-8e7c-8223b400df09"]
DEBUG host: Searching for cap: nfs_prune
DEBUG host: Checking in: linux
DEBUG host: Found cap: nfs_prune in linux
 INFO host: Execute capability: nfs_prune [#<Vagrant::Environment: /home/jslave/test>, #<Vagrant::UI::Prefixed:0x00000000038c91c0 @logger=#<Log4r::Logger:0x00000000038c9170 @fullname="vagrant::ui::interface", @outputters=[], @additive=true, @name="interface", @path="vagrant::ui", @parent=#<Log4r::Logger:0x00000000021eb890 @fullname="vagrant", @outputters=[#<Log4r::StderrOutputter:0x0000000002190468 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x00000000021903c8>, @name="stderr", @level=0, @formatter=#<Vagrant::Util::LoggingFormatter:0x000000000207eed0 @formatter=#<Log4r::BasicFormatter:0x00000000021357c0 @depth=7>>, @out=#<IO:<STDERR>>>], @additive=true, @name="vagrant", @path="", @parent=#<Log4r::RootLogger:0x00000000021eb070 @level=0, @outputters=[]>, @level=1, @trace=false>, @level=1, @trace=false>, @opts={}, @stdin=#<IO:<STDIN>>, @stdout=#<IO:<STDOUT>>, @stderr=#<IO:<STDERR>>, @prefix=:default, @ui=#<Vagrant::UI::Colored:0x0000000002d12d18 @logger=#<Log4r::Logger:0x0000000002d12ca0 @fullname="vagrant::ui::interface", @outputters=[], @additive=true, @name="interface", @path="vagrant::ui", @parent=#<Log4r::Logger:0x00000000021eb890 @fullname="vagrant", @outputters=[#<Log4r::StderrOutputter:0x0000000002190468 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x00000000021903c8>, @name="stderr", @level=0, @formatter=#<Vagrant::Util::LoggingFormatter:0x000000000207eed0 @formatter=#<Log4r::BasicFormatter:0x00000000021357c0 @depth=7>>, @out=#<IO:<STDERR>>>], @additive=true, @name="vagrant", @path="", @parent=#<Log4r::RootLogger:0x00000000021eb070 @level=0, @outputters=[]>, @level=1, @trace=false>, @level=1, @trace=false>, @opts={:color=>:default}, @stdin=#<IO:<STDIN>>, @stdout=#<IO:<STDOUT>>, @stderr=#<IO:<STDERR>>, @lock=#<Thread::Mutex:0x0000000002cc4870>>>, ["9ef4cd4c-04f6-431e-8e7c-8223b400df09"]] (linux)
 INFO linux: Pruning invalid NFS entries...
DEBUG linux: Known valid NFS export IDs: ["9ef4cd4c-04f6-431e-8e7c-8223b400df09"]
DEBUG linux: Composite valid NFS export IDs with user: ["1000 9ef4cd4c-04f6-431e-8e7c-8223b400df09"]
DEBUG linux: NFS export IDs to be removed: ["1000 aa5976c4-0c6a-4466-a352-d59f13ac226e"]
 INFO interface: info: Pruning invalid NFS exports. Administrator privileges will be required...
 INFO interface: info: ==> default: Pruning invalid NFS exports. Administrator privileges will be required...
==> default: Pruning invalid NFS exports. Administrator privileges will be required...
 INFO subprocess: Starting process: ["/usr/bin/sudo", "chown", "0:0", "/tmp/vagrant20180717-30874-71gl3u"]
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
[sudo] password for user: 

A Vagrantfile to reproduce the issue:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "elastic/ubuntu-16.04-x86_64"
  config.vm.box_version = "20180210.0.0"

  config.ssh.insert_key = false
  config.nfs.functional = false

  config.vm.synced_folder ".", "/vagrant", type: 'rsync', disabled: true, nfs: false, nfs_prune: false, server_setup: false

  config.vm.provider "libvirt" do |lv|
    lv.memory = "1024"
    lv.cpus = 2
  end
end

Are you using upstream vagrant package or your distros package?
Upstream

@chulup
Copy link
Contributor

chulup commented Aug 8, 2018

Hello,
I am using the following to disable NFS entirely in my Vagrantfile:

  config.nfs.verify_installed = false
  config.vm.synced_folder '.', '/vagrant', disabled: true

Not sure how this would work with rsync though.

@electrofelix
Copy link
Contributor

@slatei I believe that @chulup has provided the correct answer, this isn't something is due to vagrant-libvirt, but rather with vagrant itself.

@nirs
Copy link

nirs commented Jun 5, 2022

I'm using this to keep rsync enabled, but disable nfs:

config.nfs.verify_installed = false
config.vm.synced_folder '.', '/vagrant', type: 'rsync'

Tested with Vagrant 2.2.19.

@nicolaipre
Copy link

Experienced the same problem. Solved it like this:

config.nfs.functional = false
config.nfs.verify_installed = false
config.vm.synced_folder "./shared", "/shared", type: "rsync", nfs: false

nfs: false is probably not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants