Installing Ubuntu on Virtual Box

Balachandra DS
9 min readOct 20, 2020

Have you ever felt the need to use two operating systems on a single laptop or PC. What Operating system are you currently using, it might be Linux, Mac, or Windows. But did you ever feel the urge to try any new operating system or test any feature on a different OS or just need a different OS to complete a small task(One time use).

For all this, it won’t be sane to buy one more additional PC or laptop. So what to do?

There are two ways :
• Dual boot your PC
• Virtual Machine

Just to give you a gist-

Dual booting your PC means you will be running two OS on a single device and only one of them can be run at a single time and all hardware resources will be allotted to the currently running OS. You will be able to switch OS at booting time.

Virtual Machine is most popular and used around a lot due to its characteristics like portability, can be accessed at any part of the world, Multiple Scaling options because of cloud deployment, can be installed easily using tools like Virtual Box. When you use a virtual box you’re running a second operating system within your primary operating system. This means your hardware splits between the two operating systems.

Virtualization is the act of migrating physical systems into a virtual environment. In other words, it is the creation of a virtual version of a device or resource; anything from a server to an operating system. By providing a virtual view of computing resources, this allows you to turn one server into a host for a group of servers that all share the same resources.

Now in this article, I will tell you how to install Ubuntu on your virtual box.

Files to be downloaded are:

  • Ubuntu 20.04 LTS ISO file
  • Oracle VM Virtual Box
  • Oracle VM Virtual Box Extension Pack

Download Links:

Note: Make sure you download virtual box 6.1.12 not 6.1.14 as 6.1.14 build has some problems regarding clipboard and bidirectional copying.

Let’s get started..

We will begin with downloading all the necessary files.

From Oracle website we will download Virtual box and extension pack , download only 6.1.12 virtual box and 6.1.12 extension pack.

Black arrows depicts the files to be downloaded

Then let us download our Ubuntu ISO file from ubuntu website, the latest long term support version is 20.04 LTS(Long Term Support). The file is almost 3gb so better download it on WiFi to avoid carrier charges.

#funfact: The stripped version of Ubuntu is used in Google’s Self-driving car.

Now all the necessary files are downloaded , now let’s put all our ingredients together and complete our dish.(Can’t help it i’m a foodie :))

Follow all the below steps and if you have any doubt ask in comment section below.

Step 1: Start the installer by double clicking it and press next.

Don’t change anything , press next again.

Register file associations like .ova , .ovf , vdi , vmdk and other file formats will be accessed using Virtual Box ,that means all virtual box supported files will be opened using virtual box only. So keep it ticked and press next.

Press yes

Click install and wait for virtual box installer to do it’s work

Now the Oracle VM Virtual Box is installed , click finish.

Now let’s install the extension pack.

Step 2: Double click on extension pack to install, then press install .

Read the licensing and if you agree then press I agree to continue the setup.

Now Extension pack will be installed . Virtual Box setup is completed , let’s now install Ubuntu in our virtual box.

Step 3: Click on new .

Give suitable name I am giving Ubuntu then select the path and keep type as Linux and it’s version as Ubuntu 64-bit and press next.

Select the amount of RAM you want to allot , I always prefer something near the border . My PC has 8gb ram so i have selected approx 4gb for Ubuntu .

If you are an old user and already have a virtual hard disk you can use other options- Use an existing virtual hard disk. For new users use Select Create a virtual hard disk now and select create.

Select VDI and press Next.

Use Dynamically allocated option as it is efficient and press next.

Now, this is the size of the hard disk, you can set it according to your use, I need approx 26gb. Select and press create.

Now a Virtual machine will be created but still, we haven’t installed Ubuntu on it. Let’s make some configurations to install Ubuntu.

Step 4: Select Ubuntu on left side and then press on settings.

Go to General > Advanced. Then select Bidirectional for both shared clipboard and drag n drop, this makes sure you can copy anything from your PC and paste it inside your virtual machine.

Now go to System > Processor. If you have four CPU’s select 2, select anything in the green line to make sure your Ubuntu is fast.

Now go to Storage > select empty disk under storage devices then > select disk(Showed using a black arrow).

Now select Choose a disk file.

Select Ubuntu ISO file you downloaded at beginning and press open.

Click OK , now all the necessary configurations are completed.

Step 5: Let’s start our Virtual machine and install Ubuntu by pressing start.

Select start up disk as Ubuntu as we are installing Ubuntu and press start.

Select English and then press install Ubuntu.

Choose your keyboard layout , I am choosing English(US), then press continue.

Select Normal Installation and also select download updates so that you will be on the latest software. Press continue.

Don’t worry you won’t be erasing your entire hard drive, it’s just erasing the disk you provided in step 3 so select Erase disk and click Install Now.

Press Continue.

this is for timezone and other stuff so select correct country and press continue.

Note: Remember the username and password given here , don’t forget it retrieving lost password might be difficult later.

Fill in all the details and press continue.

Here it may consume a lot of time depending on your PC speed and Internet speed. So don’t worry just sit back and relax.

Here’s the sweet message we all were waiting for Installation complete :)

Press restart now and then the magic starts Ubuntu load’s up (magical , dramatic music starts)

Step 6: Let’s now configure our Ubuntu, you might notice when you resize the virtual box window still the size of the Ubuntu screen remains the same. we will fix this issue in the next steps.

Once your Ubuntu restarts type in your password you gave and log in.

Step 7: You can skip all these steps .

Step 8: Now let’s fix the screen resizing issue and also enable copy between your virtual machine and host PC.

Go to Applications bottom left.

Search for terminal in search and press on it.

Terminal opens up now type in this command(remember you cant’t copy paste yet) so just type it —

sudo apt install build-essential dkms linux-headers-$(uname -r)

Then press enter, if there are any yes or no prompts press yes and wait for the process to take place if it asks for a password, type in your password and authenticate.

Then Select Devices > Insert guest Additions CD image

Some commands will be executed then it will ask you to press enter .

You will get below dialog box press run.

Now provide password and press authenticate .

After this all the commands will be executed . It will ask you to press enter to come out of this window press enter and power off Ubuntu and start it again.

Step 9: Enter your credentials and login to Ubuntu. Et voila now if you resize your window, even Ubuntu screen resizes and also now copy between your virtual machine and host PC works.

All the setup is now complete. You can now enjoy your Ubuntu and explore the world of Linux.

You can use this same guide to install various other Linux distributions like Kali , Parrot OS, Fedora etc.

Note: For some old PC’s virtualization is not enabled by default if that’s the case open your bios settings before boot up and enable virtualization.

All the download links are put at beginning of the article , for easy access I’ll mention it below again.

Download Links:

If you have any queries or stuck at something , comment below.

I got something wrong? Mention it in the comments. I would love to improve.
If you learnt even a thing or two, clap your hands 👏 as many times as you can to show your support!

About the author: Balachandra is an Undergraduate student who is passionate about developing Mobile and Web apps.You can connect with him on Twitter, LinkedIn, and GitHub.

--

--