Setting Up An Ubuntu Linux Virtual Machine – Walkthrough And Tutorial

Hi there, welcome to my blog! Today we’re going to walk through the steps to set up an Ubuntu Linux Virtual Machine using Oracle VM VirtualBox.

First off let’s go ahead and define what exactly a virtual machine is…

According to VMware, “A Virtual Machine (VM) is a compute resource that uses software instead of a physical computer to run programs and deploy apps. One or more virtual “guest” machines run on a physical “host” machine.  Each virtual machine runs its own operating system and functions separately from the other VMs, even when they are all running on the same host. This means that, for example, a virtual MacOS virtual machine can run on a physical PC. “

Great, so this essentially means that we can use our host machine (in my case for this tutorial it will be using the Windows 10 Operating System) and then create a virtual “guest” machine on top of it, which will run our Ubuntu Operating System.

By utilizing virtualization, you can get the best of both worlds and easily interact with numerous Operating Systems, spinning up/winding down VMs with ease.

Tools Required:

Now we will need to make sure that we have the software and files required for our operating system install. This will include downloading and installing Oracle VM VirtualBox (or some other Hypervisor software such as VMware), as well as making sure we have an Ubuntu .iso that we can use for our Operating System installation. Let’s get started with the Ubuntu .iso first.

Ubuntu 20.04.3 LTS Download

We will need to navigate to the Ubuntu downloads page so that we can go ahead and grab the .iso we need.

Wondering what a .iso is exactly?

We’ll go ahead and use techopedia’s definition: An ISO image is a type of disc image that acts as an archive file that is comprised of all sector data contained in an optical disc, including its file system.

In our case, the Ubuntu ISO image will contain everything we need for not only our installation, but also a live version that will allow us to try out Ubuntu before committing to a full install.

Ubuntu .iso Download

Now, let’s go ahead and navigate to Ubuntu’s download page:

As you can see, we have a number of options to choose from.

For the purpose of this tutorial, we will be using Ubuntu Desktop version 20.04.3 LTS, however I absolutely recommend also checking out some of the other flavors of Ubuntu offered such as Kubuntu, Xubuntu, and Lubuntu.

Since we want the Ubuntu Desktop for this tutorial, let’s go ahead and click on that link:

Make sure to take note of the system requirements, just in case you are using some older hardware.

Most modern laptops/desktop PCs should have absolutely no problem running Ubuntu (In some cases, you could potentially even see some upsides over Windows as a main OS).

Now we can go ahead and begin our download of the Ubuntu iso file. If you’re familiar with torrents, there is an additional download option that offers a .torrent file for download, which could be quicker depending on your internet speed.

Go ahead and click the download button and wait for your download to begin:

Once your .iso download has finished, take a mental note of wherever you saved it and let’s get started with the download and installation of the next tool required: Oracle VM VirtualBox (or another similar hypervisor software).

Oracle VM VirtualBox

We will need to download and install Oracle VM Virtualbox, which is a free, open-source hypervisor that can be used on Windows, macOS, Linux, and Solaris. VirtualBox can be downloaded from their website at virtualbox.org. Make sure to choose the appropriate package for your Operating System, which in my case will be VirtualBox 6.1.26 for Windows hosts:

Once you have downloaded the correct VirtualBox version, you will need to go ahead and go through the installation process using the VirtualBox Setup Wizard:

Go ahead and proceed through the installation and once finished you will be greeted with a screen that resembles something like this:

Creating A New Ubuntu Linux Virtual Machine

Perfect! We’re now ready to go ahead and set up a new Virtual Machine in VirtualBox. Click on the blue badge New icon and you’ll be greeted with a screen like this:

From here you can go ahead and give your new VM a name (I chose Ubuntu), choose a machine folder (as you can see mine is in my Users folder), and a type/version for your machine (here we chose Linux for the type and Ubuntu (64-bit) for version, matching the .iso we downloaded).

Go ahead and click next and we’ll be greeted by a screen asking us to choose the amount of memory that will be allocated to the virtual machine.

