VMware VIX – Changing IP’s of a Guest VM

December 12th, 2008 by bunchc

As a demonstration of the power of VIX, I’ve chosen to show you how to change IP addresses of a Windows VM. You may want to buckle up for this.

First, grab the VIX API installable from VMware’s site. In this case we’ll be using the Windows version (because that is the VM I happen to be writing this post from). The install is quick and puts all the files into “%PROGRAMFILES%\VMware\VMware VIX”.

Lets get our command prompt open:
2008-12-11_2236

Cool, now lets check the IP of our Windows VM:

2008-12-11_2313

Now, lets change it:

C:\Program Files\VMware\VMware VIX>vmrun -T esx -h https://esx.example.com/sdk -u nerv\cody.bunch -p apassword -gu Administrator -gp anotherpassword  runProgramInGuest “[sanstorage1] test/test.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

(That is all one line, the blog wrapped it)

Now for the lovely error!

2008-12-12_1214

Not rightly sure on that one. I’ve opened an SR for it. We’ll see how it goes.

Viewing 4 Comments

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus

RSS Feed