Skip to content

Installing Ubuntu inside of VirtualBox

Kristina edited this page Nov 2, 2017 · 1 revision

Linux operating systems are normally installed using live USB/CD/DVDs. A live USB/CD/DVD allows you to try the operating system without installing it on your computer by running the operating system from the computer's RAM. Just insert the USB, CD or DVD and Linux will load up. You may have to go into your BIOS and modify the settings so that it can boot from USB/CD/DVD. The OS will have very limited features and anything you install will be deleted when you reboot the computer. However there is an option to install the OS if you like it.

If you want to try a installed version of the Linux OS inside an isolated environment with no risks of messing up your system you can install it inside of a virtual machine. A virtual machine is an emulation of a computer system.

To setup a virtual machine you need a virtual machine monitor or hypervisor application, firmware or hardware that creates and runs virtual machines. VirtualBox, VMWare and Microsoft Hyper-V are different hypervisors that you can use to create virtual machines.

Below are the instructions on how to install Ubuntu Desktop inside of VirtualBox running in windows.

  1. Download and install the x86/amd64 version of VirtualBox from the VirtualBox website

  2. Download the Ubuntu Desktop ISO file from the Ubuntu website

  3. Run VirtualBox and click on the the New button. VirtualBox New Button

Note: The Kubuntu option will not be displayed on your version of VirtualBox. This is a virtual machine that I created for testing Kubuntu a version of Ubuntu that uses KDE for the desktop environment.

  1. Fill out the Name, Type, and Version fields on the screen. The Type should be set to Linux and the Version should be set to Ubuntu. I recommend you name the Virtual Machine Ubuntu so you know what OS is installed on it. VirtualBox name

  2. Click Next and select how much RAM you want the virtual machine to be able to use. You shouldn't select a value in the red zone because using too much RAM will hurt the performance of Windows and VirtualBox. However you don't want to set it to use too little RAM because that will cause performance issues with Ubuntu running inside of the Virtual Machine. VirtualBox Memory Size

  3. Click Next and select the Create a virtual disk now option.

  4. Click Create and select the type of Virtual Disk you want to use. The VDI format can only be used by VirtualBox. The VMDK format can be used by VirtualBox and other virtualization products like VMWare. The VHD format is used by Microsoft. I selected the VMDK format because I was going to use this Virtual Machine in WMWare at a later date. VirtualBox Harddrive Type

  5. Click Next and select if you want the hard drive in the Virtual Machine to be Dynamically Allocated which means it will only take up space as you install and download files in the virtual machine or Fixed Size which will run faster but will take longer to create and use up more space on your computer.

For example if you create a 15GBs dynamically allocated virtual drive then no space will be used until you install\download files inside of the virtual machine. If you create a 15GBs fixed virtual drive then the file for the Virtual drive will be 15GBs in size when the virtual machine is created.

VirtualBox Dynamic Versus Fixed

  1. Click Next and name your virtual drive then select how much space it's allowed to use.Ubuntu recommends at least 5GBs of hard drive space to run. However with a virtual drive if you run out of space you can't easily add more space. So it's best to make the hard drive larger then what you think you'll need so you don't run into that issue. I normally use 30GBs hard drives for just the OS and applications. You may have to make it bigger depending on your needs. You can also click on the folder idea to change where the virtual disk is saved. VirtualBox file size and location

When you click Create the virtual machine will be created and you can boot into it. However there are few settings you should change before you do so to make the Virtual Machine run better.

  1. Select your Virtual Machine from the list and click on the Settings button. VirtualBox select machine

  2. Click on the systems icon and then click on the Processor tab. You need to adjust the number of processors and execution cap in a way that allows for the virtual machine to run well but doesn't negatively impact Windows. For example if you have a computer that only has a single processor and you set the execution cap to 100 percent the virtual machine may hog the CPU slowing down Windows and causing performance issues with VirtualBox. However if you move the execution cap down to 5% on a single CPU computer then Ubuntu inside of VirtualBox will run poorly. Try to adjust the values to somewhere inside of the green area.I have to allow VirtualBox to use more then one CPU on my computer because I'll notice performance issues in Ubuntu if I only use one processor.

  3. Click on the Display icon and adjust the video memory the virtual machine can use. By default it's normally way too low. Try to adjust it to be within the green area. Now if you want you can turn on 3D acceleration but be aware that it causes problems with some desktop environments like Cinnamon or Plasma (KDE). VirtualBox Video Memory

  4. Exit the settings menu, select your virtual machine and click the Start button. VirtualBox select machine

  5. You should get a prompt asking you to Select a start up disk. Select the Ubuntu ISO file you downloaded in step 2. VirtualBox select startup disk

  6. The virtual machine will boot into Ubuntu and give you the option to Install or Try Ubuntu. Select the Install option and select the Erase disk and install Ubuntu option when prompted. Because a virtual machine is an isolated environment it won't actual erase the data on your hard drive.

You can find the instruction on how to install Ubuntu here

When the installation is done you should get this message: Ubuntu installed

  1. Click the Restart button and then Go to Devices & optical drives then select the remove disk from Virtual Drive (select the force unmount option if it appears) when it asks you to remove the start disk. VirtualBox remove disk

Now VirtualBox will boot into Ubuntu. Ubuntu works fine the way it is but you may noticed that it's capturing the mouse (you have to use the right alt key to release it), window animation are missing or that the graphics is a little choppy when you move the windows around. This can be fixed by installing VirtualBox guest additions. It's not required but will allow for Ubuntu to run better.You can read about the benefits of installing VirtualBox guest additions here

  1. Log into Ubuntu and then go to Devices and select the Install Guest Additions. VirtualBox install guest additions

  2. Click run on the prompt that shows up and input the password you setup when you installed Ubuntu when asked. VirtualBox run guest additions Ubuntu Password

  3. Verify that it installed correctly by looking at the command prompt and restart Ubuntu.

  4. Click on the Gear icon to bring up the System settings inside of Ubuntu and then click on the Software & Updates option. Ubuntu system settings

  5. Go to the Additional Drivers tab and select the Using x86 virtualization solution guest utilities for VirtualBox option for the innoTek Systemberatung GmbH: VirtualBox Graphic Adaptor and click Apply. VirtualBox additional drivers

Now guest additions should be installed.

Clone this wiki locally