VirtualBox

Opened 9 years ago

Closed 7 years ago

#14294 closed defect (invalid)

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 (1)

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

Download all attachments as: .zip

Change History (31)

comment:1 by Frank Mehnert, 9 years ago

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

comment:2 by VladS, 9 years ago

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.

by thecodingmate, 9 years ago

Attachment: VBox.log added

comment:3 by thecodingmate, 9 years ago

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 by dcosson, 9 years ago

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 by Thomas Wong, 9 years ago

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

comment:6 by BenV, 8 years ago

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 by robertoandrade, 8 years ago

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

comment:8 by sampohaavisto, 8 years ago

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 by VladS, 8 years ago

Virtual Box 5.0.10, El Capitan, Android Studio 1.5

the issue still exists

comment:12 by Andy T, 8 years ago

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 by Chris Botman, 8 years ago

+1

comment:16 by tfmorris, 8 years ago

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 by Frank Mehnert, 8 years ago

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.

in reply to:  description comment:19 by Wesley, 8 years ago

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 by Frank Mehnert, 8 years ago

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 by vharron3, 8 years ago

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 by vharron3, 8 years ago

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

comment:23 by vharron, 8 years ago

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 by kompot, 8 years ago

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 by Michael Thayer, 8 years ago

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

comment:29 by Michael Thayer, 8 years ago

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 by kenkyee, 8 years ago

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 by Sebastian Janzen, 7 years ago

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

in reply to:  31 ; comment:32 by VladS, 7 years ago

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?

in reply to:  32 ; comment:33 by Sebastian Janzen, 7 years ago

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.

in reply to:  33 comment:34 by VladS, 7 years ago

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 by fabienrenaud, 7 years ago

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 by Thomas Wong, 7 years ago

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 by Andy Piper, 7 years ago

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 by Michael Thayer, 7 years ago

Resolution: invalid
Status: newclosed
Summary: Cannot launch both VirtualBox virtual machine and HAXM at the same timeCannot 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.

© 2023 Oracle
ContactPrivacy policyTerms of Use