I want to change the network adapter of a guest virtual machine using esxcli, vcli or any other cli means.

I couldn't find an esxcli command, which is expected as its scope is primarily the host.

I installed vcli on a Windows 7 system and tried vmware-cmd but it has another function (connect/disconnect) and I even couldn't make that work.

I haven't tried PowerCLI Cmdlets nor editing the vmx file directly (as this would have unexpected results on a running vm, I assume) yet.

I couldn't find any other commands to perform this simple task.

I'm interested in solutions on both, Linux and Windows — or some Linux command that also runs on cygwin or similar.

| improve this question | | | | |
  • Why do you need to do this? – ewwhite Jun 11 '16 at 23:49
  • @ewwhite, lab automation, to connect vm to different networks on different setups. – 1.61803 Jun 12 '16 at 9:16
  • For now, the only thing I can think of, is powering-off the VM, writing the new network label on the vmx file and restarting it. – 1.61803 Jun 29 '16 at 20:27

I am not sure why you have not tried using PowerCLI, that would be the easiest and fastest way to do that. You can change the network adapter from connected to disconnected, change the network label (vLAN), or remove it all together. From all the times I have used this I have not come across any adverse effects on the VM's.

| improve this answer | | | | |
  • Let's say, that I'm more interested in a somewhat platform-independent solution — or rather, something that would run on *nix, that I could also run on Windows via cygwin. – 1.61803 Jun 29 '16 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.