DISQUS

ProfessionalVMware: VMware VIX – Changing IP’s of a Guest VM

  • Ravi · 11 months ago
    i tried the above command replacing the respective gateway and ips .... it says "Error Unable to connect to host" ... Am i supposed to replace anything else in the command other than the IPs ???
  • professionalvmware · 11 months ago
    There is quite a bit that needs to get changed...See the bracketed parts below.

    vmrun -T esx -h [youresxhosthere] -u [esx user] -p [esx password] -gu [Guest User] -gp [Guest Password] runProgramInGuest “[Path] to/the.vmx” c:\windows\system32\netsh int ip set address “Local Area Connection” static 192.168.15.25 255.255.255.0 192.168.15.1
  • Medela metro bag · 5 months ago
    Thanks for the interesting post.
  • professionalvmware · 5 months ago
    No problem!
  • ClubPenguinCheats · 3 months ago
    Thanks for sharing it. This looks pretty interesting and I'll share it with my friends.
    I hope that we will see more from you.
  • professionalvmware · 3 months ago
    Indeed. Thanks!
  • animal72 · 1 week ago
    I get a message : can't find the VM
    Everything is fine, host connection works, every path settings are correct ... still it won't find the VMX file ...

    Thanks for helping me ... I'm quite stuck with it.
  • professionalvmware · 1 week ago
    Can you reply with the command line and error you are receiving?
  • animal72 · 1 week ago
    vmrun -T esx -h esxhostname -u root -p password -gu domain\user -gp password runProgramInGuest “/vmfs/volumes/lunname/file.vmx” c:\windows\system32\netsh int ip set address “Local Area Connection” static 10.0.0.10 255.255.255.0 10.0.0.1

    And the message is simply "can't find the VM" ... i first had host connection error, but solved it ... everything is ok except the VM can't be found.
  • professionalvmware · 1 week ago
    Check that the VM is powered on, and on the host you are connecting to. When
    specifying the host, use the path to the sdk, so https://hostname/sdk.
    Finally, instead of "vmfs/volumes/volume/vm.vmx" I'd use the name & path how
    they appear in the VI Client: "[Volume] vmname/vmname.vmx".

    Let me know how those changes work out.

    -C
  • animal72 · 1 week ago
    I already corrected the host part using https://hostname/sdk ... i'll try the "[volume] vmname/vmname.vmx" part. Should i add a / between [Volume] and vmname/vmname.vmx ?

    Thanks for your help.
  • professionalvmware · 1 week ago
    “[sanstorage1] test/test.vmx” is what I've used, so no additional / needed.
  • animal72 · 1 week ago
    Oki, thanks ... I'll get back to you. By the way ... is Powershell to be installed on the VM ? or can it run remotely from the virtual center ?
  • professionalvmware · 1 week ago
    Depends on what you are trying to do. The PowerCLI can be installed anywhere
    that can connect to your virtual center, and be used to manage it.

    -C
  • animal72 · 1 week ago
    i installed it on the VC and I just want to change my replicated VM's IP because my desaster recovery VLAN is different from the production one. I have no extended VLANs ... so basicaly I can't use VBS and have to do my changes through the VC and address the VM through the host ...

    If you have any other idea that may work in this context ... I take every advise on the subject.

    Goal is to change all my VMs IP starting from a matching table between the production IP / VMName / Destination IP.
    I also need to update the Gateway, Mask and DNS.
  • professionalvmware · 1 week ago
    The new PowerCLI should have something similar to what you are looking for.
    I'll likely write up a new post with this next week.

    -C
  • animal72 · 1 week ago
    I tried the command and here's the message :

    Error: Cannot open VM: [snap-30f94840-Cluster-A01-AMS2300-17] Par1CX4-09/Par1CX4
    -09.vmx, The virtual machine cannot be found

    The lun name is correct, so is the machine name, and the files are well present in the mentioned directory ...