Vmrun return all IPs for running VMs: Difference between revisions

From VI-Toolkit
Jump to navigation Jump to search
m (tidied it up a little bit)
No edit summary
 
Line 13: Line 13:


http://communities.vmware.com/message/1087204#1087204
http://communities.vmware.com/message/1087204#1087204
[[Category: VIX]]

Latest revision as of 20:02, 20 December 2008

Return all IPs for running VMs

If you want to do this through vmrun on VMware Server 2, then you can do the following:

vmrun -T server -h https://myserver/sdk -u root -p passwd -gu root -gp passwd runProgramInGuest "[standard] test/SLES10sp1.vmx" /bin/sh "/sbin/ifconfig > /tmp/ip-info.txt"
vmrun -T server -h https://myserver/sdk -u root -p passwd -gu root -gp passwd copyFileFromGuestToHost "[standard] test/SLES10sp1.vmx" /tmp/ip-info.txt /host/path/ip-info.txt"
vmrun -T server -h https://myserver/sdk -u root -p passwd -gu root -gp passwd deleteFileInGuest "[standard] test/SLES10sp1.vmx" /tmp/ip-info.txt

This will redirect the output of ifconfig to a file on the guest, then copy that file to the host. It also cleans up the file, just to be tidy.


See also:

http://communities.vmware.com/message/1087204#1087204