VMware Cloud Community
romi
Contributor
Contributor

Does anyone know?

Hi,

i want to add a network adapter to esx guest through command line.

Does anyone know?

Thanks in advance.

0 Kudos
6 Replies
Dave_Mishchenko
Immortal
Immortal

Try the following:

1) Unregister the VM with vmware-cmd -s unregister

2) edit the VMX file for the VM and add these 3 lines. I'm assuming that your current VM only have 1 NIC (ethernet0) defined. You'll also have to substitute in a valid network name.

ethernet1.present = "true"

ethernet1.networkName = ""

ethernet1.addressType = "vpx"

3) Reregister the VM with vmware-cmd -s register.

When you start up the VM a MAC address will be generated for the VM.

0 Kudos
Vadimbars
Contributor
Contributor

Hello,

We accidentally delete all network adapters from ESX 3.5 host...

As result, now I can't connect via Ethernet to this host.

What I can do for resolve this problem?

Tell my please,

How I can add vswitch and network adapters on ESX 3.5 host via local console?

What is a comands set?

Thanks a lot!

0 Kudos
mcowger
Immortal
Immortal

esxcfg-vswitch and esxcfg-vswif






--Matt

VCP, vExpert, Unix Geek

--Matt VCDX #52 blog.cowger.us
0 Kudos
NTurnbull
Expert
Expert

Hi, first thing is that this might take a little bit of trial and error depending how many vswitches and ethernet ports you have. To add a physical nic (uplink) to a vswitch from the command line you can use the command esxcfg-vswitch -L vmnic vswitch usually your vmkernel will be on vswitch0 and it'll be connected via vmnic0, but if you have multiple vswitches then increment the number . The vmnic where x is a number starting at 0 and increasing in line with how many physical ethernet ports you have. if you don't have any joy with esxcfg-vswitch -L vmnic0 vswitch0 then just cycle through the vswitch numbers and vmnic numbers.

Or if you have another ESX host with identical configuration then look at the uplink vmnic numbers and the vswitch number and that will give you the parameters for the esxcfg-vswitch command you need to run.

Thanks,

Neil

Thanks, Neil
0 Kudos
Amnexi
Enthusiast
Enthusiast

I think

NTurnbull's is the good answer, that's what I was going to answer!!! Smiley Happy)

I just add the following: for looking other ESX's configuration (the best way), run esxcfg-vswitch -l (low case L)

And: if recreating the uplink ports (-L) doesn't work, a clue: vswif represents the Service Console...

Goog luck!

0 Kudos
bulletprooffool
Champion
Champion

esxcfg-vswitch and esxcfg-vswif should do all you need, though if you can get to the console, you should be able to use the simple BIOS style GUI to add the management address details and then simply connect to the management address using the Client.

One day I will virtualise myself . . .
0 Kudos