Skip to content
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

Can not set static IP for VM when use VMware Fusion plugin #5134

Closed
athirn opened this issue Jan 7, 2015 · 11 comments
Closed

Can not set static IP for VM when use VMware Fusion plugin #5134

athirn opened this issue Jan 7, 2015 · 11 comments

Comments

@athirn
Copy link

athirn commented Jan 7, 2015

I want the fusion VM that Vagrant creates to have a static IP from the LAN that the computer as attached to. If I set networking to be public_network and specify an IP, the VM still uses DHCP. I'm using Vagrant 1.7.2 and vmware-fusion 3.2.0.

Here is the Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "1vq9/trusty64"

  config.vm.define :dev do |box|
    box.vm.hostname = "dev"
    box.vm.network "public_network", ip: "192.168.18.200"

    box.vm.provider "vmware_fusion" do |v|
      v.vmx["vhv.enable"] = "TRUE"
      v.vmx["allowNested"] = "TRUE"
    end
  end

end

when I do a vagrant up the VM does not have the static IP but one from DHCP instead

eth0      Link encap:Ethernet  HWaddr 00:0c:29:66:cd:54
          inet addr:172.16.178.147  Bcast:172.16.178.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe66:cd54/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:937 errors:0 dropped:0 overruns:0 frame:0
          TX packets:654 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:107362 (107.3 KB)  TX bytes:93880 (93.8 KB)

eth1      Link encap:Ethernet  HWaddr 00:0c:29:66:cd:5e
          inet addr:192.168.19.67  Bcast:192.168.19.255  Mask:255.255.254.0
          inet6 addr: fe80::20c:29ff:fe66:cd5e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:218 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20240 (20.2 KB)  TX bytes:1454 (1.4 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
@athirn
Copy link
Author

athirn commented Jan 7, 2015

I've tried this with the virtualbox provider and it is able to set a static IP. One interesting thing is that with virtualbox it asks me to select which interface to use but on vmware_fusion it does not.

When I use VAGRANT_LOG=debug I get a lot of output but this part looks like its relevant

Started DHCP service on vmnet1
Started NAT service on vmnet8
Enabled hostonly virtual adapter on vmnet8
Started DHCP service on vmnet8
Started all configured services on all networks

Hostonly virtual adapter on vmnet1 is enabled
DHCP service on vmnet8 is running
NAT service on vmnet8 is running
Hostonly virtual adapter on vmnet8 is enabled
All the services configured on all the networks are running

DEBUG subprocess: stderr:  INFO networking_file: Reading adapters from networking file...
DEBUG subprocess: stderr: DEBUG networking_file: VNET: 1. KEY: 'DHCP' = 'yes'
DEBUG subprocess: stderr: DEBUG networking_file: VNET: 1. KEY: 'DHCP_CFG_HASH' = '4658316A9466097059AED5370143E85188797F39'
DEBUG networking_file: VNET: 1. KEY: 'HOSTONLY_NETMASK' = '255.255.255.0'
DEBUG networking_file: VNET: 1. KEY: 'HOSTONLY_SUBNET' = '172.16.72.0'
DEBUG networking_file: VNET: 1. KEY: 'VIRTUAL_ADAPTER' = 'yes'
DEBUG networking_file: VNET: 8. KEY: 'DHCP' = 'yes'
DEBUG networking_file: VNET: 8. KEY: 'DHCP_CFG_HASH' = 'BB62214BBF3C519E306B342C798D701E52EBBC61'
DEBUG subprocess: stderr: DEBUG networking_file: VNET: 8. KEY: 'HOSTONLY_NETMASK' = '255.255.255.0'
DEBUG networking_file: VNET: 8. KEY: 'HOSTONLY_SUBNET' = '172.16.178.0'
DEBUG networking_file: VNET: 8. KEY: 'NAT' = 'yes'
DEBUG networking_file: VNET: 8. KEY: 'VIRTUAL_ADAPTER' = 'yes'
DEBUG subprocess: stderr: DEBUG networking_file: Pruning adapters that aren't actually active...
DEBUG subprocess: stderr: DEBUG vmware_driver: Testing route: 172.16.72.0 expects {:name=>"vmnet1", :number=>1, :dhcp=>"yes", :hostonly_netmask=>"255.255.255.0", :hostonly_subnet=>"172.16.72.0", :nat=>nil, :virtual_adapter=>"yes"}
DEBUG subprocess: stderr: DEBUG vmware_driver: Testing route: 172.16.178.0 expects {:name=>"vmnet8", :number=>8, :dhcp=>"yes", :hostonly_netmask=>"255.255.255.0", :hostonly_subnet=>"172.16.178.0", :nat=>"yes", :virtual_adapter=>"yes"}
DEBUG subprocess: stderr:  INFO vmware_driver: Stopping services starter...
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31996
DEBUG subprocess: Exit status: 0

@phinze
Copy link
Contributor

phinze commented Jul 10, 2015

Hi @athirn - I believe this issue should be fixed in recent versions of the VMware plugin. If you're still having issues with the most recent version, feel free to email support@hashicorp.com and we can figure it out together! 👍

@phinze phinze closed this as completed Jul 10, 2015
@athirn
Copy link
Author

athirn commented Jul 10, 2015

thanks. will test it.

@quasiben
Copy link

Tried this today with Vagrant 1.7.4 and vagrant-vmware-fusion (4.0.2) on OSX and still seeing this issue

@phinze
Copy link
Contributor

phinze commented Nov 23, 2015

Hi @quasiben, if you haven't done so already, you can email support@hashicorp.com for VMware provider support. 👌

@quasiben
Copy link

@phinze, apologies. I did contact support -- it was a entirely my fault. Thanks for checking in.

@CaptTofu
Copy link

CaptTofu commented Dec 4, 2015

What was the issue? Have people found resolution with this? I upgraded, still no go

@phinze
Copy link
Contributor

phinze commented Dec 4, 2015

Hi @CaptTofu - can you write in to support@hashicorp.com with the behavior you're seeing? We can help you out with VMware provider issues there. 👍

@tobiajo
Copy link

tobiajo commented Jan 28, 2017

I still have this problem, works fine with virtualbox but not with vmware_fusion. How can one resolve this?

@djungowski
Copy link

I wrote in another bugticket how this might be related to vmx["ethernet0.pcislotnumber"] = "33" - see #10256 (comment)

@ghost
Copy link

ghost commented Jan 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants