Skip to content

Ubuntu - Virtual Machines

Ubuntu - Virtual Machines in the Modern Era

Section titled “Ubuntu - Virtual Machines in the Modern Era”

Running Ubuntu in a virtual machine (VM) is an excellent way to try it out, test software, or run it alongside your primary operating system. Modern virtualization software offers robust performance and features. Popular choices include:

  • Oracle VM VirtualBox: A free, open-source, and cross-platform virtualization tool.
  • VMware Workstation Player/Pro: A powerful commercial option (Player is free for non-commercial use) known for its performance and advanced features.
  • Microsoft Hyper-V: Integrated into Windows Pro and Server editions, offering good performance on Windows hosts.
  • KVM (Kernel-based Virtual Machine): A Linux-native, open-source solution built into the Linux kernel, often managed with tools like virt-manager.

This guide will focus on Oracle VM VirtualBox, a popular and free choice. Let’s walk through setting up an Ubuntu VM:

Step 1: Download VirtualBox. Navigate to the official Oracle VirtualBox website (https://www.virtualbox.org/). Click on the prominent “Downloads” link.

Step 2: Select the appropriate package for your host operating system (e.g., “Windows hosts,” “OS X hosts,” “Linux distributions”). Download the installer.

Step 3: Run the installer. Once downloaded, execute the installer file. You may encounter a security prompt; allow the installer to run.

Step 4: Follow the installation wizard. Click “Next” through the initial screens. You can generally accept the default settings for features and installation location unless you have specific needs.

Step 5: Network interfaces warning. The installer might warn you that your network connection will be temporarily interrupted. This is normal. Click “Yes” to proceed.

Step 6: Begin installation. Click “Install” to start copying files. You might be prompted to install device software (e.g., Oracle Corporation USB drivers); choose “Install” for these.

Step 7: Complete installation. Once finished, click “Finish”. VirtualBox should launch automatically if the option was checked.

Before you start, download the latest Ubuntu Desktop LTS (Long-Term Support) ISO image from the official Ubuntu website (https://ubuntu.com/download/desktop). LTS versions are recommended for stability and extended support.

Step 1: Launch VirtualBox. In the VirtualBox Manager window, click the “New” button (often a blue star icon).

Step 2: Name and Operating System. Enter a descriptive name for your VM (e.g., “Ubuntu 22.04 LTS”). VirtualBox will usually detect the “Type” (Linux) and “Version” (Ubuntu (64-bit)) automatically. If not, select them manually. Click “Next”.

Step 3: Memory size. Allocate RAM for your VM. A minimum of 2GB is often cited, but 4GB or more is recommended for a smooth experience, especially with the modern GNOME desktop. Adjust the slider or enter the value. Click “Next”.

Step 4: Hard disk. Select “Create a virtual hard disk now” and click “Create”.

Step 5: Hard disk file type. Choose “VDI (VirtualBox Disk Image)” unless you need compatibility with other virtualization software (then VHD or VMDK might be better). Click “Next”.

Step 6: Storage on physical hard disk. Select “Dynamically allocated.” This means the virtual disk file will only use space on your physical drive as it fills up, up to the maximum size you define. “Fixed size” can offer slightly better performance but takes up all the space immediately. Click “Next”.

Step 7: File location and size. Confirm the name and location for your VDI file. Set the size of the virtual hard disk. For Ubuntu Desktop, 25GB is a good minimum, but 50GB or more is better if you plan to install many applications. Click “Create”.

Step 8: Mount the Ubuntu ISO. With your new VM selected in the VirtualBox Manager, click “Settings” (gear icon).

Step 9: In the Settings window, go to the “Storage” section. Under “Storage Devices,” select the “Empty” CD/DVD icon under the “Controller: IDE” (or SATA). On the right-hand side, click the small CD icon next to “Optical Drive” and choose “Choose a disk file…”. Browse to and select the Ubuntu ISO image you downloaded. Click “OK”.

Step 10: Start the VM. Select your Ubuntu VM in the list and click the “Start” button (green arrow). The VM will boot from the Ubuntu ISO, and you can proceed with the Ubuntu installation (covered in another section).

Tip: After installing Ubuntu in the VM, install VirtualBox Guest Additions for better performance, screen resolution, and features like shared clipboard and drag-and-drop. This is usually done from the VM’s “Devices” menu -> “Insert Guest Additions CD image…” and then running the installer script within Ubuntu.