Bug 33986 - [XAP] Unable to load Device- VBoxManage Failed
Summary: [XAP] Unable to load Device- VBoxManage Failed
Alias: None
Product: Xamarin Android Player
Classification: Xamarin
Component: Device Manager ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-09-15 16:12 UTC by James
Modified: 2015-10-09 09:23 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Logs for XAP and VirtualBox (7.57 KB, application/zip)
2015-09-15 16:12 UTC, James
XAP logs from possibly same issue (83.57 KB, application/zip)
2015-09-15 16:52 UTC, Kent Green [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description James 2015-09-15 16:12:56 UTC
Created attachment 12904 [details]
Logs for XAP and VirtualBox

Customer is unable to launch Devices from the Device Manager. Gets a popup that states 

Failed to initialize device Nexus 5 (Lollipop).
VBoxManage command failed. See log for further details"

This is on a Windows 7 machine. Logs for both VirtualBox and Xamarin Android Player are attached.
Comment 1 James 2015-09-15 16:20:18 UTC
VirtualBox 4.3 and 5.0 have both been tested at different points. XAP installed 4.3 and customer did a reinstall of everything using 5.0
Comment 2 Kent Green [MSFT] 2015-09-15 16:46:47 UTC
I was a bit confused about comment 1, and asked James for a little clarification:

He stated the customer originally had VirtualBox 4.3 installed and it didn't work; and that they also tried VBox 5.0 and it still didn't work.
Comment 3 Kent Green [MSFT] 2015-09-15 16:52:33 UTC
Created attachment 12906 [details]
XAP logs from possibly same issue

From this desk case:

This customer seems to be hitting a very similar issue. Interestingly, they are running Windows 8.1 ; and they also noted the following:

"4.3.28.r100309 and it is “ok” (see below)
4.3.30 is available but doesn’t seem to work for me."

Because of the similarity of comment 1 where the customer tried both 4.3 & 5.0, I asked James to check with that customer about the minor version / try version 4.3.28 to see if it changes any symptoms.
Comment 4 James 2015-09-16 09:41:59 UTC
Issue was discovered to be that VT-x (intel virtualization) was disabled on the customer machine.
Comment 5 Kent Green [MSFT] 2015-09-16 17:28:05 UTC
Per comment 4, I'd imagine this is probably still a good bug (or enhancement) to fix if possible; since the error message didn't really point to the root cause.
Comment 6 Mark Simpson 2015-09-17 04:51:26 UTC
(In reply to comment #5)
> Per comment 4, I'd imagine this is probably still a good bug (or enhancement)
> to fix if possible; since the error message didn't really point to the root
> cause.

There is code for detecting VT-x being disabled, what it should do upon detecting that VT-x is disabled is to pause and inform the user. XAP will run with VT-x disabled, but it won't allow multiple core devices. The alert that the user should see offers to reduce to the amount of cores configured for the device to 1 so that it can be run with VT-x disabled.

This all relies on us being able to reliably detect if VT-x is disabled, and the way that that is currently done is to attempt to start the VM and monitor what VirtualBox returns with.

It does return some conflicting information, like;

[15-09-14 16:45:42.28] VBoxManage command failed. This was the command:
'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe "startvm" "701e5c49-390f-49a3-86b0-e7558f4ea0bf" "--type" "headless"'
StandardOutput: Waiting for VM "701e5c49-390f-49a3-86b0-e7558f4ea0bf" to power on...
VM "701e5c49-390f-49a3-86b0-e7558f4ea0bf" has been successfully started.
ExitCode: 1

Standard out saying 'successfully started' and the exit code being '1' is somewhat ambiguous! 

We look for a message pertaining to VT-x as a trigger for the flow that offers the user a choice to reduce the device core count.

Could I ask that you upload logs generated with the 'Bug Tool' rather than individual logs, the Bug Tool collates all the logs and system information and should save having to ask the customer for further logs.
Comment 7 Kent Green [MSFT] 2015-09-17 12:10:36 UTC
Per comment 6, the bug tool is not currently accessible on Windows systems. See bug #33586, the XAP on Windows has no menu, therefore no "Help -> Generate Bug Report" command. (Unless it's hidden somewhere, which I'd be glad to know of too.)
Comment 8 Mark Simpson 2015-09-17 12:52:45 UTC
For the WPF version, you need to right click on the lower black bar of the Device Manager and select 'Generate Bug Report'
Comment 9 Kent Green [MSFT] 2015-09-17 14:01:09 UTC
Per comment 8, I was able to find it; though this seems like it's very hidden. Is there any plan to make this more visible, or should I file a separate enhancement request for that?
Comment 10 Mark Simpson 2015-09-18 04:03:31 UTC
There are no plans to change how it is accessed, it isn't a feature that should be needed day to day and with other customer bug reports (filed on the forum) when this information is requested, instructions on how to generate it are given.
You can certainly file an enhancement request, suggestions on how to make it more visible are welcome but there are no plans to add a WinForms style File/Edit/View/Help menu bar to XAP.