How to Install a Linux Virtual Machine on Windows 10

Efam Harris
10 min readSep 2, 2023

--

You are interested in IT, Networking, or Cybersecurity, and you’ve heard you must practice and master Linux to excel. The only problem is you own a Windows PC and can’t afford to splurge on buying a Linux-based machine. You don’t need to; you can run a Linux Virtual Machine on your Windows PC.

There are two ways to achieve this. The first is a dual-boot process, where you install the Linux operating system directly on your partitioned hard drive, so anytime you want to start up your PC, you choose whether to launch the Windows or Linux OS. The second is via VirtualBox, a virtualization software that allows you to install multiple operating systems without partitioning your hard drive.

While both are great options, the second requires less technical skills, is beginner-friendly, and doesn’t directly impact your hard drive, so any task performed on the virtual machine is contained within the VirtualBox. This is great for beginner’s practice because it permits you to ‘play around’ and master the Linux system without fearing damage to your computer.

Here’s What You’ll Need to Get Started

Per specifications, here’s what is required to successfully install and run a virtual machine on your Windows PC.

  • Operating System: Windows 10
  • Processor: 2 GHz dual-core Processor or better
  • System Memory: 8 GB or higher
  • Storage: 500 GB or higher

*You’ll also need good and stable internet.

Install VirtualBox

There are a couple of virtualization software in the market, both paid and free. We’ll use the free Oracle Virtual Machine VirtualBox for this guide. Remember, the goal is to build a setup for beginner practice without spending money.

Download and install the Oracle VM VirtualBox

To download the Oracle VM VirtualBox on Windows, go to https://www.virtualbox.org/wiki/Downloads and select the ‘Windows hosts’ option.

Image 1.0: Oracle VM VirtualBox download page

After a successful download, open the application from your Downloads folder. This will launch the Windows Installation Wizard. Follow the steps to install.

It’s a quick and easy process you can do on your own in under 2 minutes. However, if you need help, here’s a short walkthrough on How to Download and Install the Oracle VM VirtualBox on Windows 10.’

Set Up the Virtual Machine

Step 1: Download the Linux OS

Today, there are over 40 different Linux distributions (or flavors, as I like to call them). They include the more common Kali Linux, Ubuntu, and Red Hat, and the less common Peppermint OS, Parrot OS, BlackArch and more. We’ll use Ubuntu, based on Debian, for this demonstration.

To download Ubuntu, go to https://ubuntu.com/download/desktop and download the latest version, Ubuntu 22.04.3 LTS and Ubuntu 23.04, at the time of writing.

Note: You can download either, but I prefer the LTS (Long-Term Support), which means five years of free security and maintenance updates, guaranteed until April 2027. Also, some people say it’s lighter and downloads faster; I think that’s more dependent on your internet speed.

Image 1.0: Ubuntu download page

It’s a large file, so downloading will take some time.

Step 2: Launch the VirtualBox

To begin the Ubuntu installation process, launch the Oracle VM VirtualBox.

Click ‘Machine’ in the top left corner and then ‘New.’

Image 2.0: Creating a new Virtual Machine in the VirtualBox

Step 3: Name the Virtual Machine

In the ‘Name’ field, type in a unique name for your Virtual Machine. Unless the other fields differ from the image below, do not alter them. Click ‘Next’ to proceed.

Image 3.0: Creating and Naming the Virtual Machine

Step 4: Provision the hardware

Since the virtual machine is also a computer, it’ll need its own Processor and memory. But as a virtual machine, it can only get that from the host (physical) computer.

You’ll decide how much of the host resources the virtual machine can use; the more you give it, the better it’ll run its processes.

Provide 8 GB (8000 MB) for the Base Memory and 2 of the 4 available CPUs for the Processor. Click ‘Next.’

Image 4.0: Provisioning the hardware for the Virtual Machine

Step 5: Create a virtual hard disk

Like the step above, you will create a virtual hard disk (VHD) for the VM.

Provide at least 25 GB for the VHD. Click ‘Next.’

Image 5.0: Creating a virtual hard disk

Step 6: Create the Virtual Machine

Review the settings and ensure everything is set right. Click ‘Finish’ to create the Virtual Machine.

Note: After creating the VM, you can still adjust the provisions.

Image 6.0: Creating the Virtual Machine

We can see our virtual machine in the left panel and to the right, basic info about the VM.

Image 6.1: Successful creation of the Virtual Machine

Step 7: Upload the Ubuntu iso file

The VM is ready; it’s time to install the operating system. This is where we use the Ubuntu iso file we downloaded earlier.

At the top of the page, open the ‘Settings’ page and go to ‘Storage.’

Under ‘Storage Devices,’ select ‘Empty.’

Then to the right, under ‘Attributes,’ select the ‘blue disc’ to upload the ‘Optical Drive.’

‘Choose a disk file’ will lead you to your file manager; click the Ubuntu iso file to upload.

Image 7.0: Uploading the Ubuntu iso file in the storage

After uploading, there’s nothing more to do here; go to the display settings.

Step 8: Adjust the display

In ‘Display,’ under ‘Screen,’ slide the ‘Video Memory’ to the max. This is important so the VM has enough resources for optimal visuals.

Click ‘OK’ when done.

Image 8.0: Adjusting the Video Memory in Display Settings

Now we are all set. It’s time to launch and install the OS.

Install Ubuntu

Note: Images in this section were taken with a handheld device because snipping didn’t work during the installation phase. So, they will differ from the images in the above sections, which were generated with the Windows Snipping tool.

Step 1: Launch Ubuntu via Virtual Box

With the Ubuntu VM selected on the VirtualBox, click the green ‘Start’ arrow at the top to launch.

