Closed sebas5384 closed 7 years ago
Hi Sebastian! Could you please do the following:
I want to see vagrants configuration, but don't have it installed
Hey @sebas5384 ,
Do you know what the default ip vagrant is using? Because exports conflict can happen without vagrant too if you use multiple docker-machine boxes. The thing with docker-machine is that it doesn't lock the ip address to a box (see https://github.com/docker/machine/issues/1709). So it could be that when you start vagrant and later machine (and vice-versa) the ip changes constantly.
What I do to prevent this is following work around (https://github.com/docker/machine/issues/1709#issuecomment-161026484).
Try this and let us know.
That being all said, the management of the /etc/export in docker-machine-nfs is very basic, so it can be improved to avoid such things. But for for our (Adlogix/Adsdaq) needs it's not high priority.
Cheers
@krasilich and @tonivdv thanks your quick response!!
@krasilich here's my /etc/exports file when I have my vagrant's projects running.
$ cat /etc/exports
# VAGRANT-BEGIN: 501 6991d57f-1e23-42a1-a13a-d14d18659ec0
"/Users/sebas/Virtual/projects/myprojectwithvagrant" 192.168.22.11 -alldirs -mapall=501:20
# VAGRANT-END: 501 6991d57f-1e23-42a1-a13a-d14d18659ec0
@tonivdv I'll try to do that and I'll let you know.
Again thanks.
I tried to create a new machine with different CIDR, "192.168.98.1/24" instead of "192.168.22.1/24" like my vagrant's projects do:
$ docker-machine create -d virtualbox --virtualbox-hostonly-cidr "192.168.98.1/24" default98
$ docker-machine start default98
(default98) Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
$ eval "$(docker-machine env default98)"
$ docker-machine-nfs default98
[INFO] Configuration:
- Machine Name: default98
- Shared Folder: /Users
- Force: false
[INFO] machine presence ... OK
[INFO] machine running ... OK
[INFO] Lookup mandatory properties ... OK
- Machine IP: 192.168.98.100
- Network ID: vboxnet8
- NFSHost IP: 192.168.98.1
[INFO] Configure NFS ...
!!! Sudo will be necessary for editing /etc/exports !!!
Password:
exports:5: /Users conflicts with existing export /Users/sebas/Virtual/projects/myprojectwithvagrant
exports:6: /Users conflicts with existing export /Users/sebas/Virtual/projects/myprojectwithvagrant
but still same error, maybe I'm doing something wrong :/
Hey @sebas5384 ,
I could be wrong but it could be related to the fact that one machine tries to share /Users/sebas/Virtual/... and the other /Users only. I would have to test this to confirm.
@tonivdv yep! that was the problem :(
So now I just comment the Vagrant mount whenever I want to use the docker-machine with nfs.
I can't figure it out which project should deal with this, but I feel like Vagrant isn't removing the Vagrant mount when the virtual machine is down. That could resolve this issue, ... I think.
Thanks for the help!
It's Local that should be using a more specific path, their path overlaps everything.
I work on projects that uses Vagrant with Virtual Box and Docker with Docker Machine on Mac OS X.
Every time I use Vagrant, and then I switch to my projects with Docker, the docker-machine-nfs gives me an error saying it's conflicting with the current /etc/exports.
The workaround till now is:
The problem is that I'm having to do almost the same thing when have to go back to my other projects using Vagrant.
I took a look at the other issues talking about the /etc/exports usage by this command, though I didn't find any solution.
Help? :)