VirtualBox

Ticket #14294 (closed defect: invalid)

Opened 4 years ago

Last modified 22 months ago

Cannot launch both VirtualBox virtual machine and HAXM at the same time -> fixed in HAXM, see last comments

Reported by: thecodingmate Owned by:
Component: host support Version: VirtualBox 5.0.0
Keywords: haxm, intel Cc: MT-Wizard, saschpe, fossilet, pepeks, jmc42, mwb, jm4rc05, pontomedon
Guest type: other Host type: other

Description

Problem:

I can launch my virtual machines with no problem using any version of VirtualBox. However, when I run versions 4.3.29-revision101478 and 5.0.0-revision101495 I cannot launch Intel's HAXM emulator (as part of Android Studio Android Development) because HAX's error message says,

"emulator: Failed to sync vcpu reg emulator: Failed to sync HAX vcpu context"

However, when I run version 4.3.28-revision100309 I can launch both at the same time with no problems. I'm on a Mac.

Attachments

VBox.log Download (67.8 KB) - added by thecodingmate 4 years ago.

Change History

comment:1 Changed 4 years ago by frank

Please attach a VBox.log file of your 5.0 VM session.

comment:2 Changed 4 years ago by VladS

I have the same issue immediately after upgrade from 4.3.28 to 4.3.30. There's no issue with VirtualBox machines - they run fine, but Android emulator gives aforementioned errors "emulator: Failed to sync vcpu reg emulator: Failed to sync HAX vcpu context" and does not start or stops or crashes, so you can't use Android Studio. It works fine if no VirtualBox machines run though.

I rolled back to 4.3.28 and that immediately fixed the issue - Android Emulator that comes with Android Studio works again in parallel with Virtual Box machines.

Changed 4 years ago by thecodingmate

comment:3 Changed 4 years ago by thecodingmate

I first started the Virtualbox application, then launched the Android Emulator from Android Studio, then launched Windows 7 from Virtualbox. No problems.

Then I exited the Android Emulator and tried relaunching Android Emulator while the instance of Windows 7 is still running from Virtualbox. I get the error from HAXM.

This Virtualbox.log is from this session, however, it doesn't look like Virtualbox picked up on any of this. This session is version 5.0.0-101573.

I just tried 5.0.2-102096 as well and I get the same problem.

comment:4 Changed 4 years ago by dcosson

I'm getting this issue too on Virtualbox 4.3.30.

I have a virtualbox linux vm running, installed android studio and HAXM, and the Android Emulator fails to launch. When I stop the virtualbox vm, the android emulator launches fine.

comment:5 Changed 4 years ago by Thomas Wong

See the same issue as well on Virtualbox 5.0.8 r103449 and Android Emulator on Mac.

comment:6 Changed 4 years ago by BenV

We are running into the same problem. We need to hit a web server running in VBox from the emulator and can't. We also can't roll back to 4.28 because it will not install on El Capitan.

comment:7 Changed 4 years ago by robertoandrade

having the same problem, just installed 5.0.10 r104061 to see if that was still the case and the problem persists.

comment:8 Changed 4 years ago by sampohaavisto

I just updated to 5.0.10 r104061 and it fixed the issue on OSX 10.11.1 and HAXM 1.1.5. I guess running the backend with Vagrant / VBox combo caused conflicts with Intel HAXM.

comment:9 Changed 4 years ago by VladS

Virtual Box 5.0.10, El Capitan, Android Studio 1.5

the issue still exists

comment:12 Changed 3 years ago by Andy T

This is a really annoying issue, please fix it asap! Whoever put this link in the error message for the android emulator convinced me to login to reset my oracle password and leave this comment. So +1 fix it!!

comment:15 Changed 3 years ago by Chris Botman

+1

comment:16 Changed 3 years ago by tfmorris

This is hugely annoying. I use Virtualbox both directly to host virtual OSs and for Docker, so having it demand exclusivity for the hypervisor EVEN WHEN NO VMs are RUNNING is a nasty bit of anti-social behavior.

comment:18 Changed 3 years ago by frank

tfmorris, I don't understand. AFAICS the Intel HAXM aborts as soon as a VirtualBox VM is started. As long as no VirtualBox VM is running the HAXM device emulator process is not disturbed.

comment:19 in reply to: ↑ description Changed 3 years ago by Wesley

From the Android emulator log output:

emulator: ERROR: Unfortunately, VirtualBox 4.3.30+ does not allow multiple hypervisors to co-exist. In order for VirtualBox and the Android Emulator to co-exist, VirtualBox must change back to shared use. Please ask VirtualBox to consider this change here: https://www.virtualbox.org/ticket/14294

comment:20 Changed 3 years ago by frank

Any proof for this claim? Please note that the observation that HAXM works together with VirtualBox 4.3.28 and does not work together with VirtualBox 4.3.30 is not a proof! Due to a bug VirtualBox 4.3.28 did not use host_vmxon()/host_vmxoff() functions which is mandatory for recent versions of Mac OS X. Fixing this bug is most likely the reason why HAXM doesn't work together with VirtualBox anymore. Unfortunately the source code of HAXM is not freely available (in contrast to the source code of VirtualBox) so it's hard to debug this problem.

