The tool you're looking for is the VIX API, which lets you do what you need inside of a guest.
In this case, you'll want the VixVM_RunScriptInGuest method (that's what it's called in the C version of the API; if you choose to use the Perl or COM versions, there will be a similarly named method that does the same thing).