Android模拟器在启动时挂起 - 使用KVM和Intel Virtualization Acceleration

时间:2014-08-04 14:32:44

标签: android ubuntu android-emulator

我在Ubuntu 14.04中运行android模拟器。我使用android管理器创建了一个带有Intel Atom x86核心的Nexus 5 AVD。在BIOS中,我启用了英特尔硬件虚拟化加速。我跑的时候:

emulator-x86 -avd Nexus_5 -qemu -m 1024 -enable-kvm -show-kernel 

它只是打开模拟器屏幕然后没有任何反应。内核输出开始看起来很奇怪:

[    0.140030] Freeing unused kernel memory: 304k freed
[    0.140030] Write protecting the kernel text: 4584k
[    0.140030] Write protecting the kernel read-only data: 1792k
[    0.140030] type=1403 audit(1407160569.140:2): policy loaded auid=4294967295 ses=4294967295
[    0.140030] SELinux: Loaded policy from /sepolicy
[    0.150017] type=1404 audit(1407160569.150:3): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295
[    0.299863] init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.
[    0.337257] init: /dev/hw_random not found
[    0.337257] init: cannot open '/initlogo.rle'
[    0.339886] EXT4-fs (mtdblock0): mounted filesystem with ordered data mode. Opts: barrier=1
[    0.349815] EXT4-fs (mtdblock1): recovery complete
[    0.349815] EXT4-fs (mtdblock1): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[    0.359943] fs_mgr: Running /system/bin/e2fsck on /dev/block/mtdblock1
[    0.369830] e2fsck: executing /system/bin/e2fsck failed: No such file or directory
[    0.369830] e2fsck: e2fsck terminated by exit(255)
[    0.369830] EXT4-fs (mtdblock1): mounted filesystem with ordered data mode. Opts: barrier=1,nomblk_io_submit
[    0.369830] goldfish_nand_read: invalid read, start 0, len 200, dev_size 4000000, write_size 800
[    0.369830] end_request: I/O error, dev mtdblock2, sector 2
[    0.369830] EXT4-fs (mtdblock2): unable to read superblock
[    0.379939] fs_mgr: Running /system/bin/e2fsck on /dev/block/mtdblock2
[    0.389801] e2fsck: executing /system/bin/e2fsck failed: No such file or directory
[    0.389801] e2fsck: e2fsck terminated by exit(255)
[    0.389801] goldfish_nand_read: invalid read, start 0, len 200, dev_size 4000000, write_size 800
[    0.389801] end_request: I/O error, dev mtdblock2, sector 2
[    0.389801] EXT4-fs (mtdblock2): unable to read superblock
[    0.399937] fs_mgr: Cannot mount filesystem on /dev/block/mtdblock2 at /cache
[    0.399937] init: fs_mgr_mount_all returned an error
[    0.399937] init: /dev/hw_random not found
[    0.409755] type=1400 audit(1407160569.390:4): avc:  denied  { entrypoint } for  pid=914 comm="init" path="/sbin/healthd" dev="rootfs" ino=2042 scontext=u:r:healthd:s0 tcontext=u:object_r:rootfs:s0 tclass=file
[    0.409755] healthd: wakealarm_init: timerfd_create failed
[    0.409755] healthd: BatteryVoltagePath not found
[    0.409755] healthd: BatteryTemperaturePath not found
[    0.409755] binder: 914:914 transaction failed 29189, size 0-0
[    0.409755] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[    0.409755] type=1405 audit(1407160569.390:5): bool=in_qemu val=1 old_val=0 auid=4294967295 ses=4294967295
[    0.409755] init: property 'sys.powerctl' doesn't exist while expanding '${sys.powerctl}'
[    0.409755] init: powerctl: cannot expand '${sys.powerctl}'
[    0.409755] init: property 'sys.sysctl.extra_free_kbytes' doesn't exist while expanding '${sys.sysctl.extra_free_kbytes}'
[    0.409755] init: cannot expand '${sys.sysctl.extra_free_kbytes}' while writing to '/proc/sys/vm/extra_free_kbytes'
shell@generic_x86:/ $ [    1.259909] init: untracked pid 1033 exited
[    1.419980] type=1400 audit(1407160570.400:6): avc:  denied  { 0x10 } for  pid=914 comm="healthd" capability=36  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability2
[    1.679719] warning: `rild' uses 32-bit capabilities (legacy support in use)

然后它最终会重复这样的消息:

[  225.503427] init: untracked pid 2533 exited
[  230.563372] type=1400 audit(1407160799.543:50): avc:  denied  { search } for  pid=2536 comm="zygote" name="cpuctl" dev="tmpfs" ino=2340 scontext=u:r:zygote:s0 tcontext=u:object_r:cpuctl_device:s0 tclass=dir

我没有安装SELinux,所以我对avc拒绝消息感到有些困惑。非常感谢任何帮助!

1 个答案:

答案 0 :(得分:0)

我在Debian上遇到了完全相同的问题。只需添加 -gpu 就可以让它最终适用于我!

emulator-x86 -avd NerdPlus -gpu on -qemu -m 1024 -enable-kvm