Is there a way to move a vagrant vm folder without having problems with nfs shared folders and /etc/exports?
Trying to move the machine (halted) results in the following error whenever I try to operate on any other box (eg: vagrant up
):
==> default: Exporting NFS shared folders...
NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":
exports:14: path contains non-directory or non-existent components: /Users/[...]/vm
exports:14: no usable directories in export entry
exports:14: using fallback (marked offline): /
I'm a bit late but I just had the same problem and felt like sharing my solution in case someone else stumbles upon this too.
I ended up changing the path in /etc/exports
(on the host machine), for example:
# VAGRANT-BEGIN: 501 121121ae-813d-4546-8fbb-f44c591f5529
"/Users/me/wrong/dir" 192.168.3.103 -alldirs -mapall=501:20
# VAGRANT-END: 501 121121ae-813d-4546-8fbb-f44c591f5529
There you can change the path on the host. Then after a vagrant reload
it should work.
The path is also stored in .vagrant/machines/default/virtualbox/synced_folders
(directory names depending on what provider do you use and whether you use the default machine), I tried changing that first but that's not enough, however, it might confuse Vagrant if you don't change it there too -- to be safe you should change it there too.
Unfortunately I'm not aware of any way to do this without manually changing these files or destroying the box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With