How to Install Linux on VirtualBox?

how to install Linux on virtualbox

Are you a Linux enthusiast who wants to explore Linux without making changes to your primary operating system? Install Linux on VirtualBox is a great way to do just that. VirtualBox allows you to create virtual machines on your computer, enabling you to run Linux alongside your existing operating system—whether you’re using Windows 10, Windows 11, or macOS.

In this guide, we will show you how to install Linux on VirtualBox from scratch, making it easier for you to experience the power of Linux without the need for dual-booting or changing your existing setup.

Whether you’re a beginner or an advanced user, our easy-to-follow steps will ensure that you’re able to get Linux running on VirtualBox without any trouble. Let’s dive in!

What is VirtualBox?

VirtualBox is an open-source virtualization software that allows you to run multiple operating systems on your computer at the same time. A “virtual machine” (VM) created in VirtualBox behaves just like a separate computer within your existing system, allowing you to run different OSes like Linux, Windows, or even older versions of macOS without affecting your main operating system.

VirtualBox is free and can be installed on Windows, macOS, and Linux. This makes it an ideal tool for testing new operating systems, running software that’s not compatible with your main OS, or just experimenting with different configurations in a safe environment.

Why Install Linux on VirtualBox?

There are several reasons why installing Linux on VirtualBox is a great idea:

  1. Testing Linux Distributions: VirtualBox lets you test different Linux distros without modifying your primary operating system.
  2. Safe Environment for Experimentation: You can install software, try different commands, and modify settings within your virtual machine without risking your main operating system.
  3. No Need for Dual Booting: You can run Linux side-by-side with your existing OS without the complexities and risks of dual-booting.
  4. Learning Platform: If you’re new to Linux, VirtualBox provides a perfect, risk-free environment to learn commands, configurations, and applications.

Now that we’ve covered the basics, let’s dive into the installation process for Windows 10, Windows 11, and macOS.

how to install Linux on virtualbox

Prerequisites for Install Linux on VirtualBox

Before you start installing Linux on VirtualBox, here’s what you’ll need:

  1. VirtualBox Software: Download and install the latest version of VirtualBox.
  2. Linux ISO: You’ll need to download the installation image (ISO file) of the Linux distribution you want to install (e.g., Ubuntu, Fedora, Debian).
  3. Enough Disk Space: Make sure your computer has enough disk space to accommodate both your main OS and the virtual machine. A minimum of 20GB of free space is recommended.
  4. Memory (RAM): Assign at least 2GB of RAM to your virtual machine for smooth performance (more is better if your system can handle it).

How to Install VirtualBox?

Downloading and Installing VirtualBox on Windows

  1. Go to the VirtualBox download page.
  2. Click the Windows hosts link to download the VirtualBox installer for Windows.
  3. Once downloaded, run the installer and follow the prompts to install VirtualBox. The default settings are fine for most users.
  4. After installation, launch VirtualBox from the Start menu.

Installing VirtualBox on macOS

  1. Visit the VirtualBox download page.
  2. Select the OS X hosts link to download the macOS version of VirtualBox.
  3. Open the downloaded file and follow the on-screen instructions to install VirtualBox.
  4. Once installed, launch VirtualBox from the Applications folder.

How to Install Linux on VirtualBox in Windows 10 and 11?

Now that VirtualBox is set up on your Windows system, it’s time to install Linux. Follow the steps below to get started.

Downloading the Linux ISO

  1. Go to the official website of the Linux distribution you want to install (e.g., Ubuntu, Fedora, or Debian).
  2. Download the ISO file for the latest version of your chosen Linux distro.

Creating a New Virtual Machine in VirtualBox

  1. Launch VirtualBox and click on the New button to create a new virtual machine.
  2. Enter a name for your VM (e.g., “Ubuntu” or “Linux VM”) and select the type of Linux you’re installing. For example, choose “Linux” and “Ubuntu (64-bit)” if you’re installing Ubuntu.
  3. Click Next to proceed to memory allocation. Assign at least 2GB of RAM to your virtual machine (more if your system allows it).
  4. For the hard disk, select Create a virtual hard disk now and click Create.
  5. Choose the type of hard disk file. The default option (VDI) is usually fine.
  6. Select Dynamically allocated for the storage option, which allows the virtual hard drive to grow as needed.
  7. Set the size of the virtual hard disk (20GB is a good starting point). Click Create.

