Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Vagrant stuck at "preparing to edit /etc/exports. Admin priv. will be required

Hi,

I am trying to setup Vagrant in Fedora 23 with libvirt. I have followed these instructions in Fedora Developer portal: https://developer.fedoraproject.org/tools/vagrant/vagrant-libvirt.html https://developer.fedoraproject.org/tools/vagrant/vagrant-nfs.html

It boots and everything works fine until I get asked for sudo password: Preparing to edit /etc/exports. Administrator privileges will be required...

I run Vagrant as a normal user and do not want to run it as root. Nor add myself to the sudoers file. Just to test if everything is actually working I did run "vagrant up" as root and it worked.

I found something while googling for answers and that was to chmod the /etc/exports file and it actually works. I can then run "vagrant up" as a normal user and it works, but it feels like a dirty fix to me. I would really like to get Vagrant running as a normal user without having to affect security.

This is what I have done:

$ sudo dnf install vagrant-libvirt
$ sudo systemctl enable libvirtd
$ lsmod | grep kvm

lsmod | grep kvm does not return anything, so I have edit the Vagrantfile to use the qemu driver:

Vagrant.configure("2") do |config|
...
  config.vm.provider :libvirt do |libvirt|
    libvirt.driver = "qemu"
  end
...
end

Using libvirt from Vagrant without password prompts

$ sudo gpasswd -a ${USER} libvirt
$ newgrp libvirt

Synced folders with NFS

$ sudo dnf install nfs-utils && sudo systemctl enable nfs-server

Afterwards enable nfs, rpc-bind and mountd services for firewalld:

$ sudo firewall-cmd --permanent --add-service=nfs &&
  sudo firewall-cmd --permanent --add-service=rpc-bind &&
  sudo firewall-cmd --permanent --add-service=mountd &&
  sudo firewall-cmd --reload

Using NFS shares from Vagrant without password prompts

$ sudo visudo

add this:

# Allow Vagrant to manage /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status nfs-server.service
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /etc/exports
%vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE

Afterwards add yourself to the vagrant group if you are not there already by running:

$ sudo getent group vagrant >/dev/null || sudo groupadd -r vagrant
$ sudo gpasswd -a ${USER} vagrant
$ newgrp vagrant

Get Vagrant up and running:

$ vagrant init rboyer/ubuntu-trusty64-libvirt 
$ vagrant up

I have tried two different libvirt boxes from Vagrant box catalog:

https://atlas.hashicorp.com/s3than/boxes/trusty64

https://atlas.hashicorp.com/rboyer/boxes/ubuntu-trusty64-libvirt

Any feedback on this would be very appreciated.Thanks a lot.

Vagrant stuck at "preparing to edit /etc/exports. Admin priv. will be required

Hi,

I am trying to setup Vagrant in Fedora 23 with libvirt. I have followed these instructions in Fedora Developer portal: https://developer.fedoraproject.org/tools/vagrant/vagrant-libvirt.html https://developer.fedoraproject.org/tools/vagrant/vagrant-nfs.html

It boots and everything works looks fine until I get asked for sudo "sudo password: Preparing to edit /etc/exports. Administrator privileges will be required...required".

I run Vagrant as a normal user and do not want to run it as root. Nor root, nor add myself to the sudoers file. Just to test if everything is actually working I did test, I have run "vagrant up" as root and it worked.everything worked, but I am not comfortable with running Vagrant like this.

I found something while googling for answers fixes and that was to chmod change the permissions of the /etc/exports file and it actually works. I can then file. This works and let me run "vagrant up" as a normal user and it works, user, but it feels like a dirty fix to me. What is the downside with changing the permissions of the /etc/exports file? I would really like to get Vagrant running as a normal user without having to affect security.

