How To Install Linux On Virtualbox

How To Install Linux On Virtualbox

Reading time1 min
#Linux#Virtualization#OpenSource#VirtualBox#Ubuntu#ISO

Mastering Linux Installation on VirtualBox: Step-by-Step Guide for Seamless Virtualization

Forget complicated dual-boot setups or dedicated hardware. Here's how you can efficiently spin up a Linux environment on your existing system using VirtualBox, unlocking powerful Linux capabilities with minimal friction. Installing Linux on VirtualBox allows developers, sysadmins, and tech enthusiasts to safely test, develop, and learn in isolated environments without altering their main system. This practical approach to virtualization is both flexible and risk-free. Let’s walk through the process together!


Why VirtualBox for Linux?

VirtualBox is a free and open-source virtualization tool that lets you run entire operating systems as “guests” within your current OS (the “host”). It’s great for experimenting with Linux distros, running software that requires Linux, or setting up servers without needing extra machines.


What You’ll Need Before Starting

  • A computer running Windows, macOS, or Linux.
  • Oracle VirtualBox installed. Download it from VirtualBox.org.
  • A Linux ISO file. For beginners, Ubuntu or Fedora are good starting points. Grab the latest release from their official sites (e.g., ubuntu.com/download).

Step 1: Download and Install VirtualBox

  1. Go to VirtualBox Downloads.
  2. Select your operating system and download the installer.
  3. Run the installer and follow the prompts — the default options are fine for most users.
  4. Launch VirtualBox once installation is complete.

Step 2: Prepare Your Linux ISO

Download your preferred Linux distribution ISO file and save it in an easy-to-find location. For example, you can download Ubuntu 24.04 LTS ISO from the Ubuntu downloads page.


Step 3: Create a New Virtual Machine in VirtualBox

  1. Open VirtualBox and click New.
  2. Enter a name for your VM, e.g., Ubuntu 24.04.
  3. Select Type: Linux.
  4. Choose Version: Select the closest match (e.g., Ubuntu (64-bit)).
  5. Click Next.

Step 4: Allocate Memory (RAM)

Assign RAM to your VM. For Ubuntu Desktop, allocate at least 2048 MB (2 GB). If you have 8+ GB RAM on your host, 4096 MB (4 GB) is even better for smooth performance.


Step 5: Create a Virtual Hard Disk

  1. Select Create a virtual hard disk now and click Create.
  2. Choose VDI (VirtualBox Disk Image) and click Next.
  3. Select Dynamically allocated to save disk space initially.
  4. Set the disk size. 20 GB is a good starting point for most distros.
  5. Click Create.

Step 6: Attach the Linux ISO to Your Virtual Machine

  1. Select your newly created VM and click Settings.
  2. Go to the Storage section.
  3. Under Controllers: IDE (or SATA), click the empty optical drive icon.
  4. On the right, click the CD icon and select Choose a disk file.
  5. Open the Linux ISO you downloaded earlier.
  6. Click OK.

Step 7: Start Your Virtual Machine and Begin Installation

  1. Select your VM and hit Start.
  2. The VM will boot from the ISO file, launching the Linux installer.
  3. Follow the on-screen prompts just as you would when installing Linux on a physical machine:
    • Select language.
    • Choose installation type (for fresh install, “Erase disk” here means the virtual disk—no risk to your host!).
    • Create a user account.
    • Set your time zone.
  4. Once installation finishes, reboot the virtual machine when prompted.

Step 8: Remove Installation Media and Boot into Installed Linux

After reboot, before the VM starts again:

  1. Go to Devices > Optical Drives and uncheck the Linux ISO to eject it.
  2. The VM will boot from the virtual hard disk you installed Linux on.

Step 9: Install VirtualBox Guest Additions (Optional but Recommended)

For better performance and usability (clipboard sharing, full-screen support):

  1. Inside your running Linux VM, click Devices > Insert Guest Additions CD image.
  2. Open the mounted CD inside Linux.
  3. Run the installation script (usually with sudo ./VBoxLinuxAdditions.run).
  4. Reboot the VM once complete.

Example: Running Ubuntu 24.04 on VirtualBox in 10 Minutes

  • Download Ubuntu ISO (~3GB).
  • Create VM: 4GB RAM, 20GB disk.
  • Boot VM, follow installation wizard.
  • Eject ISO, reboot.
  • Install guest additions for enhanced experience.
  • Done! Your Ubuntu is up and running without touching your host machine.

Troubleshooting Tips

  • VM won’t boot 64-bit OS? Make sure virtualization is enabled in your BIOS/UEFI.
  • Linux runs slowly? Increase RAM or enable 3D acceleration in VM settings.
  • Network issues? Switch network adapter to “Bridged Adapter” or “NAT” based on needs.

Wrapping Up

Harnessing VirtualBox to install Linux is a straightforward and powerful way to explore Linux ecosystems hassle-free. Whether you’re testing new distros, developing, or managing servers, virtualization gives you the freedom to experiment while keeping your main system intact.

Go ahead, give it a try — mastering Linux on VirtualBox opens many doors in your tech journey!


Happy Virtualizing!

If you want a specific distro guide or advanced VirtualBox setup tips, let me know in the comments below.