Install Linux Inside Windows Using VirtualBox [Step by Step Guide]

Using Linux in a virtual machine allows you to try Linux within Windows. This step-by-step guide shows you how to install Linux inside Windows using VirtualBox.
Warp Terminal

There are several ways to install Linux.

But if you want to use Linux without making any changes to your Windows system, you can go the virtual machine route.

Basically, you install and use Linux like any regular Windows application. When you just want to try Linux for limited use, virtual machines provide the most comfortable option.

In this tutorial, I’ll show you how to install Linux inside Windows using VirtualBox.

Installing Linux inside Windows using VirtualBox

VirtualBox is a free and open-source virtualization software from Oracle. It enables you to install other operating systems in virtual machines. It is recommended that your system should have at least 4 GB of RAM to get decent performance from the virtual operating system.

Requirements

  • Good internet connection to download software and Linux ISO. (You can also use some other computer with an internet connection to download these files.)
  • Windows system with at least 12-20 GB of free space.
  • Windows system with 4 GB of RAM. (the more, the merrier)
  • Make sure to enable virtualization in the BIOS (some system need it)

I am installing Ubuntu 22.04 in this tutorial, but the same steps apply to any other Linux distribution. If you prefer videos, you can watch the one below from our YouTube channel:

Step 1: Download and install VirtualBox

Go to the website of Oracle VirtualBox and get the latest stable version from here:

Installing VirtualBox on Windows is not rocket science. Just double-click on the downloaded .exe file and follow the instructions on the screen. It is like installing any regular software on Windows.

If you want to install it on Ubuntu, you can refer to our tutorial on installing VirtualBox.

How to Install VirtualBox on Ubuntu [Beginner’s Tutorial]
This beginner’s tutorial explains various ways to install VirtualBox on Ubuntu and other Debian-based Linux distributions. Oracle’s free and open-source offering VirtualBox is an excellent virtualization tool, especially for desktop operating systems. I prefer using it over VMWare Workstation i…

Step 2: Download the Linux ISO

Next, you need to download the ISO file of the Linux distribution. You can get this image from the official website of the Linux distribution you are trying to use.

I am using Ubuntu in this example, and you can download ISO images for Ubuntu from the link below:

Step 3: Install Linux using VirtualBox

Considering you have VirtualBox installed and downloaded the ISO for a Linux distro. You are now set to install Linux in VirtualBox.

Start VirtualBox, and click on the New symbol to create a virtual machine.

virtualbox new machine

It should let you write a name, and the select the ISO. The rest of the things should be automatically set.

creating a new virtual machine in virtualbox

If not, you can manually select the type of the operating system as “Linux” and the version as per your preferences. Furthermore, if you want more control/options, you can choose to select the "Expert Mode".

However, for this tutorial we stick to the "Guided Mode", which should be the default.

For Ubuntu, VirtualBox supports creating a username, password, and specifying the hostname. You can decide to customize it or go with the defaults.

virtualbox guest os install setup

Next, you need to allocate memory and the CPU to help run the virtual machine.

It is recommended to allocate half of what your system offers. Suppose you have 16 Gigs of RAM, you can allocate 8 to the virtual machine. Unless the Linux distro is among the super lightweight Linux distros, it is safe to go with 6 GB or more.

allocating RAM and CPU for virtual machine on virtualbox

Now the virtual disk. This serves as the hard disk of the virtual Linux system. It is where the VM will store its files.

Go with the defaults. If you have too much of less virtual hard disk space, the Linux distro might not install. The minimum recommendations are usually 15-20 GB for a desktop distribution.

virtual hard disk on a virtual machine
📋
It is recommended not to use "Pre-allocate Full Size" option to save disk space on your computer.

By default, the disk is “Dynamically allocated”, meaning, it will only take up space when the OS is installed and when files are stored in it.

virtualbox virtualmachin summary

You will be now shown a summary of all your selections, and then it is time to launch and initiate installing the Linux OS as a virtual machine.

Once everything is in place, it’s time to boot that ISO and install Linux as a virtual operating system.

Suggested Read 📖

10 Reasons to Run Linux in Virtual Machines
You can run any operating system as a virtual machine to test things out or for a particular use case. When it comes to Linux, it is usually a better performer as a virtual machine when compared to other operating systems. Even if you hesitate to install Linux on bare
📋
If VirtualBox doesn’t detect the Linux ISO, browse to its location and select it to start.

Soon, you will boot into the Linux operating system. You should be presented with the option to install it.

Things from here are Ubuntu-specific or distro-specific. Other Linux distributions may have slightly different looking steps, but it won’t be complicated at all.

ubuntu installation details

For Ubuntu, it will just ask you to confirm the username/hostname details that you already set in the previous steps, and you can hit "Continue" to start the installation right away.

ubuntu installation inside virtualbox

It will be a seamless installation experience, with no special configuration required by you.

Once installed, you can follow the usual first-time setup options on Ubuntu as per your preferences, such as enabling Ubuntu Pro subscription and privacy settings.

ubuntu pro subscription enable inside virtual machine

And, that is it. You are done!

I strongly recommend using VirtualBox Guest Additions on Ubuntu because it provides better compatibility, and you would be able to use copy-paste and drag-drop between Linux and Windows.

How to Install & Use VirtualBox Guest Additions on Ubuntu
Install VirtualBox Guest Additions in Ubuntu and with this, you’ll be able to copy-paste, drag and drop between the host and guest system. It makes using Ubuntu on virtual machines a lot easier.

Troubleshooting: AMD-V is disabled in the BIOS

If you face this error or VMX_DISABLED (on Intel systems) while using the virtual machine:

Not in a hypervisor partition (HVP=0) (VERR_NEM_NOT_AVAILABLE).
AMD-V is disabled in the BIOS (or by the host OS) (VERR_SVM_DISABLED).
Result Code:
E_FAIL (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

This means that virtualization is blocked on your system. You’ll have to activate it in your BIOS settings first.

Reboot your system and as soon as it powers up, press F1, F2, F10, or F12 to access BIOS settings. You have to look for the virtualization option, mostly present under the Advanced settings.

📋
The option for Intel (VMX) and AMD (SVM) will look different but can be found in the same palce.
screenshot of bios settings in asus motherboard

Any questions?

That’s all you need to do to install Linux in VirtualBox on Windows.

If you have any doubts, or if you encounter any issues, please feel free to ask your questions in the comment box below.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.