winnfsd / vagrant-winnfsd

Manage and adds support for NFS for Vagrant on Windows.
Other
567 stars 62 forks source link

Problem running multiple boxes with different host folders #10

Closed dmitrii-baranov-tg closed 6 years ago

dmitrii-baranov-tg commented 10 years ago

When I make "vagrant up" in my second project folder all the mounts in both boxes mess up. Thus I cannot run multiple boxes at the same time.

At first I thought, that this is because of the same SSH port both boxes use, but then I've changed it to different one in second box. Now it's clear to me, that I have only one running instance of winnfsd with one "nfspaths" file (projcect1) and when I start second box, it changes this instance somehow.

nebojsa-simic commented 10 years ago

i have multiple boxes, some of them use nfs, some don't. if i start a box which does not use nfs AFTER the box that uses nfs, the daemon is killed:

==> db01: Pruning invalid NFS exports. [NFS] Status: running [NFS] Halt: halt [NFS] Status: halted

pgibler commented 10 years ago

I can confirm having the same issue as @nebojsa-simic.

However, the title of this is too specific. In fact, running a 2nd VM, even without a shared folder in the second VM, causes this issue.

The first VM (web) hung when attempting to access it's shared folder from within Vagrant. Given that I had 2 VMs, a web & db server, I removed the db server, ran vagrant reload, and the NFS shared folder works wonderfully now..

Considering how common multi-VM setups are, this would be nice to have fixed.

GM-Alex commented 10 years ago

Added support for multiple boxes in version 1.0.7. Would be nice if you could test it.

GM-Alex commented 10 years ago

Have anyone tested it so far?

borisschapira commented 10 years ago

When I launch a second VM, I have this message, mounting NFS folders :

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o 'vers=3,udp,nolock' 10.0.0.1:'/C/www

Stdout from the command:

Stderr from the command:

stdin: is not a tty
mount.nfs: access denied by server while mounting 10.0.0.1:/C/www

But I do not know if it isn't related to other Windows 8.1 issues, sorry.

nebojsa-simic commented 10 years ago

Tested it: ==> web01: Machine booted and ready! ==> web01: Checking for guest additions in VM... ==> web01: Configuring and enabling network interfaces... ==> web01: Exporting NFS shared folders... ==> web01: Preparing to edit nfs mounting file. [NFS] Status: halted [NFS] Start: started ==> web01: Mounting NFS shared folders...

and the machine just hangs there. Vagrant 1.6.3 VBox 4.3.12

mperice commented 10 years ago

I have the same issue, machine using only one box. Windows 8.1, Vagrant 1.6.3, VirtualBox 4.3.12

Using vagrant reload I get: ==> default: Configuring and enabling network interfaces... ==> default: Exporting NFS shared folders... ==> default: Preparing to edit nfs mounting file. [NFS] Status: halted [NFS] Start: started ==> default: Mounting NFS shared folders...

And after 8 minutes the following:

The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

mount -o 'vers=3,udp,nolock' 192.168.33.1:'/C/project' /vagrant

Stdout from the command: Stderr from the command:

stdin: is not a tty mount.nfs: Connection timed out

GM-Alex commented 10 years ago

But that happens only for the second machine?

mperice commented 10 years ago

I have only one machine, perhaps I posted in the wrong thread ...

GM-Alex commented 10 years ago

@nebojsa-simic Are you running more than one machine?

GM-Alex commented 10 years ago

@mperice The right issue is #12, I will fix that in the next version. Maybe I will release it in the evening.

nebojsa-simic commented 10 years ago

nope its actually the first machine

On Wed, Jun 25, 2014 at 3:39 PM, Alexander Schneider < notifications@github.com> wrote:

@nebojsa-simic https://github.com/nebojsa-simic Are you running more than one machine?

— Reply to this email directly or view it on GitHub https://github.com/GM-Alex/vagrant-winnfsd/issues/10#issuecomment-47101587 .

nebojsa-simic commented 10 years ago

if i go to the bin folder of the gems and execute nfsservice.bat start a message box pops up and says that msvcr120.dll can not be found

any suggestions ?

nebojsa-simic commented 10 years ago

i went to: http://www.microsoft.com/en-us/download/confirmation.aspx?id=40784 and downloaded the packages

now the nfsservice starts, but crashes right afterwards

nebojsa-simic commented 10 years ago

although the .bat file crashes, the nfs shared folders in the vagrant are working

nebojsa-simic commented 10 years ago

if anyone has problems, installing the 32bit redistributable packages helps

GM-Alex commented 10 years ago

@nebojsa-simic New version is released. Dll is now included into the executable.

photchkiss commented 10 years ago

I have version 1.0.10 of vagrant-winnfsd and am still running into the multiple machine problem described above:

myVu: SSH auth method: private key
myVu: Warning: Connection timeout. Retrying...
myVu: Warning: Remote connection disconnect. Retrying...