From what I’ve read, it seems like a good rule of thumb is to go ahead and assign a minimum of 4GB up to 8GB depending on the amount of RAM you have.

Since I have 32GB of RAM I’m going to go ahead and assign myself 8GB of memory for my Ubuntu VM:

Next we will need to create some form of storage for our Virtual Machine to use. VirtualBox makes it easy to create a virtual hard disk, which is what we are going to go ahead and do.

Create a new virtual hard disk now and click create. On the next screen, choose VDI (VirtualBox Disk Image) since we will not be using the hard disk with other virtualization software. Go ahead and click next.

On the next screen, we’re going to choose dynamically allocated for our storage type. Click next.

Finally, we will now choose where we want out virtual hard disk to be saved and how much space we want to allocate to it.

A minimum of 10GB is recommended for your Ubuntu install/place to keep your files, but I would say that you would be better off doing at least 20GB. I’m going to do 60GB for mine:

Go ahead and click create, and now you’ll be taken back to the main VirtualBox screen except now you can see your new Virtual Machine details in the main window and it’s name on the left panel:

Now we are almost ready to begin the installation process of our Ubuntu Operating System. We just need to make sure we adjust a few more settings before we are ready to start up the Virtual Machine.

Ubuntu Linux Virtual Machine Settings

Go ahead and select the Settings gear to open the settings menu:

Next, we will choose system from the left panel and then select the Processor tab in the main window. We’re going to adjust our processor from 1 CPU to 2 here:

Next, let’s head down to the display and go ahead and adjust our video memory to make sure it is at least in the green colored area and add any additional monitors we may have:

Now we’re ready to go ahead and select our .iso and the boot order from the storage section.

Here we want to select the blue disc under Controller: IDE that says empty and go ahead and click on the blue disc with a drop down on the right side:

Now we will choose a disk file… and go ahead and navigate to wherever you saved your Ubuntu .iso that you downloaded earlier.

Click open once you have found it and then make sure you can see it on the left panel now where it used to say empty:

Click ok to close the settings menu.

We are now ready to start out Ubuntu Virtual Machine for the first time, which will give us a live version of the Ubuntu Operating System.

From the live system we can play around with some of the features, or we can just go ahead and choose to go on with the full install.

Starting Your VM and Installing Ubuntu

Go ahead and press the Green Start button and wait for the VM to launch. You’ll see on the left panel that your VM will now say Running:

Installation for Your Ubuntu Linux Virtual Machine

Once the VM has fully booted up you’ll be greeted with a screen where you can decide to either Try Ubuntu or Install Ubuntu.

We’re going to move right along with the installation. Select your language of choice and then click Install Ubuntu.

On the next screen you’ll go ahead and select your keyboard layout:

Note: The screen might look a bit weird at this point and you will have issues resizing/attempting to get it to go full-screen. This might make the installation process a bit awkward, but we will go through the steps to make sure you gain this functionality at a later step, so don’t worry!

Go ahead and choose your keyboard layout and press continue, where you will be shown a screen with a few installation options to select from:

If you’re a beginner to Ubuntu, I would recommend just using the default settings and clicking continue. That’s what we’ll go ahead and do now for this tutorial. The next screen will show one last Installation type setting to choose: how we want to partition/install our operating system.

Since we are using a virtual hard disk, there is no harm in using the Erase disk and install Ubuntu default setting.

This will not affect your host system that is running VIrtualBox, only the virtual hard disk you created in the earlier steps.

Next, click Install now and review the changes to the virtual hard disk before selecting continue:

After clicking continue, you will need to select your time zone:

And, finally, let Ubuntu know who’s going to be using this machine by choosing your username and password:

Once you’ve filled out your details go ahead and select continue and sit back, the installation process has begun:

While you’re waiting for the install to finish, why not take a look at my other blog post – TryHackMe RootMe Walkthrough to learn about Penetration Testing and some Beginner CTF Tactics using the Kali Operating System? Keep an eye out for a Kali Virtual Machine tutorial in the future!