This is what I have done:followed these instructions from Fedora Developer portal (https://developer.fedoraproject.org/tools/vagrant/vagrant-libvirt.html and https://developer.fedoraproject.org/tools/vagrant/vagrant-nfs.html):

$ sudo dnf install vagrant-libvirt
$ sudo systemctl enable libvirtd
$ lsmod | grep kvm

lsmod | grep kvm does not return anything, so I have edit the Vagrantfile to use the qemu driver:

Vagrant.configure("2") do |config|
...
  config.vm.provider :libvirt do |libvirt|
    libvirt.driver = "qemu"
  end
...
end

Using libvirt from Vagrant without password prompts

$ sudo gpasswd -a ${USER} libvirt
$ newgrp libvirt

Synced folders with NFS

$ sudo dnf install nfs-utils && sudo systemctl enable nfs-server

Afterwards enable nfs, rpc-bind and mountd services for firewalld:

$ sudo firewall-cmd --permanent --add-service=nfs &&
  sudo firewall-cmd --permanent --add-service=rpc-bind &&
  sudo firewall-cmd --permanent --add-service=mountd &&
  sudo firewall-cmd --reload

Using NFS shares from Vagrant without password prompts

$ sudo visudo

add this:

# Allow Vagrant to manage /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status nfs-server.service
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /etc/exports
%vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE

Afterwards add yourself to the vagrant group if you are not there already by running:

$ sudo getent group vagrant >/dev/null || sudo groupadd -r vagrant
$ sudo gpasswd -a ${USER} vagrant
$ newgrp vagrant

Get Vagrant up and running:

$ vagrant init rboyer/ubuntu-trusty64-libvirt 
$ vagrant up

I have tried two different libvirt boxes from Vagrant box catalog:

https://atlas.hashicorp.com/s3than/boxes/trusty64

https://atlas.hashicorp.com/rboyer/boxes/ubuntu-trusty64-libvirt

Any feedback on this would be very appreciated.Thanks a lot.

Vagrant stuck at "preparing to edit /etc/exports. Admin priv. will be requiredrequired"

Hi,

I am trying to setup Vagrant in Fedora 23 with libvirt. It boots and everything looks fine until I get asked for "sudo password: Preparing to edit /etc/exports. Administrator privileges will be required".

I run Vagrant as a normal user and do not want to run it as root, nor add myself to the sudoers file. Just to test, I have run "vagrant up" as root and everything worked, but I am not comfortable with running Vagrant like this.

I found something while googling for fixes and that was to change the permissions of the /etc/exports file. This works and let me run "vagrant up" as a normal user, but it feels like a dirty fix to me. What is the downside with changing the permissions of the /etc/exports file? I would really like to get Vagrant running as a normal user without having to affect security.

I have followed these instructions from Fedora Developer portal (https://developer.fedoraproject.org/tools/vagrant/vagrant-libvirt.html and https://developer.fedoraproject.org/tools/vagrant/vagrant-nfs.html):

$ sudo dnf install vagrant-libvirt
$ sudo systemctl enable libvirtd
$ lsmod | grep kvm

lsmod | grep kvm does not return anything, so I have edit the Vagrantfile to use the qemu driver:

Vagrant.configure("2") do |config|
...
  config.vm.provider :libvirt do |libvirt|
    libvirt.driver = "qemu"
  end
...
end

Using libvirt from Vagrant without password prompts

$ sudo gpasswd -a ${USER} libvirt
$ newgrp libvirt

Synced folders with NFS

$ sudo dnf install nfs-utils && sudo systemctl enable nfs-server

Afterwards enable nfs, rpc-bind and mountd services for firewalld:

$ sudo firewall-cmd --permanent --add-service=nfs &&
  sudo firewall-cmd --permanent --add-service=rpc-bind &&
  sudo firewall-cmd --permanent --add-service=mountd &&
  sudo firewall-cmd --reload

Using NFS shares from Vagrant without password prompts

$ sudo visudo

add this:

# Allow Vagrant to manage /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status nfs-server.service
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /etc/exports
%vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE

Afterwards add yourself to the vagrant group if you are not there already by running:

$ sudo getent group vagrant >/dev/null || sudo groupadd -r vagrant
$ sudo gpasswd -a ${USER} vagrant
$ newgrp vagrant

Get Vagrant up and running:

$ vagrant init rboyer/ubuntu-trusty64-libvirt 
$ vagrant up

I have tried two different libvirt boxes from Vagrant box catalog:

https://atlas.hashicorp.com/s3than/boxes/trusty64

https://atlas.hashicorp.com/rboyer/boxes/ubuntu-trusty64-libvirt

Any feedback on this would be very appreciated.Thanks a lot.

Vagrant stuck at "preparing to edit /etc/exports. Admin priv. will be required"How do I run Vagrant as a normal user in Fedora?

Hi,

I am trying to setup Vagrant in Fedora 23 with libvirt. It boots and everything looks fine until I get asked for this in the boot process: "sudo password: Preparing to edit /etc/exports. Administrator privileges will be required". required".

I run Vagrant as a normal user and do not want to run it as root, nor add myself to the sudoers file. So I therefor get stuck on the above prompt for administrator privileges. Just to test, I have run "vagrant up" vagrant up as root and everything worked, but I am not comfortable with running Vagrant like this.

I found something while googling for fixes and that was to change the permissions of the /etc/exports file. This works and let me run "vagrant up" vagrant up as a normal user, but it feels like a dirty fix to me. What is the downside with changing the permissions of the /etc/exports file? I would really like to get Vagrant running as a normal user without having to affect security.

I have followed these instructions from Fedora Developer portal (https://developer.fedoraproject.org/tools/vagrant/vagrant-libvirt.html and https://developer.fedoraproject.org/tools/vagrant/vagrant-nfs.html):portal:

$ sudo dnf install vagrant-libvirt
$ sudo systemctl enable libvirtd
$ lsmod | grep kvm

lsmod | grep kvm does not return anything, so I have edit the Vagrantfile to use the qemu driver:

Vagrant.configure("2") do |config|
...
  config.vm.provider :libvirt do |libvirt|
    libvirt.driver = "qemu"
  end
...
end

Using libvirt from Vagrant without password prompts

$ sudo gpasswd -a ${USER} libvirt
$ newgrp libvirt

Synced folders with NFS

$ sudo dnf install nfs-utils && sudo systemctl enable nfs-server

Afterwards enable nfs, rpc-bind and mountd services for firewalld:

$ sudo firewall-cmd --permanent --add-service=nfs &&
  sudo firewall-cmd --permanent --add-service=rpc-bind &&
  sudo firewall-cmd --permanent --add-service=mountd &&
  sudo firewall-cmd --reload

Using NFS shares from Vagrant without password prompts

$ sudo visudo
 

add this: this:

# Allow Vagrant to manage /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status nfs-server.service
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /etc/exports
%vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE

Afterwards add yourself to the vagrant group if you are not there already by running:

$ sudo getent group vagrant >/dev/null || sudo groupadd -r vagrant
$ sudo gpasswd -a ${USER} vagrant
$ newgrp vagrant

Get Vagrant up and running:

$ vagrant init rboyer/ubuntu-trusty64-libvirt 
$ vagrant up

I have tried two different libvirt boxes from Vagrant box catalog:

https://atlas.hashicorp.com/s3than/boxes/trusty64

https://atlas.hashicorp.com/rboyer/boxes/ubuntu-trusty64-libvirt

Any feedback site: https://atlas.hashicorp.com/s3than/boxes/trusty64 and https://atlas.hashicorp.com/rboyer/boxes/ubuntu-trusty64-libvirt. I get the same result with both boxes.

Help on this would be matter is very appreciated.Thanks a lot. appreciated.Thanks.