Introduction to Virtualization and Ubuntu
Virtualization, the process of creating a virtual version of something – be it a server, operating system, storage device, or network resources – is a cornerstone of modern computing. It allows individuals and organizations to run multiple operating systems on a single physical machine, optimizing resource utilization and offering unparalleled flexibility. For software developers, IT professionals, and even curious hobbyists, this capability is invaluable for testing, development, and learning.
Ubuntu, a popular and user-friendly Linux distribution, has gained widespread adoption due to its robust performance, extensive software repositories, and strong community support. Its open-source nature makes it an attractive choice for a variety of applications, from web servers and cloud computing to desktop workstations. Combining the power of Ubuntu with the flexibility of virtualization, specifically through VirtualBox, unlocks a powerful environment for experimentation and development without impacting your primary operating system.

VirtualBox, developed by Oracle, is a free and open-source hypervisor that enables users to create and run virtual machines (VMs) on their existing hardware. It supports a wide range of guest operating systems, including various Linux distributions, Windows, macOS, and Solaris. This article will guide you through the essential steps of installing Ubuntu within a VirtualBox environment, providing a clear and concise roadmap for setting up your own Linux virtual machine.
Preparing Your VirtualBox Environment
Before embarking on the Ubuntu installation, it’s crucial to ensure your VirtualBox environment is properly set up and that you have the necessary components. This preparation phase sets the stage for a smooth and efficient installation process.
Downloading and Installing VirtualBox
The first step is to acquire VirtualBox itself. Visit the official VirtualBox website (https://www.virtualbox.org/) and navigate to the downloads section. You’ll find different platform packages for Windows hosts, macOS hosts, Linux distributions, and Solaris hosts. Download the installer appropriate for your operating system and follow the on-screen instructions to complete the installation. The installation process is generally straightforward and requires minimal configuration.
Obtaining the Ubuntu ISO Image
Next, you’ll need the Ubuntu installation image. This image, typically in the .iso format, contains all the necessary files to install Ubuntu. Navigate to the official Ubuntu download page (https://ubuntu.com/download/desktop). You can choose from the latest Long Term Support (LTS) version for stability or the latest interim release for newer features. Download the desired ISO file and save it to a location you can easily access.
Creating a New Virtual Machine in VirtualBox
With VirtualBox installed and the Ubuntu ISO in hand, you can now create a new virtual machine within VirtualBox.
- Launch VirtualBox: Open the Oracle VM VirtualBox application.
- Click “New”: In the VirtualBox Manager window, click the “New” button to start the Create Virtual Machine wizard.
- Name and Operating System:
- Name: Provide a descriptive name for your virtual machine, such as “Ubuntu Desktop VM.”
- Machine Folder: Choose a location on your hard drive where the VM files will be stored.
- Type: Select “Linux.”
- Version: Select the appropriate Ubuntu version from the dropdown menu (e.g., “Ubuntu (64-bit)”). If your desired version isn’t listed, choose the closest match or the generic “Linux 64-bit.”
- Memory Size: Allocate RAM to your virtual machine. For a smooth Ubuntu desktop experience, it’s recommended to allocate at least 2GB (2048MB), and ideally 4GB (4096MB) or more if your host system has ample RAM. VirtualBox will show a recommended range.
- Hard Disk:
- Select “Create a virtual hard disk now” and click “Create.”
- Hard disk file type: For most users, “VDI (VirtualBox Disk Image)” is the default and recommended option.
- Storage on physical hard disk: Choose between “Dynamically allocated” and “Fixed size.” Dynamically allocated grows as needed, saving host disk space initially, while fixed size is faster but occupies its full size from the start. Dynamically allocated is usually preferred for general use.
- File location and size: Specify the name and location of your virtual hard disk file and set its size. A minimum of 20GB is recommended for Ubuntu Desktop, but 30-50GB provides more breathing room for applications and files.
- Click “Create”: Once these settings are configured, click “Create” to finalize the VM creation.
Installing Ubuntu on the Virtual Machine
With your virtual machine configured, you can now proceed with the Ubuntu installation, which is very similar to installing Ubuntu on a physical machine.
Starting the Virtual Machine and Booting from ISO
- Select Your VM: In the VirtualBox Manager, select the Ubuntu VM you just created.
- Click “Start”: Click the “Start” button.
- Select Start-up Disk: A “Select start-up disk” window will appear. Click the folder icon to browse for files. Navigate to the location where you saved the Ubuntu ISO image and select it.
- Click “Start”: Click the “Start” button to boot the VM.
The virtual machine will now boot from the Ubuntu ISO image. You will be presented with the Ubuntu boot menu.
Ubuntu Installation Steps

- Welcome Screen: After booting, you’ll see the Ubuntu installer’s welcome screen. You have two options: “Try Ubuntu” (to test it without installing) or “Install Ubuntu.” Select “Install Ubuntu.”
- Keyboard Layout: Choose your preferred keyboard layout and click “Continue.”
- Updates and Other Software:
- Normal installation: This option includes a web browser, utilities, office software, games, and media players.
- Minimal installation: This option includes a web browser and basic utilities.
- Download updates while installing Ubuntu: Recommended for ensuring you have the latest security patches and software versions.
- Install third-party software for graphics and Wi-Fi hardware and additional media formats: Crucial for better hardware support and multimedia playback. It’s highly recommended to check this box.
- Installation Type: This is a critical step.
- “Erase disk and install Ubuntu”: This is the simplest and most common option for a new VM. It will format the virtual hard disk you created and install Ubuntu. Since it’s a VM, this action is safe and won’t affect your host system.
- “Something else”: This option allows for manual partitioning, which is usually unnecessary for a basic Ubuntu VM installation.
- Choose “Erase disk and install Ubuntu” and click “Install Now.”
- Confirm Disk Changes: A confirmation dialog will appear, detailing the changes to be made to the virtual disk. Click “Continue” to proceed.
- Location: Select your time zone by clicking on the map or typing your city. Click “Continue.”
- Who are you?
- Your name: Enter your name.
- Your computer’s name: This will be the hostname of your Ubuntu VM.
- Pick a username: This will be your login username.
- Choose a password: Create a strong password for your account.
- Confirm your password: Re-enter your password.
- Log in automatically or Require my password to log in: It’s generally recommended to require a password for security.
- Installation Progress: The installer will now copy files and install Ubuntu. This process can take some time.
- Installation Complete: Once the installation is finished, you’ll see a message stating “Installation is complete.” Click “Restart Now.”
The virtual machine will restart. Before it boots from the virtual hard disk, VirtualBox might prompt you to remove the installation medium. If it doesn’t, you can manually eject the Ubuntu ISO from the VM’s virtual optical drive via the “Devices” menu in the VM window.
Post-Installation Configuration and Guest Additions
After the initial installation and reboot, you’ll be greeted with the Ubuntu login screen. Log in with the username and password you created. This section covers essential post-installation steps to enhance your Ubuntu VM experience.
Installing VirtualBox Guest Additions
VirtualBox Guest Additions are a set of device drivers and system applications designed to improve the performance of a guest operating system running inside a VirtualBox VM. Installing them provides crucial features like:
- Seamless mouse integration: Move your mouse between the host and guest seamlessly without needing to capture/release it.
- Shared clipboard: Copy and paste text between your host and guest.
- Drag and drop functionality: Drag files between host and guest.
- Better video performance: Higher screen resolutions, better graphics performance, and automatic resizing of the guest display.
- Shared folders: Access folders on your host system from within the guest.
Steps to Install Guest Additions:
- Start Your Ubuntu VM: Ensure your Ubuntu virtual machine is running and you are logged in.
- Insert Guest Additions CD Image: In the VirtualBox VM window’s menu bar, go to Devices > Insert Guest Additions CD image….
- Run the Installer:
- A dialog box may appear in Ubuntu asking if you want to run the software on this CD. Click “Run.”
- If no dialog appears, open the File Manager in Ubuntu, navigate to the “Media” section, and find the CD icon labeled “VBox_GAs_[version].” Open it.
- You’ll see a list of files. Right-click on an empty space within this folder and select “Open in Terminal.”
- In the terminal window, type the following command and press Enter:
bash
sudo ./VBoxLinuxAdditions.run
- You will be prompted to enter your user password. Type it and press Enter.
- Installation Process: The Guest Additions installer will run in the terminal. Watch for any error messages, though it usually completes without issues.
- Reboot the VM: Once the installation is complete, restart your Ubuntu virtual machine for the changes to take effect. Go to the Ubuntu menu, click the power icon, and select “Restart.”
Basic System Updates
It’s good practice to ensure your Ubuntu system is up-to-date after installation.
- Open Terminal: You can open the terminal by searching for “Terminal” in the Ubuntu applications menu or by pressing
Ctrl + Alt + T. - Update Package Lists:
bash
sudo apt update
This command fetches the latest information about available packages from the Ubuntu repositories. - Upgrade Installed Packages:
bash
sudo apt upgrade
This command installs the newer versions of all packages that are currently installed on your system. You may be prompted to confirm the upgrade by typing ‘Y’ and pressing Enter. - Autoremove Unused Packages (Optional):
bash
sudo apt autoremove
This cleans up any packages that were automatically installed to satisfy dependencies for other packages and are no longer needed.
Configuring Shared Folders (Optional)
Shared folders allow you to easily transfer files between your host and guest operating systems.
- Shutdown the VM: Shut down your Ubuntu VM completely.
- VM Settings: In the VirtualBox Manager, select your Ubuntu VM and click “Settings.”
- Shared Folders: Navigate to the “Shared Folders” section.
- Add Shared Folder: Click the “Add shared folder” icon (a folder with a plus sign).
- Folder Path: Click the dropdown arrow next to “Folder Path” and select “Other…” to browse for a folder on your host machine that you want to share.
- Folder Name: Give the shared folder a descriptive name (e.g., “UbuntuShare”).
- Make Permanent: Check the “Make Permanent” box if you want the shared folder to be available every time the VM starts.
- Auto-mount: Optionally, check “Auto-mount” to have the folder automatically mounted when Ubuntu boots. If you don’t auto-mount, you’ll need to mount it manually within Ubuntu.
- Click “OK”: Click “OK” to save the settings.
- Start the VM and Mount (if not auto-mounted): Start your Ubuntu VM. If you enabled auto-mount, the shared folder should appear in your file manager. If not, you’ll need to mount it manually via the terminal. For example, if your shared folder name is “UbuntuShare” and you want to mount it to
/mnt/shared_ubuntu, you would run:
bash
sudo mount -t vboxsf UbuntuShare /mnt/shared_ubuntu
You might need to create the mount point directory first:sudo mkdir /mnt/shared_ubuntu.

Conclusion: Embracing Your New Ubuntu Virtual Environment
You have now successfully installed Ubuntu within VirtualBox and configured essential post-installation settings, including the invaluable VirtualBox Guest Additions. This process has provided you with a safe, isolated, and versatile environment to explore the world of Linux.
Whether you intend to use this Ubuntu VM for software development, server administration practice, learning new programming languages, or simply to experiment with different applications and configurations, you now possess a powerful tool. The flexibility offered by virtualization means you can create multiple such environments, each tailored to specific tasks, without the need for additional hardware.
Remember the benefits you’ve gained: seamless mouse integration, clipboard sharing, drag-and-drop capabilities, and improved display performance, all thanks to the Guest Additions. Furthermore, keeping your system updated through apt update and apt upgrade will ensure you’re running a secure and robust operating system. The ability to set up shared folders further bridges the gap between your host and guest systems, streamlining your workflow.
This installation is just the beginning. Dive deeper into Ubuntu’s vast repositories, discover new software, and leverage the power of the Linux command line. Your virtual Ubuntu environment is ready for whatever challenges and opportunities you present it with. Enjoy exploring the extensive capabilities of this open-source operating system within the convenient framework of VirtualBox.