After waiting for a short while, the installation should complete succesfully and you will be greeted with a message to restart:

Go ahead and click Restart Now and you’ll be shown a screen saying, “Please remove the installation medium, then press Enter:”

Sometimes, I run into an issue where the Virtual Machine will restart without removing the .iso image automatically and will bring you back to a live version of Ubuntu. If this happens go ahead and follow these next few steps.

We’re going to go ahead and close this VM window and select power off the machine from the options:

Once the machine has powered off, let’s go back to our VirtualBox main screen and click on the settings gear again for our Ubuntu VM:

From the settings menu, navigate back to the Storage section and make sure to remove your Ubuntu .iso you previously added, so that it says Empty again:

Click ok and close the settings menu.

Now let’s go ahead and click Start one more time to start up our Ubuntu Virtual Machine again.

Once it has loaded up, you should be greeted with a login screen identifying whatever username you made during the installation:

Let’s go ahead and enter our password and log-in to get our first glance at our newly installed Ubuntu Operating System!

You’ll first be greeted with an option to sync up any online accounts:

We’re going to go ahead and skip this and the next option provided for Livepatch by just clicking next and then next one more time on the help improve Ubuntu screen.

Choose whether you want to use location services and click next and now you’re ready to go!

Ubuntu will show you a selection of applications that can be installed using Software:

Before you start adding some new programs, let’s go ahead and focus on making sure our Ubuntu is updated to the latest version and then we will also work on getting some additional functionality including a resizable window.

Installing Guest Additions

In order to make sure we get full functionality out of our Virtual Machine, we will need to make sure we install the Guest Additions for Ubuntu. This is easy enough with VirtualBox and we can do this by navigating to Devices in the top menu and selecting “Insert Guest Additions CD Image…”:

Ubuntu Linux Virtual Machine Guest Additions

On the prompt that comes up, go ahead and select Run and then authenticate yourself with your admin password:

Ubuntu Linux Virtual Machine Guest Additions

A terminal window will open up and begin installing the Guest Additions. Once completed go ahead and press Enter to close the terminal window. We will need to restart before the changes take effect.

Updating and Upgrading Your Ubuntu Linux Virtual Machine Using CLI

First thing we need to do is make sure we update our new OS by opening the Terminal. We can use the shortcut of ctrl+alt+T for this, or just navigate and find it in the menu:

Ubuntu Linux Virtual Machine Terminal

From here we are going to use the command “sudo apt update” to go ahead and have Ubuntu collect any pending updates after we enter our sudo (admin) password:

Ubuntu Linux Virtual Machine

Now we know that we have 51 packages that can be upgraded, so let’s go ahead and do that with the command “sudo apt upgrade” and then typing “Y” when prompted to continue:

Ubuntu Linux Virtual Machine

Wait for the upgrade process to complete and you’ll be taken back to the terminal prompt where you can again type:

Ubuntu Linux Virtual Machine

Now we can go ahead and type reboot to restart our Ubuntu OS with the new updates and Guest Additions installed:

Ubuntu Linux Virtual Machine

Once the VM has finished rebooting, you should be able to resize your Ubuntu Desktop and make full use of your new Operating System:

Ubuntu Linux Virtual Machine

Phew, well done! You are now the proud owner of a Virtual Machine running Ubuntu Desktop and have the knowledge to recreate these steps for other operating systems that you may be interested in!

Go ahead and play around with your new OS, tweak some settings, change your wallpaper, the sky is your limit. The beauty of a Virtual Machine is that you have the freedom to mess around without worrying about affecting your host system. Go wild!

For more interesting reading, feel free to check out my previous blog post: ROOTME WALKTHROUGH – TRYHACKME.COM – CTF FOR BEGINNERS

Questions, comments, notice a spelling error or a grammatical mistake? Did I provide the wrong information anywhere? Please, feel free to reach out to me either through email or through my contact page on this website!

Thank you for taking the time to read my blog and I look forward to hearing from you!

Leave a Reply

Your email address will not be published.