Installing RHEL7 or CentOS7 on a PC is fairly easy to do. In this tutorial, we will review the installation process step-by-step. Today’s focus will
In this tutorial, we will review how to install Ubuntu desktop on KVM. For this particular demonstration, we will examine version 20.04 of the operating system or Focal Fossa as it’s commonly known by codename.
Installing an Ubuntu Desktop instance on KVM is a straightforward process that we will review in this tutorial. Ubuntu is a Debian-based Linux distribution that’s for the most part, free and open source. It is developed by the UK-based privately held company Canonical and released every six months, with long-term support (LTS) releases every two years.
Image adapted from Josh Sorenson at Pexels
The Ubuntu OS runs on everything from desktops, servers, smartphones, and laptops, to virtual machines, internet of things (IoT) devices and robots. However, for the purposes of this tutorial, we will focus on the latest LTS release as of the date of this publication: Ubuntu 20.04 (“Focal Fossa”).
You can also download the iso using the wget command (below): The Ubuntu-20.04.4 release is the latest available .iso as of the date of this publication.
[admin@kvm-host02 ~]$ wget https://www.releases.ubuntu.com/20.04/ubuntu-20.04.4-desktop-amd64.iso
If you received the following error message (below), it is due to a certificate issue on the website.
[admin@kvm-host02 ~]$ wget https://www.releases.ubuntu.com/20.04/ubuntu-20.04.4-desktop-amd64.iso
--2022-04-17 03:26:26-- https://www.releases.ubuntu.com/20.04/ubuntu-20.04.4-desktop-amd64.iso
Resolving www.releases.ubuntu.com (www.releases.ubuntu.com)... 91.189.91.123, 185.125.190.37, 91.189.91.124, ...
Connecting to www.releases.ubuntu.com (www.releases.ubuntu.com)|91.189.91.123|:443... connected.
ERROR: no certificate subject alternative name matches
requested host name ‘www.releases.ubuntu.com’.
To connect to www.releases.ubuntu.com insecurely, use `--no-check-certificate'.
Therefore, you may issue the same command with the --no-check-certificate option
. We’re just downloading the .iso file from the website, so this a harmless procedure.
[admin@kvm-host02 ~]$ wget https://www.releases.ubuntu.com/20.04/ubuntu-20.04.4-desktop-amd64.iso --no-check-certificate
Next, we’ll cd into the images directory (default image store for KVM). Using the qemu-img utility, we’ll create a qcow2 disk image that will serve as storage for our Ubuntu Desktop virtual machine (below). Also, we’ll allocate 75GB to our new disk image named dev-infotechys-7.img.
[admin@kvm-host02 /var/lib/libvirt/images]$ sudo qemu-img create -f qcow2 dev-infotechys-7.img 75G
Formatting 'dev-infotechys-7.img', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=80530636800 lazy_refcounts=off refcount_bits=16
Now that the ISO is downloaded and disk image is in place, we can begin the installation using KVM (virt-manager).
First, launch the virt-manager on your KVM host as the root user.
[root@kvm-host02 ~]$ virt-manager
Next, click the computer monitor icon (circled in red below) to continue.
Then, you will be prompted to choose the ISO you would like to use for the install. Click the [Browse] button and select the path to your ISO file. Or, enter it in the text box. For this tutorial, the Ubuntu Desktop 20.04.4 ISO is located under /isos. Click the [Forward] button to continue.
In step 3 of 5, you will be prompted to choose the memory and CPU settings for your Ubuntu Desktop instance. For this demonstration, we entered 4096 MB or 4GB for the RAM and 2 CPUs or cores. Click the [Forward] button to continue.
In step 4 of 5, you will be prompted to decide how you want to set up a disk image for your Ubuntu Desktop 20.04 virtual machine. You’ll notice that the “Create a disk image” option is selected by default. We are not going to select this option because we created a qcow2 disk image (dev-infotechys-7.img) earlier–that we’d like to use.
Instead, choose the “Select or create custom option” below it and click the [Manage] button to continue. You will be presented with another window listing the contents of /var/lib/libvirt/images. Select your qcow2 image and click the [Choose Volume] button to continue (all highlighted in red).
In step 5 of 5, we are about ready to begin the installation. There are just a few remaining housekeeping details we need to attend to.
First, enter a name for your Ubuntu Desktop instance. We’re going with vm7-dev-infotechys.com for this demonstration. Choose a name that suits you. Next, click the checkbox to select the “Customize configuration before Install” option. It will allow us to ensure everything checks out before we proceed with install.
Finally, select the “Bridge device” option from the dropdown menu and enter in your bridge interface. For our KVM host, the bridge interface is br03. Your interface will likely be different. Click the [Finish] button to continue.
As you can see (below), everything looks good. We’ve even added a brief note in the description textbox, stating the type of VM we are building. We are now ready to proceed with the Ubuntu Desktop Installer portion. Click the [Apply] and [Begin Installation – Green Check mark] button to continue (circled in red).
At the initial Ubuntu installer screen, you’ll notice that an automatic check of the disk image will begin. Press the [Ctrl+C] keys to skip this process and proceed with the installation process.
Now, you will arrive at the Ubuntu Desktop welcome screen. Select the language that suits you and click the [Install Ubuntu] button to proceed (highlighted in green).
Depending on the region of the world you belong to, click the [Detect Keyboard Layout] button to allow the installer to detect your keyboard configuration. However, if you’re from the US or an English-speaking country, you may skip the keyboard layout detection process and click the [Continue] button to proceed with the installation.
Next, you will be presented with a choice to proceed with a normal installation which includes a web-browser (Firefox), utilities, office software, media players, games, etc. Or, the minimal installation which includes a web-browser and basic utilities. For this tutorial, we will click the [Continue] button to proceed with the default normal installation option.
For the installation type, we will select the [Something else] option, because we want to create and resize partitions to our specifications. Click the [Continue] button to proceed.
We will setup our filesystem partitions according to the following specifications:
The manual disk partitioning procedure will include the following changes:
We will begin by creating the root (/) partition. First, click the [New Partition Table] button and will be presented with a pop-up window, warning you that all existing partitions will be deleted. Click the [Continue] button to proceed (highlighted in green).
As you can see, all of the available space on the disk has been allocated to free space (80+ GB in this example). Now, click the plus (+) sign to create a new partition (highlighted in green below).
In the size text field, enter the 20531 MB which roughly represents 20GB of storage space allocated. For the type of partition, select the Logical option and XFS journaling file system. Finally, select the (/) in the drop down which is the universal symbol for the root partition. Click the [OK] button to continue.
As you can see, there is roughly 60GB of free space available to create the remaining partitions listed in the “partitions specifications” section. Highlight the free space option and click the (+) button to create the /home, /boot, swap, and /extras partitions. Repeat the steps listed in this “creating the root partition” section to setup the remaining partitions and finally, click the [Install Now] button to continue with the installation.
When you’re finished setting up the filesystem partitions, you screen should look similar to the images below. Click the [Install Now] button to continue and save your changes to the disk.
You will be presented a screen with an option to select a timezone according to the region you belong to. We are selecting the “New York” timezone, because we are located in the Eastern region of the United States (US). Click the [Continue] button to proceed.
Now, you will be prompted (in the who are you? window) to create a user account with administrative rights as well as, provide a password and the system name or hostname for your Ubuntu Desktop virtual machine. We’ve selected admin-it as the user and vm7 for the system name (below). Click the [Continue] button to proceed.
Congratulations! You can now walk away from your keyboard as the installer will begin installing the necessary Ubuntu Desktop packages automatically. This process will take a some time to complete–depending on the speed of your CPU.
When the package installation is complete, you will be prompted to restart your virtual machine. Click the [Restart Now] button to proceed.
Your machine should boot to a login screen and thus, bring us to the end of this tutorial.
Upon logging onto your Ubuntu Desktop instance for the first time, you may be prompted to install the latest software updates or configure livepatch, privacy, and other settings. I’ll leave those decisions up to you. However, for this tutorial, we decided to skip through those options to arrive at the desktop screen (below).
Congratulations! You’ve just completed a successful install of Ubuntu 20.04 Desktop virtual machine on KVM. As part of this process we reviewed some system configuration and administration topics like user account and hostname configuration, logical volume manager (LVM), and custom disk partitioning.
Was this article helpful to you? If so, leave us some feedback in the comments section. We’d love to hear from you.
Related Posts
Installing RHEL7 or CentOS7 on a PC is fairly easy to do. In this tutorial, we will review the installation process step-by-step. Today’s focus will
In today’s tutorial, we will install CentOS8 on KVM. The install process is fairly straightforward and we will cover it here step-by-step. We will follow
In this tutorial, we will review the installation procedure for standing up an Ubuntu 20.04 server on KVM. We will focus specifically, on version 20.04