Sunday 15 June 2014

ethernet - How to set eth0 MAC address in Vagrant with the VMware provisioner? -



ethernet - How to set eth0 MAC address in Vagrant with the VMware provisioner? -

vagrant relies on vmware (workstation , fusion) generate mac address of eth0 (the first , default ethernet interface) on invitee beingness deployed box.

i prepare mac address static , not regenerated each time vm recreated vmware dhcp service can assign same ip address each time.

first create sure vmware dhcp service assign ip address specified mac address editing vmnetdhcp.conf has different locations depending on os. place entry @ end of file replacing hostname, mac , ip desired values:

host hostname { hardware ethernet 00:0a:aa:aa:aa:aa; fixed-address 192.168.1.1; }

restart vmware dhcp service load these changes.

in vagrantfile utilize next settings configure default network interface:

vagrant.configure("2") |config| config.vm.define 'hostname' |hostname| hotname.vm.box = box hostname.ssh.host = '192.168.1.1' puppet.vm.provider :vmware_fusion |v, override| v.vmx['ethernet0.addresstype'] = 'static' v.vmx['ethernet0.address'] = '00:0a:aa:aa:aa:aa' end puppet.vm.provider :vmware_workstation |v, override| v.vmx['ethernet0.addresstype'] = 'static' v.vmx['ethernet0.address'] = '00:0a:aa:aa:aa:aa' end end end

next time virtual machine brought vagrant up assigned static mac , recieve same ip address dhcp.

other vmx keys manipulated ethernet0 using method.

vagrant ethernet mac-address vmware-workstation vmware-fusion

No comments:

Post a Comment