I would like to change the network connection back and forth via windows command shell script, I found the vmrun command can change the ethernet settings, such as:
C:\> vmrun -T ws writevariable MRU1.vmx runtimeconfig ethernet1.pvnid "52 46 86 46 ad af 49 c4-7d af b1 ed 0f 96 c6 1c"
C:\> vmrun -T ws writevariable MRU1.vmx runtimeconfig ethernet1.pvnid "52 35 34 89 e3 d2 ba 36-5e 67 63 c9 ec 4d d2 60"
C:\> vmrun -T ws writevariable MRU1.vmx runtimeconfig ethernet1.pvnid "52 a7 07 39 53 27 d4 b3-92 04 6e 1c 67 a4 8e d6"
C:\> vmrun -T ws writevariable MRU1.vmx runtimeconfig ethernet1.pvnid "52 2a cb cd dc 56 e9 44-bf f2 a6 33 67 bc dc bc"
when I read it back via vmrun readvariable command, it shows the writevariable command executed correctly.
but the network packet didn't redirected to new LAN segment. it still stays at the old one.
If I use the GUI to change the LAN segment, it works perfectly. But I need to use script to do it so that I can automate the test.
What am I missing?
Just an idea ....
Try to disable the nic first. Then change the pvnID. Then re-enable the nic.
This won't work. Because:
1. I don't want to touch the virtual machine.
2. I run ifconfig em0 down; ifconfig em0 up in VM, but still not working.
Just an idea,
Try:
ifup emo