Using Ubuntu through a Virtual Machine
Ubuntu is a Linux operating system that is widely used for bioinformatics. If you have not used a Linux system before, an Ubuntu virtual machine is an ideal way to try the programs documented on this website.
A virtual machine is a computer file, typically called an image, that behaves like an actual computer. It acts as a computer within a computer. Virtual machines run in a window, much like any other program running in a window on your computer. The virtual machine is sequestered from the rest of the system, meaning that the software inside a virtual machine can not tamper with the computer itself. This produces an ideal environment for testing other operating systems, and running software or applications on operating systems they were not originally intended for.
An Ubuntu virtual machine can be created using VirtualBox, and an Ubuntu disk image. VirtualBox is a program that can be used to create, manage, and access virtual machines. A disk image is a file that acts like a compact disc, or another storage device. VirtualBox and the Ubuntu disk image are freely available online.
Contents
- Files required to set up an Ubuntu virtual machine
- How to create an Ubuntu virtual machine using VirtualBox
- Increasing the screen resolution of the Ubuntu virtual machine
- See also
- References
Files required to set up an Ubuntu virtual machine
To set up an Ubuntu virtual machine, you will need an Ubuntu disk image, a file to install VirtualBox, and the VirtualBox Extension Package. This requires around 13 GB of free hard drive space on your computer in total. The Ubuntu disk image is around 2 GB in size, and may take a while to download depending on your internet connection. The file required to install VirtualBox is around 108 or 123 MB in size, depending on the platform of your computer (i.e. Windows or Mac).
Direct links to download required files
- The Ubuntu disk image (filename:
ubuntu-18.04.4-desktop-amd64.iso
) - VirtualBox installer for Windows
- VirtualBox installer for Mac
- VirtualBox Extension Pack (all platforms)
If the above links do not work, they may have expired. In this case, the above files can be found on the VirtualBox website and the Ubuntu website.
How to create an Ubuntu virtual machine using VirtualBox
- Download the VirtualBox installer for your computer (either Windows or Mac).
- Once the VirtualBox installer is downloaded, open it and follow the on-screen instructions to install the VirtualBox program.
- Windows only: If you get a âWindows Securityâ prompt asking âWould you like to install this device software?â for driver software from âPublisher: Oracle Corporationâ, select âInstallâ.
- Mac only: If you get a âThis package will run a program to determine if the software can be installedâ prompt while installing VirtualBox, select âContinueâ. You may also be asked to enter your user password while installing VirtualBox on a Mac.
- Once installed, open the VirtualBox program.
- In VirtualBox, click on âNewâ (the blue badge). This will open a menu to create a new virtual machine.
- In the âNameâ field of the âName and operating systemâ window, type âubuntuâ. VirtualBox will automatically set the type and version for this virtual machine as âLinuxâ and âUbuntuâ.
- Select âNextâ to proceed to the âMemory sizeâ section.
- In this section, you can set the amount of Random Access Memory (RAM) that the virtual machine can use. A suggested amount of RAM will automatically be selected when you get to this page, but you can increase the amount of RAM allocated using the slider on this page.
- Note: If you use the slider to increase the amount of RAM allocated on the âMemory Sizeâ page, keep the slider in the green zone. Setting the slider in the orange or red zone (>50% of your computerâs available RAM) will negatively affect the performance of the virtual machine.
- Select âNextâ to proceed to the âHard diskâ page.
- Select âCreate a virtual hard disk nowâ, and then select âCreateâ.
- On the âHard disk file typeâ page, select âVDI (VirtualBox Disk Image)â, and then select âNextâ.
- On the âStore on physical hard diskâ, select âDynamically allocatedâ, and then select âNextâ to proceed to the âFile location and sizeâ page.
- On this page, you can change the location and size of the virtual hard disk. There is no need to adjust the size of the virtual hard disk, but take note of its location (the folder/directory it will be created in). Select âCreateâ.
- In the left side of the VirtualBox main menu, double-click the name of the virtual machine you just created (âubuntuâ).
- This will bring up the âSelect start-up diskâ window. In this window, select the folder icon to open the âOptical Disk Selectorâ menu.
- In this menu, select âAddâ, which will open a window titled âPlease choose a virtual optical disk fileâ.
- In this window, go to the folder into which the Ubuntu disk image downloaded (e.g. âDownloadsâ), and click the Ubuntu disk image (filename:
ubuntu-18.04.4-desktop-amd64.iso
) to select it, and then select âOpenâ. - This will bring you back to the âOptical Disk Selectorâ window. Select the Ubuntu disk image you selected in the previous window, and click on âChooseâ.
- This will bring you back to the âSelect start-up diskâ window. The Ubuntu disk image should be selected in the drop down menu (this read âEmptyâ before the Ubuntu disk image was added). Select âStartâ to start the virtual machine.
- The Ubuntu virtual machine is now running in its own window. It may take a few minutes to start up the first time.
- On the âWelcomeâ screen in Ubuntu, select âInstall Ubuntuâ.
- In the âKeyboard layoutâ section, select your keyboard layout, and then select âContinueâ. This will bring you to the âUpdates and other softwareâ window.
- In this window, in the section âWhat apps would you like to install to start with?â, select âMinimal installationâ.
- In the âOther optionsâ section, select âDownload updates while installing Ubuntuâ, and leave âInstall third-party softwareâŚâ unselected. Select âContinueâ to proceed to the âInstallation typeâ window.
- In this window, select âErase disk and install Ubuntuâ. As this is a virtual machine, in this instance âdiskâ refers to the virtual disk image (
.vdi
) file created earlier (see steps 12 to 15). Select âInstall nowâ. - A window titled âWrite the changes to disks?â will appear. In this window, select âContinueâ.
- This will bring you to the âWhere are you?â window. In this window, enter your location (which is needed to set the system clock) and select âContinueâ.
- Fill in the requested details in the âWho are you?â window: your name, your computerâs name, your username (both of which will be filled in automatically when you enter your name), and your password. Make sure you remember your password, you will need it to install programs in your Ubuntu virtual machine. Select âContinueâ to proceed.
- At this point, Ubuntu will begin installing on the virtual disk image created earlier (the
.vdi
file). This will take a few minutes. - Once the installation is complete, select âRestart Nowâ from the âInstallation completeâ dialog window.
- When asked âPlease remove the installation media and press ENTERâ, press Enter (a.k.a. Return).
- The virtual machine will then restart, and the Ubuntu login page will load. On this page, select the user you created during the installation, and enter your password to log in.
- Once you have logged in, you have finished setting up your Ubuntu virtual machine. Click through the âWhatâs new in Ubuntuâ window for a brief introduction to Ubuntu.
- When you want to close your Ubuntu virtual machine, close the window it is running in to bring up the âClose Virtual Machineâ window, select âPower off the machineâ and click âOKâ. This is the equivalent of shutting down the machine. Alternatively, you can select âPower offâ within the Ubuntu virtual machine.
Once you have finished installing the Ubuntu virtual machine, you can delete the Ubuntu disk image (filename: ubuntu-18.04.4-desktop-amd64.iso
), and the VirtualBox installer.
Increasing the screen resolution of the Ubuntu virtual machine
At this point, the Ubuntu virtual machine takes up only a small portion of the VirtualBox window it runs in. To increase the screen resolution of the Ubuntu virtual machine, you will need to download the VirtualBox Extension Package and follow the steps below.
- Once downloaded, double click the VirtualBox Extension Pack (file extension
.vbox-extpack
). If you have installed the VirtualBox program, it will open this file. - VirtualBox will open with a window notifying that an extension pack is about to be installed. In this window, select âInstallâ to proceed with the extension pack installation.
- Scroll to the bottom of the Terms and Conditions window that opens, and select âI Agreeâ to install the extension pack.
- Open the Ubuntu virtual machine in VirtualBox.
- In the menu bar of the VirtualBox window in which Ubuntu is running, select the âDevicesâ menu, and select âInsert Guest Additions CD imageâŚâ.
- A notification will appear in the Ubuntu virtual machine: ââVBox_GAs_6.1.4â contains software intended to be automatically started. Would you like to run it?â. In this window, select âRunâ, and enter your Ubuntu password to install the VirtualBox Guest Additions on the Ubuntu virtual machine.
- A terminal window will open showing the VirtualBox Guest Additions installation progress. Once the installation has finished, press Return (Enter) to close this window.
- Close the Ubuntu virtual machine by closing the window it is running in, and selecting âPower off the machineâ from the âClose Virtual Machineâ window.
- Open the Ubuntu virtual machine in VirtualBox.
- In the menu bar of the window in which Ubuntu is running, select the âViewâ menu, and confirm that âAuto-resize Guest Displayâ is enabled.
See also
- Introduction to the command line
- Windows Subsystem for Linux
- The Ubuntu Website
- The VirtualBox Website