-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forwarded ports not being released with VMWare Fusion 8.5.3 #8130
Comments
I'm also seeing this with Libvirt on Fedora 25, vagrant version My workaround is to |
Adding my voice to @amacnamara I am also seeing this behaviour on Vagrant 1.8.7 and VMware Fusion 8.5.3. To work around I am manually clearing out the nat.conf file and restarting vmnet-cli which is a complete pain. |
Same issue for me with Vagrant 1.9.1 and VMware Fusion 8.5.3, though rebooting my Mac seems to allow a VM to boot. When a VM doesn't boot, it hangs at either "Waiting for machine to boot..." or "SSH auth method: private key". The workaround mentioned by @Moncky usually works for me too:
|
this issue is also happening in OS X 10.11.6 |
Had the same issue and chronon/moncky approach worked for a while but stopped working...I think I tried to stop vagrant up with control-c. I was able to get it work again by:
|
For reference, this issue appears to be a duplicate of #7948. |
This should be resolved within the latest vagrant vmware plugin release. Cheers! |
Seem's I'm late to the party. Just encountered that problem, all ports up to 2250 are occupied, using Vagrant 1.9.2 + vagrant-vmare-fusion 4.0.17 |
@StefanScherer Hi! If there are old untagged port forward entries in the nat.conf file they will need to be cleaned out manually. After that they should not be lost again with the latest version of the plugin. If you have any problems please do let me know. Cheers! |
@chrisroberts I found this issue whilst attempting to debug a problem I'm having here with version 4.0.18 of the vagrant-vmware-fusion plugin. I have three boxes configured, and just one running. I
to
It looks to me like the vagrant tags are being removed from the config file, but the NAT config itself remains. |
@jtopper Is that port forward being explicitly defined in the Vagrantfile? When you run |
@chrisroberts: We're actually generating the port number programatically based on the PID and some randomness, so it'll never collide in that way. The same Vagrantfile is used in our CI environment where we run multiple vagrants simultaneously, and this helps us avoid a concurrency issue. Assuming the port number is always subsequently obtained from vagrant's state files (which does seem to be the case generally) we don't get into trouble with subsequent runs of the command finding the wrong PID - though it's plausible we're hitting an edge case here. What seems to happen is that after destroying and bringing up the box, the process hangs on
In the VMWare Fusion console, I can see that the box starts, but none of the networking comes up. Removing the NAT entries and restarting the vmware-cli seems to solve the problem to the point where boxes start properly again. I seem to recall that in this case, a |
@jtopper Can you clear out the |
@chrisroberts I hit ^C on this one eventually. https://gist.github.com/jtopper/2d3243db8fdc847d61aec0e208c81d12 (Sorry, that's a bit cluttered by the fact there are more boxes defined in the Vagrantfile and I forgot to constrain the run to just one of them - seems not to have got as far as trying to start the other two though) |
@jtopper when the VM is up, can you connect via the UI? From the log it looks like it's failing to acquire an IP address. Does the guest have any error information within the logs and can you manually enable the networking in the guest? Thanks! |
@chrisroberts When the VM is up, I can open a console in the UI. eth0 and eth1 are both up, but neither has picked up an IP using DHCP. Restarting networking in the guest doesn't help. At this point,
It looks to me a lot like destroying the other VM is stopping vmnet. On manually starting vmnet and then restarting networking in the guest, the guest gets an IP address. My suspicion here is that the nat.conf entries are a red herring - the issue seems to be with vmnet. |
Interesting. I'll get a comparable setup running locally to see if I can replication the behavior. Are there any other interactions happening with VMware outside of Vagrant? |
Nothing else is touching VMware on this host. Actually having said the nat.conf entries are a red herring, I'm going to backtrack on that. I can only reliably start a VM if there are no entries in the incomingtcp section. Thereafter that file looks like:
and After running a
Again, On a subsequent
then we get
and the |
@chronon thanks that helped |
This problem is still apparent with v4.0.19 of the plugin. |
For unknown reasons I still have the problem with Vagrant 1.9.7, vagrant-vmware-fusion (4.0.22), VMware Fusion Pro 8.5.8 so I had to google this solution above again. 😬 |
Getting same issue on Vagrant 2.0.0 |
Adding this line worked for me... till I reach 2999 I guess :\ config.vm.usable_port_range = 2200..2999 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Vagrant version
Vagrant 1.9.1
Host operating system
macOS 10.12.1 (16B2659)
Guest operating system
Red Hat Enterprise Linux Server release 6.7 (Santiago)
Vagrantfile
Expected behavior
When the machine is shut down, the forwarded ports should be freed up to be used by other vms. The port forwarding entries in /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf should be removed.
Actual behavior
The port forwarding entries in /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf are not removed. Vagrant catches and fixes the port collisions for the ssh port, which grabs another port to be used. Eventually, there are a lot of extra entries in nat.conf:
This also causes other forwarded ports to collide, preventing vagrant up from running. In the above Vagrantfile example, port 7001 is set up in nat.conf, then never released, so subseguent vagrant ups fail.
Steps to reproduce
The text was updated successfully, but these errors were encountered: