Trying to use vagrant to mount a VM. I use libvirt as a provider.
I have this in my Vagrantfile :
config.vm.synced_folder ‘.’, ‘/toto’
I get the following :
==> default: Mounting NFS shared folders…
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o vers=4 192.168.122.1:/home/ludovic/Documents/src/3liz/toto /vagrant
Stdout from the command:
Stderr from the command:
mount.nfs: Connection timed out
I have followed instructions at Synced folders with NFS — Fedora Developer Portal - but it’s not helping.
[ludovic@saraan lizmap-box]$ sudo cat /etc/exports
VAGRANT-BEGIN: 1000 d7208f2d-8be6-40ed-a777-2d9741158fca
VAGRANT-END: 1000 d7208f2d-8be6-40ed-a777-2d9741158fca
[ludovic@saraan lizmap-box]$ vagrant --version
I have tried to use rsync as per Basic Usage - Synced Folders | Vagrant | HashiCorp Developer , but I still get some NFS error .
Journalctl -e is of little help.
What am I doing wrong ?
I had the same type of question when I started using Fedora and was used to using Vagrant. Here’s what I did:
sudo dnf install sshfs is the equivalent Fedora command to
Now in your virtual machine change the owner and group of the directory you want to sync with:
chown vagrant:vagrant /vagrant -R
It possibly is already set as “vagrant” which is fine.
Then in your host machine, create a mount point:
sudo mkdir /mnt/myvagrant
Now you need to change the permissions of that new directory to those that you are using:
sudo chown ludovic:ludovic /mnt/myvagrant -R
Then you can use
sshfs like this:
sudo sshfs -o allow_other,default_permissions email@example.com:/vagrant /mnt/myvagrant
If all goes well you should now be able to
cd /mnt/vagrant and see your files in the
/vagrant directory of your virtual machine.
I am still quite a newbie but thought I’d try and help.
P.S. DO NOT FOLLOW THE " Permanently Mounting the Remote File System" instructions on that page. It will break your boot up. (I found out the hard way!)
Thanks for the good workaround. I’ll probably file an issue with vagrant, that simple thing should work.
Great news! I am glad it helped!
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.