How to move the Vagrant VM folder?

Is there a way to move the vagrant vm folder without problems with the nfs and / etc / exports shared folders?

When I try to move the machine (while stopping), the following error occurs when I try to work with any other field (for example: 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): / 
+7
vagrant
source share
1 answer

I was a bit late, but I had the same problem, and I wanted to share my solution if someone else came across this.

As a result, I changed the path in /etc/exports (on the main 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 saved in .vagrant/machines/default/virtualbox/synced_folders (directory names depending on which provider you use and whether you use the default machine), I tried to change this in the first place, but this is not enough, however it may embarrass Vagrant if you don’t change it there - to be safe, you must change it too.

Unfortunately, I do not know how to do this without manually modifying these files or destroying this field.

+9
source share

All Articles