Step 2: Boot

The boot process will begin once you hit Start. Select the ‘Try or Install Ubuntu’ option (it should be auto-selected; else, use the up and down arrows) and hit enter.

Image 2.0: The Ubuntu boot page
Image 2.1: Ubuntu booting
Image 2.2: Ubuntu booted

Step 3: Install Ubuntu

On the Welcome page, choose your preferred language (you’ll receive installation instructions in this language), then click ‘Install Ubuntu.’

Image 3.0: Ubuntu welcome page

Step 4: Select the keyboard layout

Next, select a keyboard layout (your VM’s language), then click ‘Continue’ in the bottom right.

Image 4.0: Choosing the keyboard layout

Step 5: Updates and other software

Select the ‘Normal Installation’ option and continue; leave the others unchecked.

Image 5.0: Updates and other software

Step 6: Choose the installation type

Select the ‘Erase disk and install Ubuntu’ option, then click ‘Install Now.’

Note: Ignore the warning message; it’s meant for the Virtual Machine and will not affect your host (physical) computer.

Image 6.0: Installation type

A pop-up to ‘Write the changes to the disk?’ will appear; click ‘Continue’ to proceed.

Image 6.1: Write the changes to disk pop-up

Step 7: Choose a location

Move the cursor to a location and select, then click ‘Continue.’

Image 7.0: Choosing a location for your Virtual Machine

Step 8: Input user credentials

Next, you fill in the fields with your name, computer’s name, username and password; pick a good password.

Select ‘Require my password to log in’ and click ‘Continue.’

Image 8.0: Inputting user credentials

Step 9: Enjoy the slideshow

At this stage, the work is 90% done. Sit back and let the installation begin. This will take a while, give it time and check back later.

Image 9.0: Ubuntu installation window

Once the installation is done, you’ll get a prompt to restart the machine, ‘Restart Now.’

Image 9.1: Installation complete pop-up

To restart, you’ll be notified to remove the installation medium. Press ‘Enter ‘on your keyboard since we didn’t use any medium.

Image 9.2: System restarting

Step 10: Log into the VM

After restarting, you’ll need to re-login.

Image 10.0: Ubuntu login screen

Step 11: Skip the following steps

Once logged in, you can link your online accounts like Google and Microsoft or skip the process. You can always link later.

Image11.0: Connect your online accounts

Next, skip enabling Ubuntu Pro. You can always upgrade later.

Image 11.1: Ubuntu Pro upgrade or skip

Congratulations, you’ve successfully installed Ubuntu on your Windows device and can now get familiar with the Linux OS, Terminal, and commands.

Image 11.2: Ubuntu VM running on Windows host

Fix the Resolution

I bet you tried to maximize the Ubuntu VM and realized the resolution wasn’t correct. Well, let’s fix that.

Step 1: Ubuntu is successfully installed, but…

If you haven’t tried to maximize or expand the screen, you can try it now, and you’ll notice an issue with the resolution.

Image 1.0: Ubuntu Home Screen with Wrong Resolution

Step 2: Insert Guest Additions CD Image

To fix this, go to the top left corner of the screen and click on ‘Devices,’ then on ‘Insert Guest Additions CD Image.’

Image 2.0: Inserting Guest Additions CD Image

A Silver disc icon should appear on the side panel of your Ubuntu home screen. You may need to scroll a bit to find it.

Image 2.1: Guest Additions inserted into Ubuntu

Step 3: Launch Guest Additions CD Image

Double-click the icon to launch.

Image 3.0: Guest Additions CD Image for Ubuntu

Right-click a blank space and then ‘Open in Terminal.’ You’ll be conducting a simple Linux terminal task with basic commands.

Image 3.1: Opening Guest Additions CD Image in Terminal

Step 4: In the Terminal

In the Terminal, run the ‘ls’ command. Look for the ‘VBoxLinuxAdditions.run’ file and copy it.

Image 4.0: Using the ls command in the Linux Terminal

Step 5: Run this command

Next, we need to execute the file using this command:

“sudo ./VBoxLinuxAdditions.run”

Image 5.0: Running sudo command in Linux Terminal

The Terminal will request an administrative password. Input your login password.

Note: There’ll be no visible indication when inputting your password for security reasons. Hit enter when you are done typing.

Image 5.1: Inputting password into Terminal

The command will run immediately after the password is authorized.

Image 5.2: Command running

Step 6: Restart the VM

When the command is done running, go to the top right corner of the VM and click where you see the ‘Network, Speaker and Battery’ icons.

Image 6.0: Restarting the VM

In the drop-down menu, click ‘Power Off/Log Out,’ then ‘Restart.’

Image 6.1: Clicking the restart button

A pop-up with a 60-second timer will ask you to confirm restart; click ‘Restart’ again.

Image 6.2: Confirming restart

Step 7: Minimize and Maximize

These steps should fix the resolution. Simply minimize and maximize the Ubuntu VM to confirm.

Image 7.0: Minimized Ubuntu VM
Image 7.1: Maximized Ubuntu VM now in Widescreen

Step 8: Ubuntu is finally ready for use

Now, your Linux Virtual Machine is ready for use in widescreen mode. You can run it like you would run your host computer.

Image 8.0: Ubuntu applications
Image 8.1: Google.com on Mozilla Firefox on the Ubuntu VM

Note: Restart the VM to reset the network if the internet doesn’t work.

Congratulations, you’ve successfully created a virtual machine and installed Ubuntu. Now, you can practice and master the Linux operating system and all its commands without worrying about breaking your physical computer or incurring extra costs.

--

--

Efam Harris

Cyber Security Engineer | Journaling my experience in Information Technology and Cyber Security.