The idea of installing “Ubuntu on Ubuntu” might initially sound like a recursive loop or a complex scenario, but it typically refers to two primary practical situations: setting up a virtual machine or dual-booting a separate partition on a computer that already runs Ubuntu. Both methods offer distinct advantages for developers, system administrators, and enthusiasts alike. Whether you aim to test new software in an isolated environment, experiment with different Ubuntu versions, or manage multiple operating systems efficiently, understanding these installation pathways is crucial. This guide will delve into the intricacies of both virtual machine installations and dual-boot configurations, providing a comprehensive overview for users seeking to expand their Ubuntu-based computing capabilities.

Installing Ubuntu within a Virtual Machine
Virtualization allows you to run an operating system, like a new instance of Ubuntu, inside another operating system, known as the host. This creates an isolated environment that is perfect for testing, development, or simply exploring a different operating system without altering your primary installation. The most popular virtualization software for this purpose is Oracle VM VirtualBox, a free and open-source hypervisor. Other viable options include VMware Workstation Player (free for non-commercial use) and GNOME Boxes (a simpler frontend for QEMU/KVM).
Setting Up the Host Environment
Before installing Ubuntu as a guest OS, ensure your host machine meets the minimum requirements. This includes sufficient RAM (at least 4GB recommended for smooth virtual machine operation, more is always better), ample disk space (25GB or more for the guest OS and its applications), and a compatible CPU with hardware virtualization support (Intel VT-x or AMD-V). Most modern processors support this, but it might need to be enabled in your computer’s BIOS/UEFI settings.
Downloading the Ubuntu ISO Image
The first step in the installation process is to obtain the Ubuntu installation media. This is typically in the form of an ISO disk image file. You can download the latest stable version of Ubuntu Desktop or Ubuntu Server from the official Ubuntu website (ubuntu.com/download). Choose the version that best suits your needs; for most desktop users, “Ubuntu Desktop” is the appropriate choice.
Creating a New Virtual Machine in VirtualBox
- Launch VirtualBox: Open Oracle VM VirtualBox on your host Ubuntu system.
- Click “New”: This initiates the virtual machine creation wizard.
- Name and Operating System:
- Name: Give your virtual machine a descriptive name (e.g., “Ubuntu Guest VM”).
- Machine Folder: Choose where to store the virtual machine files.
- Type: Select “Linux”.
- Version: Choose the specific Ubuntu version you downloaded (e.g., “Ubuntu (64-bit)”).
- Memory Size: Allocate RAM to your virtual machine. A minimum of 2GB (2048MB) is recommended for Ubuntu Desktop, but 4GB (4096MB) or more will provide a much better experience. Ensure you don’t allocate more RAM than your host system can spare.
- Hard Disk:
- Select “Create a virtual hard disk now.”
- Hard disk file type: VDI (VirtualBox Disk Image) is the default and recommended option.
- Storage on physical hard disk: Choose “Dynamically allocated.” This means the virtual hard disk file will only grow as needed, up to the maximum size you define, saving host disk space.
- File location and size: Specify where to save the virtual disk file and set its maximum size. 25GB is a good starting point for Ubuntu Desktop, but you can allocate more if you plan to install many applications or store large files.
- Click “Create”: This finalizes the creation of the virtual machine’s settings.
Installing Ubuntu within the Virtual Machine
Once the virtual machine is created, you need to configure it to boot from the Ubuntu ISO image you downloaded.
- Select Your VM: In the VirtualBox Manager, click on the newly created Ubuntu VM.
- Click “Settings”: Access the VM’s configuration.
- Go to “Storage”:
- Under “Controller: IDE,” you will see an empty CD/DVD drive icon.
- Click on this icon.
- On the right-hand side, under “Attributes,” click the CD icon next to “Optical Drive” and select “Choose a disk file…”
- Browse to and select the Ubuntu ISO file you downloaded.
- Start the VM: Click the “Start” button in VirtualBox.
- Boot Menu: The VM will boot from the ISO image. You’ll be presented with a menu.
- Select “Try or Install Ubuntu.”
- Ubuntu Installer: The Ubuntu installer will launch.
- Choose Language: Select your preferred language.
- Keyboard Layout: Confirm or adjust your keyboard layout.
- Updates and Other Software:
- Normal installation: Installs a web browser, utilities, office software, games, and media players.
- Minimal installation: Installs a web browser and basic utilities.
- Download updates while installing Ubuntu: Recommended for a more up-to-date system.
- Install third-party software for graphics and Wi-Fi hardware, Flash, MP3 and other media: This is highly recommended to ensure all hardware and media formats work out of the box.
- Installation Type:
- Erase disk and install Ubuntu: This option will format the entire virtual hard disk dedicated to the VM. Since this is a virtual disk, it won’t affect your host system’s drives. This is the simplest and recommended option for a clean installation within the VM.
- Something else: This option provides manual partitioning, which is generally not necessary for a standard VM setup.
- Select “Erase disk and install Ubuntu” and click “Install Now.”
- Confirm Changes: The installer will show you the proposed disk partitioning. Click “Continue.”
- Location: Select your time zone.
- User Setup:
- Your name: Enter your full name.
- Your computer’s name: This is the hostname for your VM.
- Pick a username: This will be your login username.
- Choose a password: Create a strong password.
- Confirm your password: Re-enter your password.
- Log in automatically or Require my password to log in: For security, it’s generally better to require a password.
- Installation Progress: The installation will proceed. This can take some time.
- Restart: Once the installation is complete, you will be prompted to restart the virtual machine. Click “Restart Now.”
- Remove Installation Media: VirtualBox will usually prompt you to remove the “installation medium” (the ISO file). Press “Enter” when prompted. Your VM will now boot into your freshly installed Ubuntu system.
Post-Installation Enhancements: Guest Additions
For an optimal virtual machine experience, it’s highly recommended to install “VirtualBox Guest Additions.” These are a set of device drivers and system applications that enhance the usability and performance of the guest operating system. They enable features like:

