ubuntu启动emulator : /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded

简介: 本文记录了解决AOSP模拟器无法启动的问题,原因是微星B450M主板BIOS中虚拟化技术未开启,通过安装KVM模块并修改BIOS设置以启用SVM模式来解决。

微星B450M主板的BIOS默认居然未开启虚拟化技术,导致AOSP的emulator无法启动,本文记录错误的出现及解决办法。

一、emulator 错误提示

^
[ 99% 154456/154478] //frameworks/base/packages/SystemUI:SystemUI r8 [common]
Warning: Missing class android.compat.annotation.UnsupportedAppUsage (referenced from: void com.android.systemui.people.widget.PeopleBackupHelper.writeNewStateDescription(android.os.ParcelFileDescriptor))
[ 99% 154474/154478] Target super fs image for debug: out/target/product/emulator_x86_64/super.img
2023-12-24 05:08:00 - build_super_image.py - INFO    : Building super image from info dict...
2023-12-24 05:08:00 - common.py - INFO    :   Running: "/home/szhou/works/aosp/aosp/out/host/linux-x86/bin/lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:8598323200 --group emulator_dynamic_partitions:8589934592 --partition system:readonly:1038884864:emulator_dynamic_partitions --image system=out/target/product/emulator_x86_64/system.img --partition system_dlkm:readonly:348160:emulator_dynamic_partitions --image system_dlkm=out/target/product/emulator_x86_64/system_dlkm.img --partition system_ext:readonly:154165248:emulator_dynamic_partitions --image system_ext=out/target/product/emulator_x86_64/system_ext.img --partition product:readonly:330076160:emulator_dynamic_partitions --image product=out/target/product/emulator_x86_64/product.img --partition vendor:readonly:167936000:emulator_dynamic_partitions --image vendor=out/target/product/emulator_x86_64/vendor.img --output out/target/product/emulator_x86_64/super.img"
2023-12-24 05:08:01 - build_super_image.py - INFO    : Done writing image out/target/product/emulator_x86_64/super.img
[100% 154478/154478] Create system-qemu.img now
removing out/target/product/emulator_x86_64/system-qemu.img.qcow2
out/host/linux-x86/bin/sgdisk --clear out/target/product/emulator_x86_64/system-qemu.img

#### build completed successfully (03:13:06 (hh:mm:ss)) ####

szhou@bc-R01:~/works/aosp/aosp$ emulator
INFO    | Android emulator version 31.3.9.0 (build_id 8748233) (CL:N/A)
INFO    | Storing crashdata in: /tmp/android-szhou/emu-crash.db, detection is enabled
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
WARNING | Failed to open /home/szhou/.android/adbkey
WARNING | adbkey generation failed
ERROR   | x86_64 emulation currently requires hardware acceleration!
CPU acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.
szhou@bc-R01:~/works/aosp/aosp$

二、解决办法

2.1 安装KVM

sudo apt-get install qemu-kvm
sudo kvm-ok

2.2 修改BIOS设置

  • 此处因平台有差异,可百度查询下如何开启BIOS 虚拟化,一般此选择都在CPU相关特征配置里面
  • 以本人微星B450M AMD主板为例子:

1.系统重启,待开机LOGO显示时,按DEL按键进入BIOS设置界面
2.以次序进入:OC => CPU Feature => SVM Mode , 按ENTER按键配置此选项为 Enable

三、启动画面

在这里插入图片描述

相关文章
|
存储 XML Ubuntu
如何在 Ubuntu 22.04 服务器上安装和配置 KVM?
如何在 Ubuntu 22.04 服务器上安装和配置 KVM?
476 0
如何在 Ubuntu 22.04 服务器上安装和配置 KVM?
Command ‘nohub‘ not found, did you mean: command ‘nohup‘ from deb coreutils (8.32-4.1ubuntu1)
Command ‘nohub‘ not found, did you mean: command ‘nohup‘ from deb coreutils (8.32-4.1ubuntu1)
|
5月前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
96 1
|
6月前
|
机器学习/深度学习 Ubuntu Linux
如何在Ubuntu 23.10部署KVM并创建虚拟机?
如何在Ubuntu 23.10部署KVM并创建虚拟机?
|
6月前
|
Ubuntu Linux
百度搜索:蓝易云【ubuntu20.04上构建qemu启动linux kernel教程。】
现在,你已经在Ubuntu 20.04上成功构建并启动了Linux内核。你可以根据你的需求进行内核定制,并进行进一步的开发和调试。请注意,这只是一个基本的教程,如果你需要更多高级的配置和定制选项,请参考Linux内核的官方文档和相关资源。
74 0
|
Ubuntu Linux Docker
Ubuntu安装docker报错:Command ‘lsb_release‘ not found
Ubuntu安装docker报错:Command ‘lsb_release‘ not found
376 0
|
存储 Ubuntu Linux
virtualbox虚拟机安装Ubuntu异常处理:FATAL: NO bootable medium found! System halted
virtualbox虚拟机安装Ubuntu异常处理:FATAL: NO bootable medium found! System halted
virtualbox虚拟机安装Ubuntu异常处理:FATAL: NO bootable medium found! System halted
|
Ubuntu Go 开发工具
ubuntu下go-zero项目安装goctl后报错:command not found
ubuntu下go-zero项目安装goctl后报错:command not found
731 0
ubuntu下go-zero项目安装goctl后报错:command not found
|
Ubuntu Python
基于Ubuntu的zsh: command not found: python错误简单解决方案
基于Ubuntu的zsh: command not found: python错误简单解决方案
570 0
基于Ubuntu的zsh: command not found: python错误简单解决方案
|
Ubuntu Linux 虚拟化
虚拟机的 Ubuntu 没有 /dev/fb0 的解决办法
虚拟机的 Ubuntu 没有 /dev/fb0 的解决办法
561 0
虚拟机的 Ubuntu 没有 /dev/fb0 的解决办法