Why does Ubuntu 18.04 LTS hang at bootup when installed in VirtualBox?

I installed Ubuntu 18.04 LTS in VirtualBox using the default virtual machine settings. However, Ubuntu 18.04 LTS hangs at the bootup screen and never reaches the login screen. Why is this the case and how can it be fixed?


Solution 1:

In Virtualbox, shut down the vm, then edit settings of the Ubuntu Virtual Machine, then go to Display. Move the "Video memory" slider all the way to the right. Then also tick Acceleration: Enable 3D Acceleration.

Start up you vm again. This is on Virtualbox V5.2.12

Solution 2:

I tried all the above hints and none of them worked for me. After 3 more hours I realized that the previous Docker installation enabled Hyper-V on my (Win10) machine which obviously did not do well with VirtualBox. So, another hint is to double-check that Hyper-V or other hypervisor is not already running and disable it if yes. Good luck troubleshooting.

Solution 3:

The problem is that Ubuntu 18.04 LTS apparently doesn't like the 1GB RAM setting that is the default in VirtualBox. Although Ubuntu 18.04 LTS is advertised to work with 1GB RAM, in my case it didn't work.

Shut down the virtual machine and give it more memory, ideally at least 2GB. There is no need to reinstall Ubuntu 18.04 LTS. Actually, installing it with the default 1GB RAM only is ideal, as larger RAM sizes lead to larger swap file sizes, and swapping inside VirtualBox isn't recommended as there would be two levels of swapping then (host and guest).

After restarting the virtual machine with more memory, it no longer hangs at the bootup screen.

At the same time the memory size is adjusted, it may make sense to give the virtual machine more CPUs. The default CPU count is 1, but most even low-end laptop CPUs today have 4 virtual CPU cores at least, and the better ones have 8.

Solution 4:

I am running a VM with Ubuntu 18.04 on macOS. The guest has plenty of base memory (RAM) and multiple processors.

(This is a raw VM that I used directly over HW on a PC in a different location. Usually when there are OS updates that's where I handle them. I suspect on a previous update of the guest something was installed that messed the setup on the macOS+rawVM combo.)

My machine was working fine on the macOS VM until one day it stopped booting properly. It would get stuck just before the login screen, showing the purple background with Ubuntu written on the bottom.

This is what I did to fix it:

  1. Restart VB application, and host. Didn't fix the issue.

  2. Update VirtualBox from 6 to 6.08. Didn't fix the issue.

  3. Disable 3D acceleration as suggested in other posts. Didn't fix the issue; so I re-enabled it. My video memory is already at 128 MB so I didn't change that.

  4. Changed the graphics controller from VMSVGA to VBoxSVGA. This fixed the issue. It is now working again properly (and my 3D acceleration is still enabled).