How to Download Ubuntu on VirtualBox. Tutorial

Last update: 04/10/2024
How to Download Ubuntu on VirtualBox

Oracle VirtualBox is a cross-platform virtualization application . It installs on existing Intel or AMD-based computers, whether they are running Windows , Mac , Linux , or Solaris operating systems . Learn more about how to download Ubuntu in VirtualBox.

VirtualBox can create and run a "guest" operating system (virtual machine) in a window of the host operating system. The virtual machine provides an autonomous environment in which you can experiment with new software without risking damaging changes to the host operating system.

We provide a step-by-step guide showing how to install Ubuntu on VirtualBox, as well as an example of installing Ubuntu as a guest machine. We will also explain how to exchange files between the operating system and the host.

You can also read: How to Install and Use VirtualBox. Updated Guide

How to download Ubuntu on VirtualBox

Please note that the instructions here are based on the latest version of VirtualBox . If you have an older version of VirtualBox installed, your experience may differ. I recommend using the latest version of VirtualBox to avoid problems. The VirtualBox forum is a good place to find a solution if you encounter any issues.

Go to the VirtualBox website here to download the binary program for your current operating system. Since our host machine runs Windows, I'll choose 'x86/amd64' from the Windows hosts. Once the download is complete, run the executable file. Continue with the VirtualBox installation using the default settings. This will open VirtualBox at the end of the installation.

How to Download Ubuntu on VirtualBox
How to Download Ubuntu on VirtualBox

Go to VirtualBox

Create the virtual machine

  1. «Click on the New icon»;
  2. «Enter a name for the new virtual machine»Since I am planning to install Ubuntu 14.04, I will enter 'ubuntu1404';
  3. «Note that VirtualBox automatically changes 'Type' to Linux» and 'Version' to 'Ubuntu (64 bit)'. These two options are exactly what we need; The Memory size depends on the memory size of the host machine. In my case, I have 12 GB of physical RAM. I like to allocate as much as possible for Ubuntu but leave some for my Windows host machine. I choose 8192 MB for my Ubuntu. Note that VirtualBox will create a swap partition with the same amount of space as the base memory you have entered here. So later when you are selecting the virtual hard disk size, make sure it is large enough as the hard disk will be divided into root (/) and swap partitions. The root partition by default contains all the system files, program settings, and documents.
  4. «Accept the default» 'Create a virtual hard disk now' and «click the Create button»;
  5. “Continue to accept drive file type” 'VDI' default and click the 'Next' button;
  6. Default, «modifies the Storage Type» from “Dynamic allocation” to “Fixed size” in order to increase performance; For virtual hard disk space, the default value is 8GB, which is too little for RNA-Seq analysis. In my case I chose 100GB since I have plenty of space on my hard disk.
  7. You want to choose a good size for your RNA-Seq analysis. If you find that the disk space is not large enough, you will need to go through these steps again to create another virtual machine.
  8. «Click the Create button» and VirtualBox will generate the Ubuntu virtual machine;
  9. Now the virtual machine is created. We are ready to install Ubuntu on this virtual machine, «select your new virtual machine» y «click the Settings button»;
  10. «Click on the Storage category» and then 'Empty' in Controller:IDE;
  11. «Press the «CD/DVD» button y «choose the Ubuntu ISO file to mount»;
  12. When you download the Ubuntu ISO file, "make sure to select the 64-bit version";
  13. Also make sure that VT-x virtualization technology is enabled in your computer's BIOS/Basic Input Output System. Since the Tophat program can take advantage of multiple processors/threads, it is a good idea to specify a large number of processors in the virtual machine (the default is 1);
  14. You can change this number by clicking on the 'System' category. In this case, change the number of CPUs to 4, since 4 is the largest value shown in the green bar in my case. You can now click on the 'OK' button to continue;
  15. VirtualBox may display a message about the 'Auto Capture Keyboard' option. «Read the message and select the option Do not show this message again» before pressing OK.

Install Ubuntu

  1. «Go back to Oracle VM VirtualBox Manager», «press on the new Ubuntu virtual machine» and click the 'Start' button;
  2. You will now see a 'Welcome' screen, «Click the Install Ubuntu button»Please note that the installation process may vary slightly from version to version. This tutorial is based on Ubuntu 14.04.1;
  3. «Click the Continue button»;
  4. «Make sure Erase disk and install Ubuntu is selected» and then you must «click on Install Now»;
  5. Ubuntu will ask you some questions. If the default option is good, «click the Continue button»;
  6. In the “Who are you?” dialog box, «enter your name», your username and password. Note that this user will have root/sudo privileges. Click the “Continue” button;
  7. The installation will continue until it is complete;
  8. Once the installation is complete, press reboot now. When you see a screen with a black background that says “Please remove the installation media and close the tray (if present)” and then press ENTER;
  9. then "Log in with your previously chosen password" and click the 'Enter' button;
  10. The Ubuntu Desktop operating system is ready. You may find that the desktop screen is too small. Don’t worry. You can easily solve this with “VirtualBox Guest Additions”.

How to download Guest Additions

After the Ubuntu guest machine is installed, you will find that the Ubuntu OS screen size is not extensible and you cannot share folders between the guest machine and Ubuntu.

  Containers without root: A complete guide to running and troubleshooting permissions in restricted environments

The Guest Additions software provides additional capabilities to the guest virtual machine, including mouse pointer integration, improved video support, folder sharing, clipboard sharing , etc.

Before proceeding to install Guest Additions, ensure that the current user has sudo/root privileges. If the current user does not have sudo/root privileges or you are unsure, run the following terminal command from an account (such as the user created when Ubuntu was first created) with root privileges to enable root privileges for the current user.

To install Guest Additions:

  1. «Click on Devices > Insert Guest Additions CD images».
  2. «Click the Run button» (next to the “Cancel” button) to start the installation. Please note that the version of VBOXADDITIONS must match the version of VirtualBox you have installed.
  3. Installing Guest Additions requires root privileges. «Enter the user's password» (assumes the current user has sudo privileges).
  4. When the installation is finished, «press the Return key» to close the terminal window.
  5. Now get ready to reboot your system to enable the change. «Click on Turn off" in the menu and then click the “Restart” button.
  6. After rebooting Ubuntu, you will notice that the desktop resolution is much better.

share folders

Before enabling shared folders on the host computer, make sure you have installed the VirtualBox Guest Additions software on the host computer.

  1. When the Ubuntu guest machine is on, «Click Devices > Shared Folder Settings.»
  2. «Select Machine Folders» y «press the add button» (plus sign)
  3. «Find the folder you want to access» from the guest machine. «Check the auto-mount options» and make it permanent, «click the OK button».
  4. «Click the OK button» once again.
  5. Now «type terminal» in the script to open a terminal.
  6. «Type the following line in Terminal» to add a user to the “vboxsf” group. This step is necessary in order to use the VB “Shared Folder” feature:

    sudo adduser brb vboxsf

  7. «Replace brb» with your account name in Ubuntu. When you're done, «reboot the Ubuntu guest machine» and go to the /media/ directory.
  8. From Nautilus (file manager in Ubuntu), «click Computer > File System > Media folder» and inside it you will see a folder starting with sf_ (the folder name is sf_Downloads in our example).
  9. You can now transfer files between the Ubuntu guest machine and the Windows guest machine in Nautilus.

Although the shared folder system in VirtualBox is a nice feature, using the VirtualBox shared folder directly for fastq data, annotation or output directory can significantly reduce performance compared to a native (Ubuntu) or native VirtualBox system.