==> myVu: Machine booted and ready! GuestAdditions 4.3.12 running --- OK. ==> myVu: Checking for guest additions in VM... ==> myVu: Configuring and enabling network interfaces... ==> myVu: Exporting NFS shared folders... ==> myVu: Preparing to edit nfs mounting file. [NFS] Status: running ==> myVu: 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=3,udp,nolock' 192.168.33.1:'/C/myvu/web' /var/www/html

Stdout from the command:

Stderr from the command:

mount.nfs: access denied by server while mounting 192.168.33.1:/C/myvu/web

Am I doing something incorrectly to cause this issue. I have a single box that is able to use the plugin, but as soon as I try to bring up other boxes, I get the error described above.

Thanks!

Vagrant: 1.6.3 Windows 7 plugin version 1.0.10

AxelBriche commented 10 years ago

Hello. Same issue with windows 7 for me, I try to install vagrant 1.5.0 now.

AxelBriche commented 10 years ago

With vagrant 1.5, I can't use "nfs" type (error during vagrant up).

With the last version of vagrant, I have this error :

I have Windows 7 (new and clean os, it's a new pc), and Virtualbox 4.3 (the lasts versions of virtualbox bug with vagrant).

My complete vagrantfile:

Vagrant.configure(2) do |config|
    config.vm.box = "hashicorp/precise64"

    config.vm.network "forwarded_port", guest: 80, host: 2727
    config.vm.network "private_network", ip: "192.168.33.10"

    config.vm.synced_folder "./config", "/etc/apache2", type: "nfs", create: true

    config.vm.provider "virtualbox" do |v|
        v.memory = 1024
        v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
    end
end

Note: my /etc/apache2 is not existing for this moment but I have "create" set to "true".

ryanschmidt commented 10 years ago

I'm also seeing this issue with multiple instances both using NFS.

bate commented 9 years ago

I can confirm that too

mount -o 'vers=3,udp,nolock' 192.168.56.1:'/c/mybox.dev' /var/www/mybox.dev

it seems to be an issue with multiple boxes

DZunke commented 9 years ago

the problem still exists, is there a known workaround? had tried to google for this but didn't found a solution. it would be nice if this is fixed but if someone knows a workaround i would be gratefull :smile:

worthwhileindustries commented 9 years ago

@DZunke I think this is a problem with WinNFS. We need to talk to those guys I think.

bate commented 9 years ago

Is this version used right now?

https://bitbucket.org/jankowfsky/winnfsd

worthwhileindustries commented 9 years ago

@bate or this one

https://bitbucket.org/yannschepens/winnfsd

?

GM-Alex commented 9 years ago

Ok seems there is some confusion. Used is https://bitbucket.org/jankowfsky/winnfsd which contains all changes from https://bitbucket.org/yannschepens/winnfsd. Because the fork of winnfsd, at https://bitbucket.org/jankowfsky/winnfsd, is also my project like vagrant-winnfsd and Yann made some really good pull requests, I invited Yann to be part of the winnfsd project and he agreed. So the newest version of winnfsd will be always at https://bitbucket.org/jankowfsky/winnfsd

n8green commented 9 years ago

Also seeing this issue on Windows 7 host with an ubuntu multi machine setup. First box boots and shares correctly - second one hits the error already described above -

[NFS] Status: running
==> dbserver: 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=3,udp,nolock' 192.168.55.1:'/C/HOST_SHARE_PATH_HERE'  GUEST_PATH_HERE

Stdout from the command:

Stderr from the command:

stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.55.1:/C/HOST_SHARE_PATH_HERE

Running Vagrant 1.6.3, with vagrant-winnfsd (1.0.11)

Any ideas for a workaround?

n8green commented 9 years ago

Found the workaround in the related issue:

https://github.com/GM-Alex/vagrant-winnfsd/issues/12

The problem is a bug with winnfsd. It relates to the length of the path you are sharing, set up your shares in length ascending order and all appears to work correctly.

nicocrm commented 9 years ago

I had the same thing - first machine boots and loads shared folders fine but the second one gets:

mount.nfs: access denied by server while mounting 192.168.55.1:/C/HOST_SHARE_PATH_HERE

However once I kill winnfsd and reload the VM it works fine. What happened is winnfsd was only started the first time, when the second VM booted it edited the winnfsd configuration but saw it was already running so didn't restart it. On subsequent boots the folders were already defined as shared so it worked without needing to kill winnfsd. The shared folders are stored in C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.2\nfspaths, if you need to review / edit them.

mablae commented 8 years ago

@nicocrm I am running into the same issue, but it seems every boot of a VM now replaces all entries in the nfs shares every time?

Why is this all so hard?

adsc-cloudtec commented 8 years ago

@nicocrm and @mablae are right, you CAN switch machine by halting the old one, killing winnfsd and upping the new one, but you CAN'T run two machines at the same time with different shares. The shares are always replaced, which means that the old machine will have the same mounts as the new one.

marcharding commented 8 years ago

Since v1.2.0 you can run multiple vm side by side.

adsc-cloudtec commented 8 years ago

@marcharding Great news, thanks a lot!