How to Install a Linux Virtual Machine on Windows 10
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.
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.
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.’
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.
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.’
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.’
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.
We can see our virtual machine in the left panel and to the right, basic info about the VM.
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.
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.
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.
Step 3: Install Ubuntu
On the Welcome page, choose your preferred language (you’ll receive installation instructions in this language), then click ‘Install Ubuntu.’
Step 4: Select the keyboard layout
Next, select a keyboard layout (your VM’s language), then click ‘Continue’ in the bottom right.
Step 5: Updates and other software
Select the ‘Normal Installation’ option and continue; leave the others unchecked.
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.
A pop-up to ‘Write the changes to the disk?’ will appear; click ‘Continue’ to proceed.
Step 7: Choose a location
Move the cursor to a location and select, then click ‘Continue.’
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.’
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.
Once the installation is done, you’ll get a prompt to restart the machine, ‘Restart Now.’
To restart, you’ll be notified to remove the installation medium. Press ‘Enter ‘on your keyboard since we didn’t use any medium.
Step 10: Log into the VM
After restarting, you’ll need to re-login.
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.
Next, skip enabling Ubuntu Pro. You can always upgrade later.
Congratulations, you’ve successfully installed Ubuntu on your Windows device and can now get familiar with the Linux OS, Terminal, and commands.
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.
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.’
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.
Step 3: Launch Guest Additions CD Image
Double-click the icon to launch.
Right-click a blank space and then ‘Open in Terminal.’ You’ll be conducting a simple Linux terminal task with basic commands.
Step 4: In the Terminal
In the Terminal, run the ‘ls’ command. Look for the ‘VBoxLinuxAdditions.run’ file and copy it.
Step 5: Run this command
Next, we need to execute the file using this command:
“sudo ./VBoxLinuxAdditions.run”
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.
The command will run immediately after the password is authorized.
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.
In the drop-down menu, click ‘Power Off/Log Out,’ then ‘Restart.’
A pop-up with a 60-second timer will ask you to confirm restart; click ‘Restart’ again.
Step 7: Minimize and Maximize
These steps should fix the resolution. Simply minimize and maximize the Ubuntu VM to confirm.
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.
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.