Installing Linux on the Virtual Machine

  1. Once the VM is created, select it and click Start.
  2. A prompt will appear asking you to select a startup disk. Browse and select the Linux ISO file you downloaded earlier.
  3. Click Start to boot up the virtual machine.
  4. The Linux installation process will begin. Follow the on-screen instructions to install the operating system.
    • Select your language, keyboard layout, and time zone.
    • Choose the installation type (typically “Install Ubuntu alongside other operating systems” or “Erase disk and install” for Linux-only installations).
    • Create a user account and set a password.
  5. Once the installation is complete, the system will prompt you to restart. Click Restart Now.

Installing VirtualBox Guest Additions

To improve the performance and functionality of your virtual machine, you should install VirtualBox Guest Additions. This enables better integration between the host and guest OS, including features like shared folders, seamless mouse integration, and improved graphics performance.

  1. After restarting the VM, click on the Devices menu in VirtualBox and select Insert Guest Additions CD image.
  2. In the Linux VM, open the terminal and type: sudo mount /dev/cdrom /mnt sudo sh /mnt/VBoxLinuxAdditions.run
  3. Restart the VM once the installation is complete.

Now you can use Linux within VirtualBox with enhanced performance and seamless interaction between the host and guest OS!

How to Install Linux on VirtualBox in macOS?

Installing Linux on VirtualBox in macOS follows a similar process to Windows. Here’s how to do it:

Downloading the Linux ISO

Follow the same steps as above to download the Linux ISO of your choice.

Setting Up VirtualBox on macOS

  1. Launch VirtualBox and click New.
  2. Name the VM and select the appropriate Linux version (e.g., Ubuntu 64-bit).
  3. Allocate RAM (at least 2GB).
  4. Create a virtual hard disk with a recommended size of 20GB or more.
  5. Click Create.

Installing Linux on VirtualBox

  1. After the VM is created, select it and click Start.
  2. When prompted, select the Linux ISO you downloaded earlier.
  3. Follow the same steps as the Windows installation to install the Linux OS on your VM.
  4. After the installation is complete, restart the virtual machine.

Installing VirtualBox Guest Additions on macOS

  1. After booting into Linux, go to the Devices menu in VirtualBox and choose Insert Guest Additions CD image.
  2. Open the terminal and run the following commands to install Guest Additions: sudo mount /dev/cdrom /mnt sudo sh /mnt/VBoxLinuxAdditions.run
  3. Restart the VM.

Now your Linux system is running smoothly with enhanced features on your macOS host.

Common Issues and Troubleshooting

While install Linux on VirtualBox is relatively straightforward, you might encounter a few issues along the way. Here are some common problems and solutions:

  • No Bootable Disk Error: If you see a “No bootable disk found” message, make sure the ISO file is correctly selected as the startup disk.
  • VirtualBox Performance Issues: Ensure that you’ve allocated enough memory and hard drive space to the virtual machine. Enabling VT-x/AMD-V in the VM settings can also improve performance.
  • Guest Additions Not Installing: If Guest Additions don’t install correctly, ensure that your system is fully updated, and try running the installation commands again.
  • Linux Freezes or Crashes: This could be due to insufficient resources. Try adjusting the allocated RAM or turning off unnecessary host applications to free up system resources.

Conclusion and Final Thoughts

Install Linux on VirtualBox is an excellent way to explore Linux without the need to modify your main operating system. With VirtualBox, you can run Linux virtually alongside Windows 10, Windows 11, or macOS, enabling you to experience the power of Linux while keeping your primary OS intact.

By following the steps outlined in this guide, you’ll be up and running with Linux on VirtualBox in no time. Whether you’re a developer, a student, or just someone looking to explore Linux, VirtualBox offers a risk-free, easy-to-manage way to get started.

Have you tried install Linux on VirtualBox? Share your experiences or ask questions in the comments below. If you found this guide helpful, don’t forget to share it with friends and fellow Linux enthusiasts!


With these instructions, you’ll be able to run Linux efficiently on VirtualBox, no matter what operating system you’re using.

Read Also : How to Install Linux on Windows?

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top