Vagrant: "modinfo" not found in $PATH

Created on 3 Sep 2018  ยท  5Comments  ยท  Source: hashicorp/vagrant

Vagrant version

Vagrant 2.1.4

Host operating system

  • lsb_release -a
No LSB modules are available.
Distributor ID: Devuan
Description:    Devuan GNU/Linux 2.0 (ascii)
Release:    2.0
Codename:   ascii
  • cat /etc/debian_version

Guest operating system

Debian 9

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "debian/stretch64"

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

  config.vm.synced_folder "/<REDACTED>/national", "/home/vagrant/national", type: "nfs"

  config.vm.provider "virtualbox" do |vb|

    vb.name = "Debian 9 multiusage"
  end

  config.vm.provision "shell", inline: <<-SHELL
    rm /var/lib/apt/lists/* -rf
    apt-get update
    apt-get upgrade -y
    apt-get install -y vim htop curl wget
  SHELL
end

Debug output

https://gist.github.com/deogracia/0b99a3b4b8d06d7218de0fe47c40e531

Expected behavior

  • NFS should be configured
  • VM should be up

Actual behavior

  • vagrant up ends with an error message
  • VM is down

Steps to reproduce

  1. Use devuan
  2. Install Oracle VirtualBox from Oracle website
  3. Install vagrant from vagrantup website
  4. Use a minimal Vagrantfile with a NFS shared directory

References

  • GH-6304 : add use of modinfo with nfs capapbility

How I see this issue

  • modinfo lies in /sbin
  • /sbin is in $PATH only for root
  • Given the full path (/sbin/modinfo) of modinfo in plugins/hosts/linux/cap/nfs.rb: everything works fine
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

  https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

  VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

  config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
    default: /vagrant => /<REDACTED>/debian9
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
  • The warning about SharedFoldersEnableSymlinksCreate is new and didn't occur with vagrant 2.1.2 on chakralinux ( old and different OS crashed last week-end, but I got safe elsewhere)

Thanks for your awesome work everyone :D

enhancement hoslinux

All 5 comments

Hi @deogracia!

The quick fix for now is to just add /sbin to your PATH and then things will work as expected. Not sure why modinfo was placed there, but we'll look at adding an exception for the path lookup.

Thanks.
For now, I'll keep using vagrant with plugins/hosts/linux/cap/nfs.rb patched. If I see something wrong, I'll rollback and add /sbin in my $PATH.

  • still valid in 2.1.5
  • haven't use vagrant a lot since, but so far, so good ( with plugins/hosts/linux/cap/nfs.rb patched)
  • still valid in 2.2.4

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

janw-me picture janw-me  ยท  3Comments

barkingfoodog picture barkingfoodog  ยท  3Comments

cbednarski picture cbednarski  ยท  3Comments

dorinlazar picture dorinlazar  ยท  3Comments

OtezVikentiy picture OtezVikentiy  ยท  3Comments