comment:21 Changed 3 years ago by vharron3

Hi Frank,

Here is the Android Emulator issue:  http://b.android.com/197915

There are Intel HAXM engineers on that issue. Please ask them for details there.

Sincerely,

Vince

comment:22 Changed 3 years ago by vharron3

On second thought, I'll ask the Intel engineers to come here.

comment:23 Changed 3 years ago by vharron

I've searched the VirtualBox svn for references to host_vmxon and only found a hit in one file:

src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

rc = host_vmxon(false /* exclusive */);

It appears to call host_vmxon with exclusive==false

I even searched history of this call to see if it was ever exclusive. It appears to be non-exclusive all the way back to its first appearance in r14905

I'm starting to think we have a problem in host_vmxon. I'll reach out to Apple unless you disagree.

comment:25 Changed 3 years ago by kompot

I had this problem with VirtualBox uninstalled completely (on OS X 10.11).

Found out that new Docket beta that does NOT use Virtualbox but DOES use xhyve (?) interferes the same way. Shutting it down resolved the issue.

comment:28 Changed 3 years ago by michael

  • Cc MT-Wizard, saschpe, fossilet, pepeks, jmc42, mwb, jm4rc05, pontomedon added

comment:29 Changed 3 years ago by michael

I added the user names of the people who added "+1" comments to the CC field and deleted the "+1" comments. Unfortunately I can't add user names with spaces in them to that field due to limitations of trac. If you send me your e-mail address (to michael.thayer at oracle) I can add that to the CC. It will be shown truncated to anyone who does not have administration rights for the bug tracker, as in "michael.thayer@...").

comment:30 Changed 3 years ago by kenkyee

This is still an issue w/ Virtualbox 5.1 and Windows 10.

I've been using this hack ( http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx) to switch them on boot, but it doesn't help if your dev server uses the new native Docker host instead of a Virtualbox docker-machine :-(

I've switched back to using AVDs instead of Genymotion for now...not what I want to do though :-(

comment:31 follow-up: ↓ 32 Changed 3 years ago by sja

For those facing this issue and have no clue, which kext is locking vcpu context: Try stopping Docker daemon!

comment:32 in reply to: ↑ 31 ; follow-up: ↓ 33 Changed 3 years ago by VladS

Replying to sja:

For those facing this issue and have no clue, which kext is locking vcpu context: Try stopping Docker daemon!

sja, can you explain a little more? I have MAC OS and didn't install the Docker myself... is it part of operating system or VirtualBox installation?

Or is it only valid if you installed it yourself?

comment:33 in reply to: ↑ 32 ; follow-up: ↓ 34 Changed 3 years ago by sja

Replying to VladS:

Replying to sja:

For those facing this issue and have no clue, which kext is locking vcpu context: Try stopping Docker daemon!

sja, can you explain a little more? I have MAC OS and didn't install the Docker myself... is it part of operating system or VirtualBox installation?

Or is it only valid if you installed it yourself?

No, it's just a hint, because the error message hints to this Ticket. So, as a checklist:

  1. Ensure, VirtualBox is stopped and kext unloaded (if you have it installed)
  2. Ensure, Docker for Mac (Native) is stopped (if you have it installed)
  3. Ensure, all other virtualizations aren't running.

comment:34 in reply to: ↑ 33 Changed 3 years ago by VladS

Replying to sja:

Replying to VladS:

Replying to sja:

For those facing this issue and have no clue, which kext is locking vcpu context: Try stopping Docker daemon!

sja, can you explain a little more? I have MAC OS and didn't install the Docker myself... is it part of operating system or VirtualBox installation?

Or is it only valid if you installed it yourself?

No, it's just a hint, because the error message hints to this Ticket. So, as a checklist:

  1. Ensure, VirtualBox is stopped and kext unloaded (if you have it installed)
  2. Ensure, Docker for Mac (Native) is stopped (if you have it installed)
  3. Ensure, all other virtualizations aren't running.

I think this ticket was created because people do want to run VirtualBox and Amdroid emulator in parrallel.

comment:35 Changed 3 years ago by fabienrenaud

I just ran into this issue. I was trying to run the Android Emulator next to vagrant and it didn't work. Stopping vagrant helped mitigating the problem.

What's the status/progress on this issue?

comment:36 Changed 2 years ago by Thomas Wong

It's fixed for me when using Android emulator with HAXM 6.1.1 on Mac OS:

 https://forums.docker.com/t/cant-using-docker-for-mac-with-android-emulator-haxm/8939/11

comment:37 Changed 22 months ago by Andy Piper

This ticket can be closed, at least for OSX. 5.1.28 works correctly with HAXM and docker installed as long as you make sure HAXM was installed correctly with sudo permissions. Currently android sdk does NOT do this correctly, so a manual silent install must be performed. That said the problem is on the Android side not on the VirtualBox side.

comment:38 Changed 22 months ago by michael

  • Status changed from new to closed
  • Resolution set to invalid
  • Summary changed from Cannot launch both VirtualBox virtual machine and HAXM at the same time to Cannot launch both VirtualBox virtual machine and HAXM at the same time -> fixed in HAXM, see last comments
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use