2019独角兽企业重金招聘Python工程师标准>>>

How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Gingerbread Emulator

Submitted by  Tao Wang (Intel) on Mon, 03/12/2012 – 22:31

The Intel Hardware Accelerated Execution Manager (Intel® HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel Virtualization Technology (VT) to speed up Android app emulation on a host machine. In combination with Android x86 emulator images provided by Intel and the official Android SDK Manager, HAXM allows for faster Android emulation on Intel VT enabled systems. HAXM for both Windows and IOS are available now.

Since Google mainly support Android build on Linux platform (with Ubuntu 64-bit OS as top Linux platform, and IOS as 2nd), and a lot of Android Developers are using AVD on Eclipse hosted by a Linux system, it is very critical that Android developers take advantage of Intel hardware-assisted KVM virtualization for Linux just like HAXM for Windows and IOS.

Below are the quick step-by-step’s on how to install, enable KVM  on Ubuntu host platform and  start Intel Android x86 Gingerbread emulator with Intel hardware-assisted virtualization (hypervisor). The result is very pleasing and AVD runs significantly faster and smoother than without hypervisor

KVM Installation

I referred the instructions from Ubuntu communitydocumentation page. to get KVM installed.To see if your processor supports hardware virtualization, you can review the output from this command:

$ egrep -c '(vmx|svm)' /proc/cpuinfo

I got 64. If 0 it means that your CPU doesn’t support hardware virtualization.

Next is to install CPU checker:

$sudo apt-get install cpu-checker

Now you can check if your cpu supports kvm:

$kvm -ok

If you see:

"INFO: Your CPU supports KVM extensions

INFO: /dev/kvm exists

KVM acceleration can be used"

It means you can  run your virtual machine faster with the KVM extensions.

If you see:

“INFO: KVM is disabled by your BIOS

HINT: Enter your BIOS setup and enable Virtualization Technology (VT),

and then hard poweroff/poweron your system

KVM acceleration can NOT be used”

You need to go to BIOS setup and enable the VT.


Use a 64 bit kernel

Running a 64 bit kernel on the host operating system is recommended but not required.

To serve more than 2GB of RAM for your VMs, you must use a 64-bit kernel (see 32bit_and_64bit). On a 32-bit kernel install, you’ll be limited to 2GB RAM at maximum for a given VM.

Also, a 64-bit system can host both 32-bit and 64-bit guests. A 32-bit system can only host 32-bit guests.

To see if your processor is 64-bit, you can run this command:

$egrep -c ' lm ' /proc/cpuinfo

If 0 is printed, it means that your CPU is not 64-bit.

If 1 or higher, it is. Note: lm stands for Long Mode which equates to a 64-bit CPU.

Now see if your running kernel is 64-bit, just issue the following command:

$uname -m

x86_64 indicates a running 64-bit kernel. If you see i386, i486, i586 or i686, you’re running a 32-bit kernel.

Install KVM

For Ubuntu Lucid (10.04) or later:

Shell

$sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

You may ignore the Postfix Configuration below by selecting “No Configuration”

Next is to add your <username> account to the group kvm and libvirtd

$sudo adduser your_user_name kvm

$sudo adduser your_user_name libvirtd

After the installation, you need to relogin so that your user account becomes an effective member of kvm and libvirtd user groups. The members of this group can run virtual machines.

Verify Installation

You can test if your install has been successful with the following command:

$sudo virsh -c qemu:///system list

Your screen will paint the following below if successful:

Id Name                 State

----------------------------------

Start the AVD from Android SDK Directly from Terminal

Now start the Android for x86 Intel Emulator using  the following command:

$<SDK directory>/tools/emulator-x86 -avd Your_AVD_Name -qemu -m 2047 -enable-kvm

Only a 64-bits Ubuntu can allow you to run allocated Memory of 2G or more. My 64-bit Ubuntu has 6G of Memory, so I used 1/3 of it for Android AVD. My AVD name is Intel_Atom_gingerbread_2.3 . ‘-qemu’ provides the options to qemu, and ‘-m’ specifies the amount of memory for the emulated Android (i.e. guest). If you use too small value for that, it’s possible that performance is bad because of frequent swapping activities. Add ‘-show-kernel’ to see the message from the kernel.

Start the AVD by AVD Manager in Eclipse

Below is procedures recommended by Google. If you are running the emulator from Eclipse, run your Android application with an x86-based AVD and include the KVM options:

In Eclipse, click your Android project folder and then select Run > Run Configurations…

In the left panel of the Run Configurations dialog, select your Android project run configuration or create a new configuration.

Click the Target tab.

Select the x86-based AVD you created previously.

In the Additional Emulator Command Line Options field, enter:

-qemu -m 2047 -enable-kvm

Run your Android project using this run configuration.


转载于:https://my.oschina.net/kutengshe/blog/416317

UBUNTU 12.04 下配置 HAXM 加速 ANDROID模拟器相关推荐

  1. Windows下使用HAXM加速Android模拟器(以x86方式运行)

    intel的HAXM可以使android模拟器 以x86方式运行,速度大大提升,本质发生改变. 原文: http://software.intel.com/zh-cn/articles/speedin ...

  2. Ubuntu 12.04下配置JDK7

    第一步:下载jdkhttp://www.oracle.com/technetwork/java/javase/downloads/index.html 第二步:解压安装 进入文件所在目录 执行 sud ...

  3. Ubuntu 12.04 下编译Android 4.0.3

    在Ubuntu 12.04 下编译了Android 4.0.3发现了一大堆错误,网上找了一堆的更改源码啊,Android.mk的解决方法,虽然可以编译成功,但都有点坑爹的成分,为了不误人子弟就分享出来 ...

  4. Ubuntu 12.04下安装Oracle Express 11gR2

    Ubuntu 12.04下安装Oracle Express 11gR2 [我的笔记] 参考1:http://www.linuxidc.com/Linux/2012-09/71382.htm 参考2:h ...

  5. linux ubuntu 12.04 下默认是安装了openjdk的

    ubuntu 12.04 下默认是安装了openjdk的,不过这个jdk问题比较多,因为你甚至无法启动Eclipse,所以还是需要自己安装jdk的. 1.下载jdk6 jdk6下载地址为:http:/ ...

  6. Ubuntu 12.04下搭建Web服务器 (MySQL+PHP+Apache)(转)

    看了网上很多关于用linux操作系统搭建网站服务器的教程,于是我自己也测试了很多,但今天所测试的 Ubuntu 12.04下搭建Web网站服务器 (MySQL+PHP+Apache环境),感觉这个适合 ...

  7. 3070网卡驱动linux教程,Ubuntu 12.04下RT5370无线网卡驱动安装

    之前买了个水星150U的无线网卡,一直没在Ubuntu下安装好驱动?今天再次在Ubuntu 12.04下尝试安装尽然成功了.以前我一直以为是RT2870的芯片的,今天拆开了一看原来是5370N,晕到R ...

  8. Ubuntu 16.04下配置openWRT开发环境

    Ubuntu 16.04下配置openWRT开发环境 1.配置openwrt开发环境,本实验室在ubuntu16.04系统下测试 在编译之前我们先要搭建环境,ubuntu下OpenWrt编译环境需要安 ...

  9. Ubuntu 12.04下安装极点五笔输入法

    Ubuntu 12.04下安装极点五笔输入法     刚刚安装好了 Ubuntu 12.04,但是没有五笔的日子实在不好过,WINDOWS下用习惯了极点五笔,本以为极点的作者不出Linux版的,结果在 ...

最新文章

  1. popwindow下拉筛选 二级联动_职场人必备!一分钟搞定Excel二级联动下拉菜单
  2. go监听mysql事件更新,有没有一种方法可以“监听”数据库事件并实时更新页面?...
  3. Android JNI入门第四篇——jni头文件分析
  4. 识别强直性脊柱炎高效和疾病特定的基质改变
  5. ABAP 删除内表重复数据
  6. 网络通道联调及SSH服务启动
  7. 衡量发动机性能的重要指标—升功率
  8. mybatis学习(37):动态sql-trim
  9. すぬけ君の塗り絵 / Snuke's Coloring(AtCoder-2068)
  10. 组策略查看login记录_k8s实践记录(五)
  11. php事务讲解,PHP面向对象之事务脚本模式(详解)
  12. Word打开后出现乱码
  13. Java排序算法(一)——归并排序
  14. 第1章 Python 顺序结构
  15. qq 能上但是打不开网页
  16. unity 引用 移动mm 支付sdk
  17. Python 计算 AMR 文件的时长
  18. 安全防护工具之:ClamAV
  19. L1-030 一帮一 (15分) “一帮一学习小组”是中小学中常见的学习组织方式,老师把学习成绩靠前的学生跟学习成绩靠后的学生排在一组。本题就请你编写程序帮助老师自动完成这个分配工作,即在得到全班学生
  20. 笔记本不能用无线网策略服务器,明明有无线网笔记本就是搜索不到怎么处理

热门文章

  1. 正则表达式的深入理解
  2. linux下软件如何防破裂,linux下管道破裂的處理
  3. switch 没有default_「java面试」switch究竟怎么用,不要让它吃灰了!
  4. Java基础 正则表达式 Pattern和Matcher
  5. 笔记-信息系统安全管理-信息系统安全技术体系
  6. 2020年10月份学习总结,项目管理案例
  7. vue学习:vue中data和return data的区别
  8. Three.js入门和搭建HelloWorld
  9. MobileIMSDK连接后频繁掉线重连,提示会话超时失效,对方非正常退出或网络故障
  10. 若依前后端分离版怎样根据数据库生成代码并快速实现某业务的增删改查