Trouble with Ubuntu installation in VirtualBox

Solution 1:

3D acceleration in a VM

When installing more recent versions of Ubuntu we do rely on the presence of a graphics card capable of 3D acceleration needed for Compiz and Unity.

In a bare metal installation such a graphics adapter almost always is present. Ubuntu will then load the appropriate driver on boot. This is different in a virtualized machine where a virtual graphic card providing (limited) 3D capabilities will only be installed with a driver provided by the guest additions.

Guest Additions from root shell

As we can not log in or boot the graphical desktop to aid us with mounting the Guest Additions iso we will have to do that from the command line after we boot into a root shell.

We first have to load the Guest Additions .iso from Virtual Box Manager ("Devices") to be presented as /dev/cdrom (alternatively /dev/sr0) to the guest OS. We then additionally need to mount the CD in our guest Ubuntu to be able to install them.

From a root shell where we gained read/write access to our virtual hard disk (see link above) we can do so with the following commands:

mount /dev/cdrom /mnt              # or any other mountpoint
cd /mnt
./VBoxLinuxAdditions.run
reboot

Troubleshooting

  • Sometimes we still may not be able to boot to the desktop. Then we may try if an update of Ubuntu resolves the issue. From a root shell run:

    apt-get update && apt-get dist-upgrade
    reboot
    
  • If we still can't log in, we may try if we can do so from TTY. Enter the virtual terminal by pressing HOST + F1. Login with the administrator user and password you gave on installation of Ubuntu (the password will not be displayed, not even asterisks). Then start the login manager lightdm as follows:

    sudo lightdm
    

    Sometimes after we had done this once, we may be able to do a normal reboot and login as usual.

  • If we are unable to even start the graphical installer we may have an issue with the host graphics driver. We can try to install with a text based installation or in 12.04 from the Alternate CD. You may also try with nomodeset on boot.

Related Questions

  • How do I boot into a root shell?
  • How do I install Guest Additions in a VirtualBox VM?
  • Can't install Ubuntu since 10.10

Solution 2:

Even I faced the same issue. After lots of searching on the web,I finally realized that virtualization was disabled in BIOS settings which was causing this issue.

I Enter in to BIOS settings, search for Virtualization and Enable it.

Problem is solved!! !

Solution 3:

I had this black screen of death when I tried to install Ubuntu 12.04 LTS in Virtualbox under Windows 7. It may sound odd but rebooting my Windows machine solved the problem for me.