7

I have installed Android 7.1 on VirtualBox 5.2 on Lubuntu 18.04 on Thinkpad T400 following this tutorial. Here is the configuration

VirtualBox dialog

In particular, I have assigned 1GB RAM to Android. On Lubuntu currently free shows this:

$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.7G        5.4G        492M        608M        1.8G        1.4G
Swap:           14G        850M         14G

When I boot up the Android VM, the screen shows some information about booting Android, but eventually is stuck with a blank screen with a cursor on the top left corner, and at the same time Lubuntu has slightly changed free RAM as below

$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.7G        5.8G        242M        628M        1.6G        992M
Swap:           14G        863M         14G

I guess Android getting stuck is not because of a shortage of RAM. I was wondering what the reason is and what I can do to solve the problem? Thanks.

booting Android - GRUB menu

Android seems to be booting

black screen


Update

I've tried changing the assigned memory size in the settings of the virtual machine to 2GB and then to 4GB, but starting Android still gets stuck at the same place in both cases. I suspect that it is not the memory size but something else.


Related Why is starting Android from a vdi file in VirtualBox stuck?

1
  • Did you ever get this resolved? In the same situation and I tried changing the graphics controller, per below, and still no luck. Oct 21, 2019 at 21:02

5 Answers 5

16

A YouTube user by the name foodisgood1989 has posted the following solution which has fixed this error for me:

In the system tab under settings for the android machine uncheck "Hardware clock in utc time" in the display tab set graphics controller to "VBoxVGA" and enable 3d hardware acceleration.

It's one of the comments under this (youtube.com/watch?v=u4Bw2jeYwZg) video.

4
  • It's one of the comments under this (youtube.com/watch?v=u4Bw2jeYwZg) video.
    – jahu
    Jan 24, 2019 at 20:49
  • it worked for me. Jul 29, 2019 at 19:06
  • 3
    Mine didn't work until i disabled 3d hardware acceleration. I also didn't need to turn off "hardware clock in utc time"
    – Ahmed
    Apr 18, 2020 at 19:22
  • 4
    With Android 9 (k49) and VirtualBox 6.1.10 on Ubuntu 20.04, all I had to do is go into the machine settings under the display tab and set the graphics controller to "VBoxVGA". No need to change the hardware clock in my case, and it's not actually possible ("invalid settings detected") to set the graphics controller to "VBoxVGA" and also enable 3D hardware acceleration at the same time (with my versions, as detailed at the start of this comment).
    – joe
    Aug 14, 2020 at 8:16
10

You are missing many steps:

1) When you see the selection press e on keyboard(For editing). [ You will see a line after it ]

2) Replace quiet with "nomodeset xforcevesa" (without commas). [ Then press b for boot ]

3) Your android will boot correctly only one time. [ Android will start running ]

4) Now press (Alt + F1) to launch console.

5) Type : mkdir /mnt/sda

6) Type : mount /dev/block/sda1 /mnt/sda

7) Type : vi /mnt/sda/grub/menu.lst [ You can search use of vi on Google ]

8) Replace quiet with "nomodeset xforcevesa" (without commas).

9) Press Esc, and :wq

10) Type reboot.[ Your android will work fine ]

3
  • you make my day
    – nima
    Jan 26, 2021 at 4:22
  • 2+ years later, this is the right solution!
    – sfxedit
    Oct 17, 2021 at 22:52
  • Save the day...
    – tabebqena
    Dec 13, 2021 at 15:18
4

Your Lenovo ThinkPad T400 has an Intel Core 2 Duo processor and 8GB DDR3 RAM. You allocated only 1GB Base Memory to the Android guest OS, but Android-x86 VirtualBox How To recommends that you allocate at least 2GB of RAM to the Android guest OS. For optimal performance, make sure you have enabled either VT-x or AMD-V in your host operating system's BIOS. The recommended starting size of 8GB is enough for creating a new VM. Click through the rest of the options for creating your hard disk. By default, your installation of Android-x86 will be able to automatically connect to the internet.

For Ubuntu 19.04 and earlier an alternative to installing Android in VirtualBox is in this answer. Anbox has >=4GB RAM recommended hardware requirements. I was able to install Anbox successfully and run apps in it.

6
  • Thanks. My T400 has 8GB RAM for Lubuntu. (1) Windows 8.1 having 2GB RAM on virtualbox works fine, while Android on virtualbox requires more RAM than Windows 8.1? (2) wine on my Lubuntu works fine, and does Anbox require more RAM than wine, and why does Anbox requiring 4GB RAM not work on Lubuntu?
    – Tim
    Oct 29, 2018 at 11:26
  • If I assign 4GB to the virtual machine for Android, will running the Android immediately reserve 4GB physical memory? My 8GB physical RAM is often used 80%, when not running virtualbox, and I worry running Android will immediately cause heavy thrashing.
    – Tim
    Oct 29, 2018 at 11:43
  • Thanks. I change the assigned memory size in the settings of the virtual machine to 2GB and then to 4GB, but starting Android still get stuck at the same place in both cases. I suspect that it is not the memory size but something else.
    – Tim
    Oct 29, 2018 at 13:59
  • You and I had a similar problem with Android-x86 in VirtualBox, so I'm starting to have my doubts about Android-x86, even though two instances is not a large enough sample size to properly judge the Android-x86 project.
    – karel
    Oct 29, 2018 at 16:22
1

If anyone else still has an issue after following the selected answer, it might be that you need to enable hardware virtualization for your computer. It seems Android VMs require this to be enabled. If you can not change the number of processors for your VMs (Settings > System > Processor), then you will know that hardware virtualization is not enabled for your machine.

You can turn on this setting in your BIOS. Here is a guide for Intel and AMD https://docs.fedoraproject.org/en-US/Fedora/13/html/Virtualization_Guide/sect-Virtualization-Troubleshooting-Enabling_Intel_VT_and_AMD_V_virtualization_hardware_extensions_in_BIOS.html.

After enabling hardware virtualization, follow the selected ansers directions if you're still having issues: https://askubuntu.com/a/1112620/1021026.

Note: In my BIOS settings it was called SMV, so make sure to read through all of your options (it's probably in there somewhere)!

1

Following jahu's suggestion I found that disabling "Hardware Clock in UTC Time", setting graphics controller to "VBoxVGA", but leaving "Enable 3D Acceleration" unchecked did the trick. I am virtualizing Android v9.0 (Pie).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .