141

Question is

I get "HAX is not working and emulator runs in emulation mode", is this related to Intel x86 Emulator Accelerator (HAXM) installation and running avd with cpu set to CPU Intel Atom (x86)? And even though it feels like AVD runs faster after i installed HAXM, does this message indicates that AVD performance is hindered. Should it be fixed and if so, how?

I am running on mac os x 10.9.1.

Listing what is installed on my system via android sdk manager:

  • Tools
    • Android SDK Tools Rev 22.3
    • Android SDK Platform-tools rev 19.0.1
    • Android SDK Build-tools Rev 19.0.1
    • Android SDK Build-tools Rev 19

==

  • Android 4.4.2 (API 19)
    • SDK Platform
    • ARM EABI v7a System Image
    • Intel x86 Ato System Image
    • Google APIs
    • Sources for Android SDK

==

  • Extras
    • Intel x86 Emulator Accelerator (HAXM) AND I ALSO run dmg installer as well, and installed hot fix, after i found out about it.

AVD set up

  • Platform 4.4.2
  • API Level 19
  • CPU Intel Atom (x86)

Once i run avd:

(ruby-2.0.0-p353) .android   $ tools/emulator -avd 1AVD -wipe-data -no-boot-anim -cpu-delay 0

i get following and emulator eventually loads

emulator: The memory needed by this VM exceeds the driver limit.

HAX is not working and emulator runs in emulation mode
GnrlBzik
  • 3,358
  • 5
  • 27
  • 37
  • I got this error, but my emulator was already running, so my real problem was that Visual Studio target was **iPhone** instead of **Any CPU**, that fixed my deploy to a simulator. – Jaider Feb 11 '17 at 22:05

17 Answers17

200

Yes it should be fixed, HAXM isn't working. How much RAM is set for use inside your AVD configuration ?

768M is a good number for it, but most importantly this number has to be lower or equal to the memory usage you have set during the installation of HAXM. You can launch its installation again to modify it.

ph0b
  • 14,353
  • 4
  • 43
  • 41
  • About 1024 i think, so let me try setting avd to 768 – GnrlBzik Jan 11 '14 at 04:12
  • 9
    thank you @ph0b, thats it, HAXM was installed with 1024 allocation for memory and my avd instance had memory allocation set to 1907. thank you for pointing this out. – GnrlBzik Jan 11 '14 at 04:20
  • 44
    The HAXM installer suggested a 1GB default, but the Nexus 5 AVD is set to use 1536. Set it back to 1GB and we're on! – aalaap Nov 23 '14 at 15:54
  • 14
    Thanks. For those who were wondering, the location of the installer file of HAXM is located in the `sdk/extras/intel` folder of your ADT bundle. Placing your cursor on the HAXM entry in your AVD Manager will reveal the exact location. – Koh Dec 14 '14 at 00:20
  • 1
    how configurate that? – TuGordoBello Jan 04 '15 at 15:37
  • 2
    @zhelon apparently the only way to configurate HAXM is to run the installer again. – ThomasW Jan 13 '15 at 09:12
  • 23
    If you are using Windows and Android Studio, do the following. In Android Studio: Tools > Android > AVD Manager > Your Device > Show Advanced Settings > Set RAM to preferred size. In Control Panel > Programs and Features > Intel Hardware Accelerated Execution Manager > Change > Set manually > Set to preferred size. – Neurotransmitter Feb 15 '15 at 00:04
  • 2
    I only got this error when I was trying to start a 2nd AVD. Starting the first AVD gave a `HAX is working and emulator runs in fast virt mode` message while starting the second gave the exact same error as OP – Tim Feb 20 '15 at 12:52
  • How do I setup memory allocation to my AVD - note I am using the latest version of Android Studio (currently 1.2) – Zabs May 12 '15 at 10:18
  • Tried to configure AVD RAM several times but it never stuck. Turned out there were several AVD Manager windows open that interfered with each other. – Andreas May 20 '15 at 14:22
  • 1
    @ThomasW, Do [you](http://stackoverflow.com/questions/21031903/how-to-fix-hax-is-not-working-and-emulator-runs-in-emulation-mode#comment44234894_21040063) mean run the Intel HAXM installer again to configure the settings or do we actually have to **reinstall** the whole thing? – Pacerier Jul 01 '15 at 10:48
  • 1
    @Pacerier It's been 2 years since I did this, but if I recall correctly you need to reinstall. Perhaps the Intel installer has changed since then. – ThomasW Jul 01 '15 at 10:55
  • I reinstalled HAXM and set the memory setting to 2Gb, problem solved. – Josh Nov 09 '15 at 11:13
  • 1
    On a Mac, if you want to increase HAXM memory to 3G you can do from a Terminal: cd Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager; sudo ./silent_install.sh -m 3072 – mtotschnig Feb 15 '16 at 09:39
  • Note: Running multiple AVD might be accumulated, ex: if HAXM is set to 1024M and you need to run two AVDs with 768M each. you will get the same error message for the second AVD OR: the AVD manager might lower the second AVD memory on its own if possible. – Esam Sherif Mar 13 '18 at 07:03
66

If you are on a mac you can install haxm using homebrew via cask which is a built-in extension (as of 2015) which allows installing non-open-source and desktop apps (i.e. chrome, firefox, eclipse, etc.):

brew cask install intel-haxm 

Android Studio

If you are using Android Studio then you can achieve the same result from the menu ToolsSDK Manager, and then on the SDK Tools tab, select the checkbox for Intel x86 Emulator Accelerator (HAXM installer), and click Ok.

ccpizza
  • 28,968
  • 18
  • 162
  • 169
49

The way I solved it is by setting the AVD memory limit and HAXM memory to be equal in size which is 1 GB = 1024 MB. The AVD cannot have higher memory limit than the HAXM.

1. Setting the HAXM memory to be 1024 M

The only way to change the HAXM memory is by installing it again. I did it using the terminal. Locate Hardware_Accelerated_Execution_Manager in your machine. Then change directory that folder to run the installation script.

cd ~/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager

-OR-

cd ~/Library/Developer/Xamarin/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager

May need to change permissions:

sudo chmod 755 "HAXM installation"

Then:

./HAXM\ installation -m 1024

-OR-

sudo ./"HAXM installation" -m 1024

2. Setting the virtual device the same size with HAXM memory limit

enter image description here

This works for me. Good luck!

geckob
  • 7,680
  • 5
  • 30
  • 39
  • 2
    This worked for me as well. If you're looking for the AVD configuration screen, it's at **Tools > Android > AVD Manager** – stephenspann Aug 25 '15 at 02:35
  • 2
    If you want to have more than one AVD running at the same time, the HAXM max RAM needs to be the total for all running AVDs, i.e. two AVDs @1024MB = 2048MB, so: `$ sudo ./HAXM\ installation -m 2048` – Jason Hartley Jan 12 '16 at 05:47
24

install the latest HAXM from intel: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

After this it's working

hypery2k
  • 1,681
  • 15
  • 20
20

For Windows.

In Android Studio:

Tools > Android > AVD Manager > Your Device > Pencil Icon> Show Advanced Settings > Memory and Storage > RAM > Set RAM to your preferred size.

In Control Panel:

Programs and Features > Intel Hardware Accelerated Execution Manager > Change > Set manually > Set RAM to your preferred size.

It is better for RAM sizes set in both places to be the same.

Neurotransmitter
  • 6,289
  • 2
  • 51
  • 38
  • 2
    +1 for explaining the exact place to set these values. Too many answers on the internet assume a level of knowledge which the reader, like me, doesn't always have :-) – MikeKulls Feb 09 '16 at 01:59
4

Check the latest version of Has on Intel website and install it. Let the ram in recommended size "preset 2048", then try to run the app. Things should work fine.

Adinia
  • 3,722
  • 5
  • 40
  • 58
Mohamed
  • 41
  • 1
2

Yes it should be fixed, HAXM isn't working.

HAXM sometimes works; experience with HAXM is currently sporadic across platforms.

For instance, I've got late 2009 iMac running 10.8.5 and i7 processor @2.8Ghz, Android SDK 22.6 with all the goodies updated this morning (03/05/14). API17 will build emulators with HAXM acceleration on this iMac machine, API19 chokes out.

I also have early 2013 MBP 15" Retina running 10.8.5 and i7 processor @2.7Ghz, Android SDK 22.6 with all the goodies updated this morning (03/05/14). API17 will build emulators with HAXM acceleration, API19 works great too.

Ditto for my (personal) late 2013 MBP Retina 13" with dual-core i5 and Mavericks.

There is something going on for virtualization at the chip level missing from older CPU's (even i7's) that the new API19 x86 images need for HAXM to work. If API19 is not working, give API17 or even 16 a try.

HAL-9000
  • 61
  • 2
2

On your mac Open the finder then command + Alt + G after type this /Users/${yourMacNameHere}/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager

your gonna to find installer of the emulator accelerator so run it and set up the memory you need modify it and retry to run your android application

Zouhair Kasmi
  • 614
  • 2
  • 6
  • 13
  • The keystroke sequence above didn't work for me but just looked for the `IntelHAXM_.dmg` file in the 'sdk/extras/intel' dir and ran the installer from there (Mac OSX) – kip2 Aug 18 '16 at 13:04
2

if you are running Intel processor make sure HAXM (Intel® Hardware Accelerated Execution Manager) installer is install via SDK Manager by checking this option in SDK Manager. and then run the HAXM installer ext via the path below

your_sdk_folder\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe

also check the ram size allocated while doing HAX installation so it fits the ram size of your emulator.

This video shows all the required steps which may help you to solve the problem.

This video will also help you if you face problem after installing HAXM.

Yogesh patel
  • 1,351
  • 2
  • 15
  • 21
1

Either increase the ram size allocated while doing HAX installation , so as to fit exactly or a bit more higher space than the ram size of the emulator which you want to launch in "Intel x86 Emulator Accelerator (HAXM) " mode,

Once you succeed with that, you can now able to view this in the console /log

enter image description here

Bala Prasanna
  • 170
  • 1
  • 9
1

You have to verify than the size allocated while doing HAX installation is the same than the size in the AVD emulator configuration.

You can see in French here : http://blerow.blogspot.fr/2015/01/android-studio.html

1

geckob's solution works perfectly. Caution: The HAXM that you provide is used across all running devices. So if you are testing on a phone and Tablet at the same time and each has a requirement of 1G. Then make sure your HAXM alloted is atleast 2G.

dessertcook
  • 361
  • 3
  • 5
1

In my case, this error was fixed when I set HAXM memory equal to AVD memory. HAXM memory 1024 MB = AVD memory 1024 MB

Hax is enabled
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.

Upto this point the error should be fixed.

Now I'm listing my specific environment in case it could be of some help for someone using OS X.

OS X El Capitan 10.11.4

MacBook (13-inch), 2 GHz Intel Core 2 Duo, 4 GB Ram.

Android Studio 2.1

Marshmallow (23) x86 didn't pass the flashing Android icon screen for even hours.

Lollipop (22) x86 passed the flashing android icon screen and then showed

  • Starting Android (Optimizing x out of y apps)
  • Starting Android (Starting apps)
  • Starting Android (Updating Contacts Database)
  • Starting Android (Finishing boot) and remained stuck here for hours.

KitKat (19) x86 worked successfully and I could install the hello world there.

Cœur
  • 37,241
  • 25
  • 195
  • 267
zeeawan
  • 6,667
  • 2
  • 50
  • 56
1

Download HAXM from SDK Manager

Open your SDK Manager from Android Studio, click the icon shown in the screen shot.

enter image description here

Click on "Launch Standalone SDK Manager" on the "Default Settings" Dialog.

enter image description here

Check node "Extras > Intel x86 Emulator Accelerator (HAXM installer)" and proceed with HAXM download.

enter image description here

Installing or Modifying HAXM

You can now access with installation (or modifying existing installtino) of HAXM by accessing the download location. Enter this path in "run"

%localappdata%\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager

and double click the file "intelhaxm-android.exe"

You can increase the size of memory allocated to HAXM while modifying existing HAXM install. I have a machine with 32 GB of RAM and would like to launch multiple AVDs at same time (for automated testing etc.) so I have allocated 8 GB to HAXM.

Caveat

If you are running one AVD of one 1 GB and allocated 2 GB to HAXM, you cannot run another AVD with RAM more than 1 GB. Please make sure that Android Device Monitor is not running when you are modifying or installing HAXM (just to avoid any suprises).

enter image description here

These steps are tested on Windows platform, but generally could be applied to other platforms too with slight modification.

A.B.
  • 1,554
  • 1
  • 14
  • 21
1

My problem was that I could no longer run an emulator that had worked because I had quit the emulator application but the process wasn't fully ended, so I was trying to launch another emulator while the previous one was still running. On a mac, I had to use the Activity Monitor to see the other process and kill it. Steps:

  1. Open Activity Monitor (in Utilities or using Command+Space)
  2. Locate the process name, in my case, qemu-system...
  3. Select the process.
  4. Force the process to quit using the 'x' button in the top left.
  5. I didn't have to use 'Force Quit', just the plain 'Quit', but you can use either.
rjferguson
  • 603
  • 3
  • 12
0

Re-open your AVD device configuration. by editing device in the AVD manager. proceed to select the AVD Android version. At the right pane a recommendation is displayed follow that recommendation and all will be fixed.

hasan
  • 23,815
  • 10
  • 63
  • 101
0

Default memory assigned to HAX is 1024MB. And the emulator has 1536MB apparently for Nexus 5x api 25.

if you're using Android Studio,

  • just go to tools -> AVD manager.
  • Then select the emulator and click on pencil button on the right for editing.
  • Go to advanced settings in the new window and change the RAM value to 1024

Works like a charm. :)

screenshot of android studio

abe312
  • 2,547
  • 25
  • 16