Problem with iConsole.Powerup on Windows Server 2012

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
samma
Posts: 3
Joined: 21. Nov 2014, 07:39

Problem with iConsole.Powerup on Windows Server 2012

Post by samma »

Hello.
I develop on C++.
I can successfully execute a process with IConsole.Powerup on Windows 7,Windows 8,Windows Server 2008, but when I use it on Windows Server 2012, an erorr occures. I have tried different issues of Windows 2012. It's the same problem.
I use the method IConsole.Powerup API (version - 4.3.12). The error I get:
Unhandled exception at 0x00007FFABAACED9C(ntdll.dll) in ***.exe:0xC0000028

Please help to solve this problem.
Thanks.
noteirak
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: Problem with iConsole.Powerup on Windows Server 2012

Post by noteirak »

Can you please provide a sample code?
habe you tried with the latest Virtualbox version? 4.3.12 is not exactly young anymore.
Finally, are you sure you disable Hyper-V?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
samma
Posts: 3
Joined: 21. Nov 2014, 07:39

Re: Problem with iConsole.Powerup on Windows Server 2012

Post by samma »

thank you.
I just tried 4.3.18,no error information, but still can not run.
Hyper-V is disabled.
Here is sample code:

Code: Select all

STATUS CVirtualMachine::
	CreateVMSession ()
{
	const int MAX_CONSOLE_EVENTS = 4;
	CComPtr<ISession> pSession_;
	CComSafeArray<int> Interestings(MAX_CONSOLE_EVENTS, 0);
	HRESULT hResult = E_FAIL;

	try{

		Interestings[0] = VBoxEventType_OnMouseCapabilityChanged;
		Interestings[1] = VBoxEventType_OnMousePointerShapeChanged;
		Interestings[2] = VBoxEventType_OnKeyboardLedsChanged;
		Interestings[3] = VBoxEventType_OnAdditionsStateChanged;

		hResult = pSession_.CoCreateInstance (CLSID_Session, 
			NULL, CLSCTX_INPROC_SERVER);

		if (not pSession_)
		{
			throw std::runtime_error("[*FAILED*] Create instance of session of VM.");
		}

		CComPtr<IMachine> _Machine(m_pVMMachine);

		hResult = _Machine->LockMachine (pSession_, LockType_VM);

		if (SUCCEEDED(hResult))
		{
			HRESULT hResult = S_OK;

			hResult = pSession_->get_Console(&m_pVMConsole);
			hResult = m_pVMConsole->get_Guest(&m_pVMGuest);
			hResult = m_pVMConsole->get_Display(&m_pVMDisplay);
			hResult = m_pVMConsole->get_Mouse(&m_pVMMouse);
			hResult = m_pVMConsole->get_Keyboard(&m_pVMKeyboard);
			hResult = m_pVMConsole->get_EventSource(&m_pVMEventSource);
		}
		else
		{
			return CC_E_UNSUCCESSFUL;
		}

		hResult = m_pVMEventSource->RegisterListener(this, 
			static_cast<LPSAFEARRAY>(Interestings), TRUE);

		assert(SUCCEEDED(hResult));

		hResult = m_pVMDisplay->SetFramebuffer(0, this);
		assert(SUCCEEDED(hResult));

		pSession_.CopyTo(&m_pVMSession);

		HRESULT hr = E_UNEXPECTED;
		CComPtr<IProgress> Progress;

		hr = m_pVMConsole->PowerUp(&Progress);

		Progress->WaitForCompletion(-1);
	}
	catch(...)
	{
		return CC_E_UNSUCCESSFUL;
	}

	return CcHResultToStatus(hResult);
}
Last edited by noteirak on 22. Jun 2016, 18:20, edited 1 time in total.
Reason: Added code tag
samma
Posts: 3
Joined: 21. Nov 2014, 07:39

Re: Problem with iConsole.Powerup on Windows Server 2012

Post by samma »

Any one has any suggestions ?
noteirak
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: Problem with iConsole.Powerup on Windows Server 2012

Post by noteirak »

Do you have a specific need to actually handle the VM process yourself? (by using the LockType.VM)
If you do, then I can only advise to go on the dev mailing list or in the IRC dev channel - this is a very technical question and you'll get the fastest answer on that channel.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
teenccu
Posts: 5
Joined: 22. Jun 2016, 18:14

Re: Problem with iConsole.Powerup on Windows Server 2012

Post by teenccu »

Hello Samma,

Currently I m facing same kind of problem. Was wondering if u got any solution for this?
Post Reply