[SOLVED] VirtualBox virtualization and Android emulator problem (black screen)

banderas20

Member
Joined
Aug 1, 2018
Messages
96
Reaction score
39
Credits
746
Hello.

I have a problem while trying to run an Android emulator in an Ubuntu Virtual Machine. I'm using VirtualBox7 as hypervisor.

When I run the emulator command, the android emulator launches, but I see nothing but a black screen. I got a warning popup from VirtualBox saying that Nested Virtualization could not work properly. If I run that same emulator in my host machine (also Ubuntu), it does work.

I have the virtualization enabled in my host BIOS, and in Virtual Box both checkboxes "Enable PAE/NX" and "Enable Nested VT-X/AMD-V" are ticked.

For the record, I had to run a special command to tick "Enable Nested VT-X/AMD-V" since it was initially grayed out. Maybe this is the problem.

I also read that the issue might have something to do with another hypervisor running on the host machine. Maybe KVM. But I don't know how to check it.

The host and the guest OS are the same: "Ubuntu 20.04.5 LTS"

EDIT: adding error messages:

The errors I get are these ones:

Code:
Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.
 ((null):0, (null))
INFO    | Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Code:
ERROR   | x86 emulation currently requires hardware acceleration!
CPU acceleration status: KVM requires a CPU that supports vmx or svm

Any help will be greatly appreciated.

Thanks!
 
Last edited:


VirtualBox saying that Nested Virtualization could not work properly.

If you have an intel computer... try this..

grep --color vmx /proc/cpuinfo

If you have an AMD computer... try this...

grep --color svm /proc/cpuinfo

If you don't see any results, your computer doesn't support virtualization. But even if you do see results,
you may have to enable it in your host machine BIOS/UEFI (not the settings in your virtual machine).

Also.. do you have the VirtualBox extension pack installed?
Some Linux distro's (I don't know about Ubuntu) also require another package called "virtualbox-guest-additions".
 
If you have an intel computer... try this..

grep --color vmx /proc/cpuinfo

If you have an AMD computer... try this...

grep --color svm /proc/cpuinfo

If you don't see any results, your computer doesn't support virtualization. But even if you do see results,
you may have to enable it in your host machine BIOS/UEFI (not the settings in your virtual machine).

Also.. do you have the VirtualBox extension pack installed?
Some Linux distro's (I don't know about Ubuntu) also require another package called "virtualbox-guest-additions".

Hi!

Here are the results of grep --color vmx /proc/cpuinfo
Code:
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 bmi2 invpcid rdseed clflushopt md_clear flush_l1d arch_capabilities

vmx flags    : vnmi invvpid ept_x_only flexpriority tsc_offset vtpr vapic ept vpid unrestricted_guest ple

flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 bmi2 invpcid rdseed clflushopt md_clear flush_l1d arch_capabilities

vmx flags    : vnmi invvpid ept_x_only flexpriority tsc_offset vtpr vapic ept vpid unrestricted_guest ple


I have the virtualization enabled in my host machine, and the virtualbox-guest-additions are installed in version 7.0.4

Here is the output when I run the emulator:

Code:
INFO    | Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
emulator: INFO: Found systemPath /usr/lib/android-sdk/system-images/android-22/google_apis/x86/
emulator: INFO: Found systemPath /usr/lib/android-sdk/system-images/android-22/google_apis/x86/
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
WARNING | encryption is off
INFO    | configAndStartRenderer: setting vsync to 60 hz
WARNING | cannot add library /usr/lib/android-sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO    | added library /usr/lib/android-sdk/emulator/lib64/vulkan/libvulkan.so
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local, auth: none
INFO    | Advertising in: /run/user/1000/avd/running/pid_1802.ini
INFO    | setDisplayConfigs w 320 h 640 dpiX 160 dpiY 160
ERROR   | Unable to connect to adb daemon on port: 5037
INFO    | Your emulator is out of date, please update by launching Android Studio:

Thanks!
 
Last edited:
Hi. I managed to solve the issue by creating another Android VM with a lower system image.

Closing thread.

Thanks!
 

Members online


Top