VMware {code} Community
KevenGunwall
Contributor
Contributor

Getting returns from vmrun from guest

How do you get output from a vmrun.exe runProgramInGuest session without having the app/script on the local machine save to a file and pull that file back and cat it? Is there a way to get the STDERR or STDOUT piped back?

Keven

0 Kudos
3 Replies
lamw
Community Manager
Community Manager

no. The only way I know of is to basically output the data onto a file locally on the guest and extract it out to get the data. I'm hoping this might be either a feature request or fix in a future release of VIX to be able to directly get the output to stdout when using vmrun

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
admin
Immortal
Immortal

This is a very requested feature, and I completely agree it would be useful, but it is pretty hard to do in a generic way. The communications channel between the host and the guest is not very stream-oriented, so supporting arbitrary results get complicated.

Basically, what to do if the user runs

vmrun runProgramInGuest "/my/vm.vmx" tail -f /var/log/mylog.log

There's an 80/20 solution that is to capture something like the first KB of output, and ignore anything after that.

So, as a question to VIX users, would that suffice for your needs? Would you ever feel comfortable putting an upper bound on the amount of output you'd need to see?

0 Kudos
lamw
Community Manager
Community Manager

I agree, if it was easy, I would have hoped it would have been implemented already Smiley Wink

I'm just speaking for myself, but what if VMware handled the execution of some command/script and auto-magically handles the output and returns that back to the user seamlessly? With guest customization and VMware Tools installation, you're already performing operations within the guest, why not with this feature so long as authentication has been provided.

I'm hoping that more goes into the VIX API to get better guest customization, especially in the Solaris/Linux customization where it's lacking compared to Windows sysprep. I'm thinking VIX could be a way to fill that gap w/o having to add additional modules since you now have direct access to the guest system.

Just few thoughts Smiley Happy

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos