1

Currently new to google cloud and working on vm. Can anyone help me how can i use android emulator on vm.
it shows me
Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!
now how can i enable hardware acceleration on vm??

Zoe
  • 27,060
  • 21
  • 118
  • 148
Samar Khan
  • 21
  • 1
  • 6

2 Answers2

1

First of all you can not access BIOS on Google Compute Engine VM. When you restart the instance you will be automatically disconnected from the SSH session. As soon as you open another SSH session again you will be already logged in to the os.

Android Studio Emulator is another Virtual Machine that emulates the operation of an Android device. So what you are looking for is VM nested inside a Google Compute Engine VM, you can refer to the Enabling Nested Virtualization for VM Instances documentation, for further information.

However, you can use arm64-v8a or armeabi-v7a ABI. They are pretty slow but you will be able to test your applications there. You can make them faster, but it will require a powerful VM that will cost a lot of money. To use those images in Android Studio emulator:

  1. Go to Tools > AVD Manager.
  2. On the bottom left corner click on + Create Virtual Device ....
  3. In Choose a device definition, choose any device you want and click Next
  4. In Select a system image go to Other images tab
  5. Choose any arm64-v8a or armeabi-v7a ABI. (Download if you don't have one)
  6. Click on Next, give a name and click Finish

Run the Virtual Device and give it some time, according to how powerful is your VM it will take some time to load. You will see an Android logo loading and after few minutes you will see the Home Screen. If it takes too long, try restarting the AVD and the Android Studio, then leave it some time to load. It is pretty slow, but it is working, I tested it myself.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Andrei Cusnir
  • 2,735
  • 1
  • 14
  • 21
0

Try below steps -

  1. Open SDK Manager (In Android Studio, go to Tools > Android > SDK Manager) and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't.

  2. Now go to your SDK directory C:\users\%USERNAME%\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager\ and run the file named intelhaxm-android.exe.

In case you get an error like "Intel virtualization technology (vt, vt-x) is not enabled". Go to your BIOS settings and enable Hardware Virtualization.

  1. Restart Android Studio and then try to start the AVD again.
VikaS GuttE
  • 1,636
  • 2
  • 14
  • 38
  • But how i can go to BIOS setting on google cloud virtual machine? – Samar Khan Feb 24 '19 at 07:29
  • error like "Intel virtualization technology (vt,vt-x) is not enabled" – Samar Khan Feb 24 '19 at 07:39
  • On which Operating system you are working in Google VM? – VikaS GuttE Feb 24 '19 at 07:45
  • Windows 10 i.e windows server 2019 – Samar Khan Feb 24 '19 at 07:47
  • Switch off your VM and start again while starting Press Enter button continuously that might move you to BIOS or you can check this https://groups.google.com/forum/#!topic/gce-discussion/Z98riBTFF50 – VikaS GuttE Feb 24 '19 at 07:56
  • @VikaS From what I understand of Google VMs and Windows server, it's SSH based unless it's accessed directly. You can't go into BIOS using SSH with any of the normal techniques because the SSH server starts later, along with any other remote access software. While this is correct, it can't be applied to this case. – Zoe Feb 26 '19 at 11:36
  • This is an uncredited copy of [this old post from 2015](https://stackoverflow.com/a/27997670/1103872). – Marko Topolnik Apr 17 '19 at 18:57