IGuest.getProcessOutput returns nothing...?
Posted: 3. Jun 2012, 00:18
Hi there,
I'm currently trying to start a process in my VM (Windows 7 x86) from the host system (Ubuntu x64) and read its stdout using the C++ VirtualBox API.
I managed the first part (starting the process), but the second (reading stdout) won't work for me.
The problem ist, that the method IGuest.getProcessOutput always returns an empty buffer and zero bytes read. Additionally, even the stdout in the guest system stays empty!
I double checked with starting a simple console programm which does nothing else then writing a single line of text to stdout every second.
When starting with:
- vboxmanage guestcontrol execute: stdout stays emtpy
- C++ API IGuest: stdout stays empty
- manually (directlly in the guest system): works as expected, writes to stdout, visible in console
My code (snippet):
After executing this, actualSize is always 0 while rc is always OK (0, too).
Can anyone provide some hints or insight on this? Much appreciated!! =)
VirtualBox Version: 4.1.16
I'm currently trying to start a process in my VM (Windows 7 x86) from the host system (Ubuntu x64) and read its stdout using the C++ VirtualBox API.
I managed the first part (starting the process), but the second (reading stdout) won't work for me.
The problem ist, that the method IGuest.getProcessOutput always returns an empty buffer and zero bytes read. Additionally, even the stdout in the guest system stays empty!
I double checked with starting a simple console programm which does nothing else then writing a single line of text to stdout every second.
When starting with:
- vboxmanage guestcontrol execute: stdout stays emtpy
- C++ API IGuest: stdout stays empty
- manually (directlly in the guest system): works as expected, writes to stdout, visible in console
My code (snippet):
Code: Select all
PRUint32 pid = <set prior>
// ### read process output
const PRUint32 processFlags = 0; // Should not be used! (according to documentation)
const PRUint32 timeoutMS = 0;
const PRInt64 readLength = 500; // bytes to read
PRUint32 actualSize;
PRUint8 * buffer;
nsresult rc = guest->GetProcessOutput(pid, processFlags, timeoutMS, readLength, &actualSize, &buffer);
Can anyone provide some hints or insight on this? Much appreciated!! =)
VirtualBox Version: 4.1.16