Install Ubuntu 20.04 LTS on VirtualBox

Ethan Park
9 min readFeb 2, 2021

--

Photo by Christopher Gower on Unsplash

To develop something, you must set up the development environment first. Especially if you are developing a server, you usually choose a Linux environment. There are many reasons, but the biggest reason is that it is free. The code is open-source and there are various distributions. Each distribution has its pros and cons, but if you put in a user-friendly interface at the GUI level, there is not much difference, so you can choose a distribution that suits your taste. I’m going to use Ubuntu, which I’ve been using for a long time. I will use the most recent version of 20.04.1 LTS to write this article.

Most of people use Windows as the OS of their personal PC. I am also using Windows 10 Professional. I don’t want to build a separate machine to run my personal server, or change the OS of my personal PC to Linux. It’s because of the convenience Windows offers on personal PCs. In these cases, the most preferred option is to use a virtual machine. VirtualBox, Vmware, and so on. I will use VirtualBox as a solution for my personal project. We will install VirtualBox on a personal PC with Windows 10 Professional, then create a virtual machine and install Ubuntu 20.04 LTS on that virtual machine. Let’s get started.

  • Download & Install VirtualBox

First, go to https://www.virtualbox.org/wiki/Downloads and download virtualbox for Windows (click on Windows hosts in the middle). As always, the Virtualbox homepage is very fast and pleasant to download. Then follow next to complete the installation.

  • Create VirtualBox Virtual Machine(VM)

When you run VirtualBox, you will see the above screen. We will create a new virtual machine to install Ubuntu 20.04 LTS. Click “Create New.”

Type the appropriate name as the name of the virtual machine (I type as master), and specify the folder path where the virtual machine files are stored. Specify a virtual machine file path with sufficient capacity because it can be very large (decades to hundreds of GB). If possible, storing on SSD is advantageous in terms of speed. Specify the type Linux, version Ubuntu 64-bit, and click Next.

Specify the size of memory (RAM) allocated to the virtual machine. Avoid allocating too much memory to the Guest OS because the entire 8GB of memory is shared by the Host OS (Windows 10 professional here) and Guest OS (Ubuntu 20.04 LTS here). A typical Linux OS is sufficient for 2GB for testing.

Select “Create a virtual hard disk for the virtual machine” and click “Create”.

Specify the virtual hard disk file format as VDI and click “Next”. If you want to use the virtual hard disk you created here in the future on Vmware, you can choose VMDK.

Select a “fixed size” for the virtual hard disk. The fixed size is faster than dynamic allocation because it allocates continuous space and writes sequentially to sectors on physical hard disks. With SSD as the primary source of use compared to older HDD, the difference is relatively small, but it is undeniable that they are fast. There is also a way to expand the size again in the future, even if you choose a fixed size. This time, select a fixed size and click “Next”.

Allocate reasonable capacity. I will allocate about 30GB. If the virtual machine is dealing with a large volume of data, we will consider expanding the size, or linking external storage such as NFS. Enter a size and click “Create”.

It takes some time to get the capacity of the size you entered. The larger the size you enter, the longer it takes.

Now, virtual machines named master has been created. It’s same as you just bought an physical device only. Nothing is installed in this virtual machine. First of all, let’s setup the spec of this virtual machine. Click “settings”.

Go to General → Advanced tab, select bidirection of Clipboard sharing and drag-and-drop, and then click the “confirmation”. This is the setting to make sharing data between Host OS and Guest OS more convenient.

Go to System -> Processor and setup with appropriate number of the number of cpu processor. My pc’s actual number of cpu core is six but operates as 12 cores logically through hyper threading. Virtual machine’s point of view, physical or logical, 12 core is perceived as being available. Here, enter 2 cores. This setting can be changed at any time.

Go to Network -> Adapter1 to set up your network. When you set up a virtual machine, it’s the most important thing to know exactly. When you create and use only one virtual machine, the network may not be very important, but if you consider clustering with multiple virtual machines, communication between virtual machines, and even communication with Host machines, you need to set up a network for your purpose. In my case, I am planning to operate multiple virtual machines, so I need to be able to communicate with them, and I need to be able to access each virtual machine from the external Internet. The configuration that can meet my requirements is the ‘bridge to adapter’ and the ‘NAT network’, but ‘Nat network’ requires port forwarding settings for both exposed ports. To alleviate this difficulty, select ‘Bridge to adapter’ and click “OK”.

  • Download Ubuntu 20.04 LTS Image

Each virtual machine is assigned only physical resources (cpu, memory, storage, gpu, etc.) and does not have any s/w installed. In terms of pc, it’s the condition when you bring the assembled pc from Yongsan Electronics Market. Now let’s install OS on each virtual machine. Go to this link and download the Ubuntu 20.04 LTS image. Select the Desktop version to use the GUI as well.

After running Virtualbox, return to the virtual machine screen you created earlier and click “Settings”.

Go to Storage, click Empty on IDE Controller, and click the round disk image on the right.

Click Select Disk File.

Go to the folder that contains the Ubuntu 20.04 LTS image you downloaded earlier, select the file, and click “Open”.

The IDE controller then displays as inserted Ubuntu 20.04 LTS image. Click “OK”.

You will return to the master virtual machine screen. Click “Start” to boot the virtual machine.

There is a screen that asks you to select a startup disk, and since you inserted Ubuntu 20.04 LTS image into the IDE controller, it will be loaded automatically. Click “Start”.

You will now begin installing Ubuntu 20.04 LTS on your virtual machine.

Click “Install Ubuntu” in English mode to proceed with the Ubuntu installation.

Select English as the keyboard layout.

Select the minimum installation mode to avoid unnecessary s/w installations, release the Download update check box to perform manual updates if necessary, and click “Continue”.

Completely delete the disk, select Install (Clean Install) and click “Install Now”.

Click “Continue”.

Select the Seoul area on the map and click “Continue”.

Input appropriate id and password, select auto login, click the “continue” after selecting.

The installation process proceeds.

The installation is complete. Click “Restart Now”.

It’s a message to remove the Ubuntu 20.04 LTS image that I inserted earlier. Press “Enter”.

Ubuntu 20.04 LTS booted successfully. This is the Account Settings screen and click “Skip”.

Skip the live patch as well and click Next.

This is the screen that sends information about my PC, select No, and click Next.

This screen allows the location information of the PC to be used by the Application. After disabling it, click Next.

This is the screen for installing additional s/w, and click “Done”.

This screen installs an additional updated version of Ubuntu 20.04 and selects “Remind Me Later”. You can click “Install Now” to install it.

The screen is finally complete with all the installations.

To shut down the virtual machine, click “drop-down” in the upper right inverted triangle, click “Power Off/Log Out” and click “Power Off”.

Click “Power Off” to shut down the virtual machine.

  • Conclusion

Through the above process, I created a virtual machine through Virtualbox, installed and set up Ubuntu 20.04 LTS above it. This completes the implementation of a Linux-based S/W development environment. You can build a virtual environment without having to purchase additional device to install a heterogeneous OS that is completely separate from the Host OS, saving money, and managing guest OS with features supported by Virtualbox such as snapshots, restores, and virtual machine replication. Also, if the Host PC has good performance, the performance of the virtual machine will be improved proportionally.

--

--

Ethan Park
Ethan Park

Written by Ethan Park

Software engineer on paternity leave.

No responses yet