|mach install| fails to start x86 emulator
Categories
(Firefox Build System :: General, defect, P3)
Tracking
(Not tracked)
People
(Reporter: erahm, Assigned: gbrown)
References
(Blocks 1 open bug)
Details
(Keywords: in-triage, Whiteboard: dev-prod-2020)
I installed an x86 emulator with mach android-emulator --version x86-7.0
and then did a mach install
which fails due to something about kvm
. I searched for the error message and it looks like I need to do something like:
sudo apt install qemu-kvm
sudo adduser <user> kvm
Full output from mach install
erahm@shetland:~/dev/mozilla-unified$ ./mach install
No Android devices connected. Start an emulator? (Y/n)
Starting emulator running Android 7.0 x86...
accel:
11
This user doesn't have permissions to use KVM (/dev/kvm)
accel
WARNING: Unable to verify kvm acceleration!
WARNING: The x86 emulator may fail to start without kvm.
WARNING: Emulator has already completed!
WARNING: See log at /home/erahm/.mozbuild/android-device/emulator.log and/or use --verbose for more information.
0:11.84 /usr/bin/make -C . -j16 -s -w install
0:11.86 make: Entering directory '/var/dev/erahm/mozilla-unified/objdir-android-x86-frontend'
0:11.86 No devices are connected. Connect a device or start an emulator.
0:11.87 /var/dev/erahm/mozilla-unified/mobile/android/build.mk:35: recipe for target 'install' failed
0:11.87 make: *** [install] Error 1
0:11.87 make: Leaving directory '/var/dev/erahm/mozilla-unified/objdir-android-x86-frontend'
Reporter | ||
Comment 1•5 years ago
|
||
(In reply to Eric Rahm [:erahm] from comment #0)
sudo apt install qemu-kvm sudo adduser <user> kvm
FWIW, this did not help.
Reporter | ||
Comment 2•5 years ago
|
||
(In reply to Eric Rahm [:erahm] from comment #1)
(In reply to Eric Rahm [:erahm] from comment #0)
sudo apt install qemu-kvm sudo adduser <user> kvm
FWIW, this did not help.
I found another random command that did help:
sudo setfacl -m u:erahm:rwx /dev/kvm
Updated•5 years ago
|
Comment 3•5 years ago
|
||
gbrown: Should those WARNING lines about not verifying kvm from android_device.py be errors instead? Or is there a case where the x86 emulator should work without kvm permissions? I'm wondering if we should just return an error immediately and provide some instructions on how to configure /dev/kvm.
erahm: I'd be curious to know if you can access /dev/kvm without the setfacl if you log out / log back in to make sure you have 'kvm' listed when you run 'groups'
Assignee | ||
Comment 4•5 years ago
|
||
I think the x86 emulator on linux (maybe osx also) requires kvm, but:
- I'm not 100% sure
- earlier versions of the x86 emulator did not require kvm
- who knows what newer versions of the emulator will implement?
The check-and-warn code is at:
Notice that it is a pretty gross approximation, which could certainly fail if google changes the emulator implementation or message wording. If that were to happen, I'd prefer to warn and successfully continue vs break 'mach android-emulator' without need.
More info on emulator + kvm at:
https://developer.android.com/studio/run/emulator-acceleration
Assignee | ||
Comment 5•4 years ago
|
||
It sounds like the issue here was kvm permissions and the issue was resolved. I think the existing check and warning is the best we can do.
Description
•