1

I am trying to do vagrant up for a CentOS 8 machine I have built using Jeff Geerling's packer-boxes repo.

My Vagrantfile looks like this.

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
  config.ssh.insert_key = false
  config.vm.synced_folder '.', '/vagrant', type: 'nfs'

  # VirtualBox.
  config.vm.define "virtualbox" do |virtualbox|
    virtualbox.vm.hostname = "virtualbox-centos8"
    virtualbox.vm.box = "file://builds/virtualbox-centos8.box"
    virtualbox.vm.network :private_network, ip: "172.16.9.29"
    virtualbox.vbguest.auto_update = true

    config.vm.provider :virtualbox do |v|      v.gui = false
      v.memory = 1024
      v.cpus = 1
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.customize ["modifyvm", :id, "--ioapic", "on"]
    end

    config.vm.provision "shell", inline: "echo Hello, World"
  end

end

I get this error message that it cannot use NFS.

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3 172.16.9.1:/home/bcrice/projects/packer-boxes/centos8 /vagrant

Stdout from the command:



Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

I have tried all the tricks posted here but none worked.

https://github.com/hashicorp/vagrant/issues/9666

I am using this version of Ubuntu desktop

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

VirtualBox on my host dpkg -l | grep virtualbox | awk '{print $3}'

6.1.10-dfsg-1~ubuntu1.20.04.1
6.1.10-dfsg-1~ubuntu1.20.04.1
6.1.10-1~ubuntu1.20.04.1
6.1.10-dfsg-1~ubuntu1.20.04.1

Guest in VirtualBox says it is running the guest-utils

vagrant vbguest --status
[virtualbox] GuestAdditions 6.1.10 running --- OK.

My /etc/exports auto-adds the entry properly but it doesn't work

cat /etc/exports
# VAGRANT-BEGIN: 1000 2b82110e-78ed-489e-891e-c80e073c4f73
"/home/bcrice/packer-boxes/centos8" 172.16.9.29(rw,no_subtree_check,all_squash,anonuid=1000,anongid=1000,fsid=187307313)
# VAGRANT-END: 1000 2b82110e-78ed-489e-891e-c80e073c4f73
bcrice
  • 33
  • 4
  • 1
    Needed to do ```apt install nfs-kernel-server```. Even though ```systemctl status nfs-kernel-server``` said it was running, it was not actually installed. Once installed do a ```systemctl restart nfs-kernel-server``` and it worked. – bcrice Nov 02 '20 at 04:02

1 Answers1

1

Needed to do apt install nfs-kernel-server. Even though systemctl status nfs-kernel-server said it was running, it was not actually installed. Once installed do a systemctl restart nfs-kernel-server and it worked.

A nice giveaway was that when I ran exportfs it said that nfs-kernel-server was not installed.

Run dpkg -l | grep nfs-kernel-server and double-check to see if you have it installed.

bcrice
  • 33
  • 4
  • Thanks. That is entirely nuts - my vagrant was running last week. After software updates and reboot ... it's not and this is the problem. – Adaddinsane Mar 21 '22 at 13:31