VMware Communities
diojen
Enthusiast
Enthusiast
Jump to solution

Can I access network information and can I configure it like vmx file?

Hi All,

I can start the machine with vmrun by configuring the vmx file I want, but I can't make network settings.

I can only make these network settings:

ethernet0.present= "true"

ethernet0.startConnected = "true"

ethernet0.virtualDev = "e1000"

ethernet0.connectionType = "custom"

ethernet0.vnet = "vmnet..."

But before I start the machine I want to configure the IP address, subnet mask, default gateway, DNS server settings.

Can I access network information and can I configure it like vmx file?

thanks

1 Solution

Accepted Solutions
wila
Immortal
Immortal
Jump to solution

Hi,

Yes and No.

No you cannot set the IP address of a VM directly.

Yes, you could do this if you set the VM network type to NAT and then edit the NAT config file to generate a specific IP address for a specified MAC address.

That MAC address would have to be the same MAC address as in the .vmx file.

The VM would then set its network settings on boot via DHCP.

See also:

Editing the NAT Configuration File

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva

View solution in original post

4 Replies
wila
Immortal
Immortal
Jump to solution

Hi,

Yes and No.

No you cannot set the IP address of a VM directly.

Yes, you could do this if you set the VM network type to NAT and then edit the NAT config file to generate a specific IP address for a specified MAC address.

That MAC address would have to be the same MAC address as in the .vmx file.

The VM would then set its network settings on boot via DHCP.

See also:

Editing the NAT Configuration File

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
diojen
Enthusiast
Enthusiast
Jump to solution

Hi Wil,

No settings like NAT for host-only and bridged, right?

And i have one more small question. Can I add a network via a script code? Is there a file where virtual network editor information is stored?

Thank you very much, I was expecting exactly such an answer.

0 Kudos
wila
Immortal
Immortal
Jump to solution

Hi,

The settings I was referring towards depend on the integrated DNS/DHCP server that VMware Workstation uses.

If my memory serves me well then VMware just uses dnsmasq for this, for more info see:

Welcome to www.thekelleys.org.uk

Besides NAT, this would also work for host only, as of course there the host also hands out IP addresses for VMs if needed.

On bridged networks you would depend on an external DHCP server if you use DHCP in that network.

You are correct that the virtual networking config is stored in a plain text file. I'm not exactly sure how though. You would have to experiment a bit with the network editor and see what it creates.

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
bluefirestorm
Champion
Champion
Jump to solution

You may want to look at C:\ProgramData\VMware\vmnetdhcp.leases (for Windows). Most likely file has the same name in Linux hosts but obviously would be a different directory name.

You could effectively make a pseudo DHCP reservation by editing this file based on MAC address for both NAT and host-only VMnet.

As for bridged network VMs, you should look at the DHCP server to configure DHCP reservations based on MAC address. Most WiFi routers that have DHCP capability also allow for DHCP reservations based on MAC address.