I could not ProcessCreate on XP virtual machine,
so I installed Win7 with the same problem.
I'm running on Win 10.
C++ COM API IGuest->CreateSession/ProcessCreate
-
- Oracle Corporation
- Posts: 283
- Joined: 19. May 2008, 16:09
- Primary OS: Ubuntu other
- VBox Version: PUEL
- Guest OSses: Too many to specify!
- Contact:
Re: C++ COM API IGuest->CreateSession/ProcessCreate
Just had a quick peek at the details provided.
It looks like the Guest Additions and the VBoxService inside the guest are installed correctly.
This error, however, looks like you didn't specify a password for the user you're trying to use with Guest Control:
It looks like the Guest Additions and the VBoxService inside the guest are installed correctly.
This error, however, looks like you didn't specify a password for the user you're trying to use with Guest Control:
Did you try to specify a password for the guest user and restarted the guest afterwards?VBoxManage.exe: error: The specified user was not able to logon on guest
VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestSessionWrap, interface IGuestSession, callee IUnknown
VBoxManage.exe: error: Context: "WaitForArray(ComSafeArrayAsInParam(aSessionWaitFlags), 30 * 1000, &enmWaitResult)" at line 938 of file VBoxManageGuestCtrl.cpp
Re: C++ COM API IGuest->CreateSession/ProcessCreate
Dear Pentagonik,
your notice is very crucial!
with correct password and username provided - now makes GuestSession->ProcessCreate to start process in guest VM!
However the application on guest machine runs in hidden mode! e.g. it is visible only in Task Manager as running process and finally is killed by OS after some period.
Can you please suggest how to start application in guest machine as if it was started by user in GUI mode? In other words - visible in VirtualBox frame.
here is my code
However it does not matter what CreateFlags i'm providing, application starts as hidden and eventually disappears.
thank you very much!!!!
Max to you too!!!
your notice is very crucial!
Code: Select all
Guest->CreateSession
with correct password and username provided - now makes GuestSession->ProcessCreate to start process in guest VM!
However the application on guest machine runs in hidden mode! e.g. it is visible only in Task Manager as running process and finally is killed by OS after some period.
Can you please suggest how to start application in guest machine as if it was started by user in GUI mode? In other words - visible in VirtualBox frame.
here is my code
Code: Select all
CComSafeArray<VARIANT> aCreateFlags(2);
aCreateFlags[0] = ProcessCreateFlag_WaitForProcessStartOnly;
aCreateFlags[1] = ProcessCreateFlag_IgnoreOrphanedProcesses;
p_GuestSession->ProcessCreate( SysAllocString(L"C:\\TestMonitor\\TestMonitor.exe"), NULL, NULL, aCreateFlags, 10000, p_GuestProcess );
thank you very much!!!!
Max to you too!!!
-
- Site Moderator
- Posts: 5229
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: C++ COM API IGuest->CreateSession/ProcessCreate
pentagonik saved the day thank you to him - I completely skipped that line.
As for the program not starting on the desktop, that is because the guest session initiated by VirtualBox is NOT the same as yours GUI one. It is a different, independant user session (context if you wish) and by default will not mix.
This is the same kind of issue as showing a GUI application in the GUI when started from Task Manager.
I personally do not know how to solve it on Windows...
As for the program not starting on the desktop, that is because the guest session initiated by VirtualBox is NOT the same as yours GUI one. It is a different, independant user session (context if you wish) and by default will not mix.
This is the same kind of issue as showing a GUI application in the GUI when started from Task Manager.
I personally do not know how to solve it on Windows...
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
Re: C++ COM API IGuest->CreateSession/ProcessCreate
Hi Max,
after ProcessCreate i'm doing
and the application appears in VBox GUI frame for about 5 seconds - can see it my own eyes.
But afterwards it is killed by OS. In the same time my GuestProcess->WaitFor still waits for 30 seconds to complete.
If i use ProcessWaitForFlag_Start flag, then my GuestProcess->WaitFor is waiting for about 5 sec and exits, but there is no GUI application started is visible.
thank you supporting!
after ProcessCreate i'm doing
Code: Select all
ProcessWaitResult aReason;
rc = GuestProcess->WaitFor( ProcessWaitForFlag_Terminate, 30000, &aReason );
But afterwards it is killed by OS. In the same time my GuestProcess->WaitFor still waits for 30 seconds to complete.
If i use ProcessWaitForFlag_Start flag, then my GuestProcess->WaitFor is waiting for about 5 sec and exits, but there is no GUI application started is visible.
thank you supporting!
- Attachments
-
- ProcessCreate.jpg (84.21 KiB) Viewed 9239 times
Re: C++ COM API IGuest->CreateSession/ProcessCreate
I want to add.
I made the same test on Win XP, and ProcessCreate with successful Guest->CreateSession started to work when i added implicit password in OS
for the User account. WinXP allows to have user account without password, but Guest->CreateSession logs in correctly when password provided.
but running application has the same effect as on Win 7, application starts and shuts down after 5 seconds.
I made the same test on Win XP, and ProcessCreate with successful Guest->CreateSession started to work when i added implicit password in OS
for the User account. WinXP allows to have user account without password, but Guest->CreateSession logs in correctly when password provided.
but running application has the same effect as on Win 7, application starts and shuts down after 5 seconds.
-
- Site Moderator
- Posts: 5229
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: C++ COM API IGuest->CreateSession/ProcessCreate
Can you try to start it via vboxmanage and see what happens? you would do something like this which is just a replica of what you do with the API:
See here for a detailed list of arguments
Code: Select all
vboxmanage guestcontrol <vm> --username <user> --password <password> run <add more options> -- /path/to/exec arg1 arg2
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!