Ubuntu install on Virtualbox in 5 minutes
Enjoying this content? Subscribe to the Channel!
Mastering Linux: How to Install Ubuntu on VirtualBox (The Ultimate Step-by-Step Guide)
Introduction: Why Run Ubuntu in a Virtual Machine?
Welcome back to Darren’s Tech Tutorials!
If you’ve been curious about the world of Linux but aren’t ready to commit to installing a new operating system on your main computer, today’s guide is exactly what you need. Ubuntu is one of the most popular, free, and open-source desktop operating systems in the world, known for its user-friendliness and stability.
To test it out safely, we use VirtualBox. VirtualBox is a fantastic, free, and open-source hypervisor (a program that allows you to run virtual computers inside your existing one). By installing Ubuntu inside a VirtualBox environment, you get a completely isolated playground to learn, experiment, and develop—all without touching your host operating system (Windows or macOS).
In this comprehensive tutorial, we’re going to walk through the entire process, from downloading the necessary files to logging into your brand-new Ubuntu environment!
Prerequisites: Getting Ready for Installation
Before we begin the main installation steps, make sure you have the following ready on your host computer:
- VirtualBox Installed: Download and install the latest version of Oracle VM VirtualBox for your operating system.
- Sufficient Resources: Virtual machines run best when allocated at least 4GB of RAM and 25GB of free hard disk space.
- Internet Access: Necessary for downloading the ISO and for the installation process.
Step 1: Downloading the Ubuntu ISO File
The first step in any OS installation is acquiring the installation media. For Ubuntu, this comes in the form of an ISO file (a disk image).
- Navigate to the Official Ubuntu Download Page: Always get your official ISO files directly from the Ubuntu website.
- Select Your Version: We highly recommend downloading the latest Long Term Support (LTS) version. LTS releases are supported for five years, making them the most stable choice for a virtual machine environment.
- Save the File: Click the download button and save the large ISO file (usually several gigabytes) somewhere easily accessible, like your Downloads or Documents folder. This file is what VirtualBox will use as the “installation DVD.”
Step 2: Creating Your New Ubuntu Virtual Machine
With the ISO secured, it’s time to set up the container for our new operating system within VirtualBox.
- Open VirtualBox: Launch the VirtualBox Manager application.
- Click ‘New’: Select the ‘New’ button in the toolbar to start the VM creation wizard.
- Configure Basic Settings:
- Name: Give your VM a descriptive name, such as
Ubuntu-22.04-Test. - Type: Select
Linux. - Version: Select
Ubuntu (64-bit). VirtualBox may auto-populate these settings if you type “Ubuntu” in the Name field.
- Name: Give your VM a descriptive name, such as
- Allocate RAM (Memory Size):
- Ubuntu generally requires a minimum of 2GB (2048 MB) of RAM to run smoothly, but for a good experience, we recommend 4096 MB (4 GB) if your host computer has 8 GB or more of total RAM.
- Create Virtual Hard Disk:
- Select ‘Create a virtual hard disk now’ and click ‘Create’.
- Hard Disk Type: Choose VDI (VirtualBox Disk Image).
- Storage Allocation: Select Dynamically Allocated. This is efficient because the virtual hard disk file will only grow as you use space inside the VM, saving space on your host computer.
- File Location and Size: We recommend setting the size to at least 25 GB (40 GB is even better for long-term use). This disk size only pertains to the virtual machine, not your host drive!
Click Create to finish setting up the virtual hardware profile.
Step 3: Mounting the ISO and Configuring Hardware
Before hitting ‘Start,’ we need to tell the virtual machine to use the downloaded ISO file as its installation source.
- Access Settings: Select your newly created
Ubuntu-TestVM and click the ‘Settings’ button. - Navigate to Storage: In the left menu, select the ‘Storage’ category.
- Mount the ISO:
- Under the ‘Storage Tree,’ click on the empty CD icon labeled ‘Empty’ under the SATA Controller.
- On the right side, next to the ‘Optical Drive’ dropdown, click the small CD icon.
- Select ‘Choose a disk file…’ and navigate to where you saved your Ubuntu ISO file. Select it and click ‘OK.’
Your VM now has the installation disk “inserted.”
Step 4: Walking Through the Ubuntu Installation Process
Now the real fun begins! Start your virtual machine and begin the operating system installation.
- Start the VM: In the VirtualBox Manager, click ‘Start’.
- Launch Installation: After a moment, the Ubuntu boot menu will appear. Select ‘Try or Install Ubuntu’.
- Initial Setup:
- Once the desktop loads, you will see a welcome window. Select your language and click ‘Install Ubuntu’.
- Keyboard Layout: Confirm your keyboard layout.
- Updates and Other Software: For a standard setup, choose ‘Normal installation’ and check the box to ‘Install third-party software’ (this helps with graphics and media formats).
- Installation Type (Crucial Step):
- Ubuntu will ask, “What kind of installation would you like?” Choose ‘Erase disk and install Ubuntu’.
- Important Note: Since this is a virtual machine, “Erase disk” only applies to the virtual 25 GB hard drive you created in Step 2. It will not touch the files on your host computer!
- Click ‘Install Now’ and confirm the changes to the virtual disk.
- Location and User:
- Select your geographical location for time zone settings.
- Create your user account: Enter your name, choose a username, and create a strong password.
The installation will now proceed, copying files and installing components. This process may take 15–30 minutes, depending on your computer’s speed.
Step 5: Reboot and First Login
Once the installation completes, a prompt will appear asking you to restart the computer.
- Restart: Click ‘Restart Now’.
- Remove Installation Media: When prompted, press ENTER. VirtualBox will automatically attempt to eject the virtual ISO file. If it asks you to manually remove the disk, go to the VirtualBox menu bar, select Devices -> Optical Drives, and uncheck the Ubuntu ISO to ensure it won’t boot into the installer again.
- Log In: Your Ubuntu VM will boot up, showing the login screen. Enter the password you created in Step 4.
Congratulations! You are now running the full Ubuntu desktop operating system inside VirtualBox!
Final Thoughts: Dive into Linux Today!
You’ve successfully navigated the entire process of installing a major Linux distribution inside a hypervisor. You now have a secure, powerful, and completely free environment where you can practice command-line skills, learn coding, or simply explore everything Ubuntu has to offer.
What are you waiting for? Boot up your new VM and start exploring the world of open source!
If this guide helped you get your Ubuntu VM running, hit that Like button, Subscribe to Darren’s Tech Tutorials for more step-by-step guides, and let me know what you plan to do with your new Linux environment in the comments below! Happy virtual computing!