- Seamless mouse integration
- Shared clipboard between host and guest
- Drag and drop functionality
- Better video support and resolution auto-adjustment
- Shared folders
To install Guest Additions:
- Start your Ubuntu VM.
- From the VirtualBox menu bar (at the top of the VM window), select “Devices” > “Insert Guest Additions CD image…”
- A CD icon will appear on your Ubuntu desktop. Open it.
- You should see a file named
VBoxLinuxAdditions.run. - Open a terminal within the guest VM (Ctrl+Alt+T).
- Navigate to the mounted CD directory:
cd /media/<your_username>/VBox_GAs_<version>(the exact path might vary slightly). - Run the installer with root privileges:
sudo ./VBoxLinuxAdditions.run - Enter your password when prompted.
- Wait for the installation to complete.
- Restart your VM.
You should now experience significantly improved performance and integration with your host system.
Dual-Booting Ubuntu with an Existing Ubuntu Installation
Dual-booting allows you to install multiple operating systems on the same physical hard drive, enabling you to choose which OS to boot into when you start your computer. This is particularly useful if you have an existing Ubuntu installation and want to try out a different version, or perhaps a different flavor of Ubuntu (like Kubuntu or Xubuntu), without resorting to virtualization. The process involves carefully partitioning your hard drive to make space for the new Ubuntu installation.
Important Note: Back up any critical data before proceeding with dual-boot installations, as partitioning errors can lead to data loss.
Preparing Your System
- Download the Ubuntu ISO: As with virtual machines, download the desired Ubuntu ISO image from the official Ubuntu website.
- Create a Bootable USB Drive: You’ll need to create a bootable USB drive from the ISO. On an existing Ubuntu system, you can use the “Startup Disk Creator” tool, or for cross-platform compatibility, tools like Etcher (balena.io/etcher) are excellent.
- Backup Your Data: This cannot be stressed enough. Ensure all important files are backed up to an external drive or cloud storage.
- Free Up Disk Space: You need to create unallocated space on your hard drive for the new Ubuntu installation.
- Option A: Using an Existing Ubuntu’s Partition Manager:
- Boot into your current Ubuntu system.
- Open “Disks” (or GParted if installed).
- Identify the partition where your current Ubuntu is installed.
- Shrink that partition to create free space. Be conservative; allocate enough space for the new OS and any applications you plan to install (at least 25-50GB is a good starting point). This step is crucial and requires caution.
- Option B: Using a Live USB with GParted: Boot from the bootable Ubuntu USB you created, and select “Try Ubuntu.” Once in the live environment, launch GParted, and perform the partition resizing there. This is often considered safer as you are not modifying the currently running system.
- Option A: Using an Existing Ubuntu’s Partition Manager:
Installing the Second Ubuntu Instance
- Boot from the USB Drive:
- Restart your computer.
- Enter your BIOS/UEFI settings (usually by pressing F2, F10, F12, or Del during boot).
- Change the boot order to prioritize the USB drive.
- Save changes and exit BIOS/UEFI.
- Start the Ubuntu Installer:
- Your computer will boot from the USB drive.
- Select “Try or Install Ubuntu.”
- When the installer loads, choose “Install Ubuntu.”
- Installation Steps (Similar to VM but with Partitioning Differences):
- Follow the language, keyboard layout, and network connection prompts.
- Updates and Other Software: Make your choices as before.
- Installation Type: This is where the dual-booting happens.
- You will likely see options like “Install Ubuntu alongside [current OS]” or “Something else.”
- If you see “Install Ubuntu alongside…”, and your existing Ubuntu is detected, this can be the easiest option. The installer will attempt to use the free space you created.
- “Something else” provides manual control and is often preferred for dual-booting, especially when installing Ubuntu alongside another Linux distribution.
- Select “Something else.”
- You will see a list of your hard drive partitions.
- Identify the “free space” or “unallocated” partition you created earlier.
- Click on this free space and then click the “+” button to create new partitions:
- Root Partition (
/): This is where the main operating system files will reside.- Size: At least 20-30GB, more if you plan to install a lot of software.
- Type: Primary or Logical.
- Use as: Ext4 journaling file system.
- Mount point:
/
- Swap Partition (Optional but Recommended): Used as virtual RAM when your physical RAM is full.
- Size: Typically the same as your RAM, or 2-4GB if you have ample RAM.
- Type: Primary or Logical.
- Use as: Swap area.
- Home Partition (
/home) (Optional but Highly Recommended): This separates your user data and settings from the system files. This is very useful if you plan to reinstall or upgrade your Ubuntu system later, as you can keep your/homepartition intact.- Size: The remaining free space.
- Type: Primary or Logical.
- Use as: Ext4 journaling file system.
- Mount point:
/home
- Root Partition (
- Device for boot loader installation: This is crucial. Select the main hard drive (e.g.,
/dev/sda,/dev/nvme0n1) where GRUB (the bootloader) will be installed. This ensures GRUB can manage the boot process for both operating systems. Do NOT select a specific partition for the bootloader unless you are very experienced.
- Review and Install: Carefully review the partition scheme. Once satisfied, click “Install Now.”
- Location, User Setup: Configure your time zone and create your user account.
- Installation: The installation will proceed.
- Restart: Upon completion, you will be prompted to restart. Remove the USB drive when instructed.

Bootloader Management (GRUB)
When your computer restarts, you should be presented with the GRUB bootloader menu. This menu will list your installed operating systems, allowing you to choose which one to start.
- Default Entry: GRUB usually defaults to the most recently installed OS or a pre-configured option.
- Updating GRUB: If for some reason GRUB doesn’t show both Ubuntu installations, you can boot into one of them, open a terminal, and run
sudo update-grub. This command scans your system for operating systems and updates the GRUB configuration file. - GRUB Customizer: For more advanced control over the GRUB menu (changing default entries, timeouts, appearance), you can install a tool called
grub-customizer(installable viasudo apt install grub-customizer).
By following these detailed steps, you can effectively install Ubuntu within a virtual environment or alongside an existing Ubuntu installation, expanding your system’s capabilities and flexibility.
