This step-by-step tutorial contains the solution to one of the most common issues when using virtual machines from Oracle VM VirtualBox: after starting the virtual machine, it shows a black screen and it seems to not work anymore.
Do not panic! Luckily, there is an easy fix for the virtual machines (VMs) black screen issue.
#When can the black screen issue occur?
For the black screen issue, the root cause is – generally – the lack of free space on the VM hard disk.
First, we need to verify that this is your issue as well.
#How-to check how much free hard-disk space is available in Ubuntu?
-
If you restart your Ubuntu VM, keep pressing MAIUSC or SHIFT key in order to enter into the boot menu.
Select Advanced Options for Ubuntu -
Choose to continue in recovery mode.
Continue in recovery mode -
When you are in the recovery menu, check the “system summary”.
Choose system summary -
In the system information, you should be able to see how much space is available on each mounted device, as shown in the picture below:
The black screen issue occurs when the hard-disk is used 100%.
#How-to fix the black screen issue for your Ubuntu VM?
-
If your host machine is using Windows OS, increase the VM disk space using the VirtualBox Media manager.
Otherwise, you can achieve the same result using the following modifymedium command:
VBoxManage modifymedium "/my_path_to_vdi_file" --resize <new size in MB>This command can be used on both Windows and Linux OS.If this step has succeeded, you have now some *“*unallocated” space on your VM. -
Download a GParted Live CD/USB/HD/PXE Bootable Image. GParted is a free partition editor for graphically managing your disk partitions. Using this tool, you can easily grow or shrink your HDD drive (also on a VM).
-
Insert this Live CD into the primary Optical drive of your VM. Make sure that boot order is configured so that your optical drives are checked before all the other units.
-
Start or reboot your Ubuntu VM.
-
When it is initialized, choose default options for GParted.
-
Using GParted GUI, extend your VM hard-disk (consider at least 50% of your current hard-disk size) and apply the changes.
-
Exit from GParted (reboot your system).
-
The system will ask you to remove the GParted Live CD. When done, press Enter to continue.
