VMware {code} Community
TheVMinator
Expert
Expert
Jump to solution

Configuring Output from vmrun runProgramInGuest

Hello,

I am using vmrun to run an MSDOS batch file inside a Windows vm as follows:

vmrun -T vc -h https://<vcenterservername>:443/sdk -u username -p password -gu Administrator -gp administratorpassword runProgramInGuest "[datastoreLUNname] vmfoldername/vmname.vmx" C:\batchfilename.bat

So this code works - I start if from my Windows XP laptop and it starts a batch file runnining inside a Windows virtual machine. However, the output displays inside the virtual machine and not at the command line of tmy Windows xp laptop - where I need it to display. As each line of the MSDOS file executes inside the Windows VM, I need the output directed to my WindowsXP laptop so I can confirm each command is successful. Can this be done?

thanks

Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

You have your script redirect its output to a file, then use the `copyFileFromGuestToHost` command to copy the file to your laptop, where you can echo the output file to the console to display it.

View solution in original post

Reply
0 Kudos
2 Replies
stanguturi
VMware Employee
VMware Employee
Jump to solution

No. It is not possible to capture the output of a command executed inside the virtual machine and display it on the console using vmrun.

-Thanks

Sankar.

admin
Immortal
Immortal
Jump to solution

You have your script redirect its output to a file, then use the `copyFileFromGuestToHost` command to copy the file to your laptop, where you can echo the output file to the console to display it.

Reply
0 Kudos