DEV Community

NJOKU SAMSON EBERE
NJOKU SAMSON EBERE

Posted on

Setting Up Ubuntu Virtual Machine on Windows

Introduction

We have a number of operating systems (OS) in the tech space today like linux, windows and so on. Sometimes, it is possible that there is a particular feature in one OS that we will love to use in another OS. AntMedia Server for instance is a live streaming application created for linux but can be used on windows too. This is made possible by virtual machine (VM).

In this tutorial, I will guide you step by step on how to set up Ubuntu Virtual Machine on Windows. When installed, you can now run applications such as AntMedia Server on windows through this VM.

Prerequisites

In order to be able to follow through on this installation process, you need to have windows 10 or later installed on your machine.

Set Up Virtual Box

A virtual machine (VM) is a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system.

Happily, we have so many virtual machines in the tech space to pick from. We will be using Oracle VM VirtualBox for the purpose of this tutorial.

Let's download and install the VM.

  • Go to Virtualbox Downloads page
    Virtualbox Downloads page

  • Click on the Windows Hosts Link

  • The application should start downloading or give you a popup to do so.

Click on the Windows Hosts Link to start download

You should have the downloaded file

  • Double Click on the file and follow the installation process. It is straight forward.

  • When the installation is completed, start the application and you should have the following screen

Virtual Box Home page

Setup Ubuntu Virtual Machine

Next, we will setup Ubuntu VM. To do this, we will do the following:

  1. Create a new VM in the Virtual Box
  2. Add Ubuntu to that VM

Create a new VM in the Virtual Box

  • Click on the New button at the top menu to create a new virtual environment

Click on the New button at the top menu

  • In the pop up window that shows up, Give it a name and click Next

Name the virtual environment

  • Next, set a RAM size. Use the recommended memory size and click Next

Set a memory size

  • Choose how you want to set up the hard disk. It's advisable to use the recommended method and click create

Choose how you want to set up the hard disk

  • Choose the hard disk file type and click Next

Choose the hard disk file type

  • Select how the storage on the physical hard disk is to be allocated. Dynamic storage allocation is the recommended method. Click Next afterwards

how the storage on the physical hard disk is to be allocated

  • Select the file location for the VM we are creating and give it a size. Click Create once you are done

the file location for the VM we are creating and it's size

You should have the following screen after a successful creation of the VM:

VM Screen

Notice that it bears the name you gave it when you were creating it

Add Ubuntu to that VM

To add Ubuntu, do the following:

Select the Ubuntu image

That will trigger the download of the .iso file. Once it is done, do the following:

  • Head back to the VM that you have created and click on the Start button on the menu bar

click on the Start button on the menu bar

  • In the pop up that follows, click on the storage in the side menu

click on the storage in the side menu

  • Next, click on the Empty link in the Controller IDE section

click on the empty link in the Controller: IDE section

This will lead you to add the Ubuntu file that you downloaded

add the Ubuntu file that you downloaded

After adding the Ubuntu file, it should run an installation process. Once it is done you should have the following screen:

Ubuntu Home Screen

Possible Error!

It is possible to that after adding the Ubuntu image, it might not run and show failed to open a session for the virtual machine error message. The Error window will look like this:

Error Window

Fixing The Error

To fix the error, do the following:

  • Open Command prompt as administrator
  • Type in the following command: bcdedit /set hypervisorlaunchtype off
  • Hit the Enter button. You should get a success message like so:

Command prompt as administrator

  • Restart your computer system

  • After the restart, run the Oracle VM Virtual Box

  • When the Oracle VM Virtual Box Manager is open, Click on the Start button at the top.

The process of loading Ubuntu VM should run correctly without error like so:

Ubuntu VM loading after without error

At the end, you should have the Ubuntu home screen like so:

Ubuntu Home Screen

Wow... We now have another OS asides our initial OS. That is awesome!!!

Conclusion

We have been able to see what a VM is and how important it is in our day-to-day operations especially when we need to cross-use an application in more than one OS. We also saw how to install a virtual box and setup a virtual machine.

Now with the Ubuntu terminal on your machine, you can run an app like AntMedia Server like you will normally do it on Linux. Why not give it a shot. See installation procedures here.

Thank you for reading!

Top comments (0)