There are a variety of reasons why you would want to start using Linux as your primary operating system, including course requirements at university, the ability to deploy a local server using Apache on Linux, and learning shell scripting.
A user switching from Windows or MacOS to Linux can find the transition difficult due to the fact that Linux may not support most of your daily used applications, such as the Microsoft Office suite, or most of your favorite games.
As a result, you might want to give Linux a try for a few months before deciding whether to make it your primary operating system. If you are one of these people, I would suggest that before fully removing Windows from your PC and installing a Linux distribution, you must experiment with Linux in a virtual machine to become acquainted with the environment.
What is a Virtual Machine?
A virtual machine is basically an emulation or virtualization of an operating system. This means that you are effectively running another operating system on your primary operating system through virtualization software. The virtualized or emulated operating system is referred to as the “Guest OS,” and the main operating system on your machine is referred to as the “Host OS.”
The guest OS will have complete access to your I/O devices, memory, and CPU, allowing you to use another operating system without having to remove your primary oprating system from your PC.
The key advantage of installing Ubuntu (or any other Linux distribution) on a virtual machine is that if you break something inside Ubuntu, it will not affect or harm Windows or your files and folders within Windows.
There are several free applications for Windows that can be used to create a Virtual Machine. Most people I know who are new to Linux use VirtualBox because the interface is really simple.
In this post, I’ll guide you through the process of installing and running Ubuntu (the most popular distribution on personal computers) on a virtual machine created with VirtualBox.
- Download the latest VirtualBox application for your PC.
Open the link below and click on Windows hosts under the section “VirtualBox 6.1.22 platform packages” (Refer to the picture):
- Let the download finish and launch the setup wizard from your Downloads folder. Allow all the prompts generated by the application to finish the installation.
- You have successfully installed VirtualBox on your PC. Now you need to download the Ubuntu OS itself. Click on the link below to download an Ubuntu image file from the official site.
You can download either the 20.04 LTS version or the 21.04 yearly version.
I’d highly recommend that you download the LTS (Long-term support) version since it has 5 years of support including security and maintenance upgrades.
- Once the Ubuntu image file is successfully downloaded, launch VirtualBox and click on New.
- Name your VM as you like and then select Type as Linux and Version as Ubuntu (64-bit) and click on Next.
- Now you need to allocate memory out of your installed RAM to the virtual machine. The system I am using has 8GB of RAM installed so I am allocating 4GB to the VM.
NOTE: Remember that offering too much RAM to your VM can induce slowdowns in your host OS (Windows) while your VM is running.
Once you’re done, click Next.
- After you’ve allocated memory to your VM, you’ll need to allocate space for your hard disk.
A virtual disk drive serves as a storage medium for your VM (Ubuntu), where you will install and store various files and folders when working with Ubuntu.
Verify that you have Create a virtual hard disk now selected, then click Create.
- Select Hard disk file type as VDI (VirtualBox Disk Image) and click Next.
- Select the storage as Dynamically allocated and click Next.
Dynamic allocation has an advantage over fixed size virtual disk in that your virtual hard size will automatically grow as you store more and more files on it, so any extra space on your physical hard drive will not be wasted.
- Select a hard disk size for your VM. You should allocate at least 50GB. Remember that you are only selecting the maximum size; this does not imply that the virtual hard disk will take up 50GB of your physical hard drive.
You have successfully created your VM and now you just need to install Ubuntu on it.
Installing Ubuntu on your VM
- Click on Settings and then click on Storage. Under the section Controller: IDE, click on Empty.
- Now click on the little disk icon near the Optical Drive menu and click on Choose a disk file. You have to now find and select the Ubuntu image you downloaded earlier.
- Once you have selected the image file, click OK.
- For installing Ubuntu, click on Start to launch your VM.
- You will be asked to select your boot drive, click on the drop-down and select your Ubuntu image file and hit Start.
- Allow the disk check process to complete.
- You should be greeted with Ubuntu’s Startup Screen. Here you have to select the setup language from the left menu and click on Install Ubuntu.
- Now choose your Keyboard Layout and click Continue.
- Click on Normal Installation. Check the box Install third-party software and if you have an internet connection at the time of installing then Check Download Updates while installing Ubuntu. You can also download the updates after installation.
- Now the Partition Menu will appear. Choose Erase Disk And Install Ubuntu. If you want to partition Ubuntu yourself, click on Something Else. Learn more about manual partitioning here.
- Click Install Now and select Continue in the Dialog Box.
- Select your Region and click Continue.
- Enter your preferred Username and Password. Click Continue.
- Ubuntu will now start installing. Wait for it to finish.
- When the installation finishes, the setup will ask you for a Restart. Click Restart Now.
- You should now be greeted by the lock screen. Click on your username, enter your password and hit Enter.
- You can connect your online accounts via the next menu, or you can skip.
- Skip setting Livepatch for now.
- Select Yes, send system info to Canonical and click Next.
- Click Done and you will have the GNOME desktop staring at you.
Explore Ubuntu and Linux. Look through some Ubuntu resources online to quickly get acquainted with the GUI.
If you have an old PC and are facing lags on your VM, you can raise the amount of CPU cores assigned to your VM to boost performance.
Here is how you can do this:
NOTE: Make sure your Ubuntu VM is not running as you do this.
- Click on Settings and then click System.
- Under the Processor section, drag the slider to increase the number of CPU cores. Make sure the slider stays inside the green line.
- Click OK and start your VM. You should now see a significant improvement in performance.
Were you able to successfully install Ubuntu on your VM? If you run into any problems while following the instructions, please leave a comment below.