The post “Create a Virtual Machine on your laptop for free” takes you through a step by step process of creating a virtual machine on your laptop while not touching the existing host operating system. In recent times I’ve got plenty of questions from various blog followers on how to set up a VM with less or no cost. Microsoft lovers merely tend to deal with Windows OS and we never try to explore options around Linux. But sometimes we may need to perform POC’s that require opensource support. Now, we’ll see how to set up a VM on your local machine with Ubuntu 18.4 Operating System.
There are multiple ways to set up a VM:
- Use AWS / Azure one-year free tier
- Host a shared Linux VM on a datacenter just with the price of a caramel chocolate
- Use Oracle Virtual Box and create a virtual machine on your laptop for free
- Other options: VMWare Workstation, Windows 10 Hyper-V
Considering the limitations and feasibility, I vote for the third option. We are going to create our own VM on a local machine using the product Oracle Virtual Box.
Recommended resources for VM:
- Host OS (OS on your laptop/system): Windows 10 Operating System
- Available RAM: 1/2 GB
- Available Space: 5/10 GB
- Guest OS: CentOS / Ubuntu ISO image
- Administrator access on the Host system
Oracle Virtual Box:
Virtual Box is a virtualization product that absolutely supports both an individual and an enterprise user. Few things I really liked are “it’s an opensource”, “Optimized”, “Lightweight” and “OS support”. If you have a proper host machine (Laptop/Desktop), you can configure multiple VM’s with different OS and it is very handy to perform the POC’s for your business requirements.
Note: VM supports various OS (Ex: Linux, Windows, Mac, etc). For a quick POC I am going to create a VM with Ubuntu Desktop OS.
Now, we are going to start creating a VM on my local machine:
- Install Oracle Virtual box
- Download Ubuntu 18.4 OS software
- Create a new VM the OS Ubuntu
Install Oracle Virtual Box:
It is the easiest task in the given list. Just download the Oracle Virtual Box from here. Since it is an opensource, it is licensed under the General Public License. From the given link, just click on the image “Download VirtualBox 6.1” and it redirects you to next page from where you can download the installation package by clicking on “Windows Hosts”. It downloads a VirtualBox-6.1.12-139181-Win.exe file sized 103 MB.
I am going to install Virtual Box from downloaded “.exe” file and I would like to take the defaults:
Installation won’t take more than a minute.
Virtual box is installed on my local computer. Now we are going to download a Ubuntu 18.4 software.
Download and Install Ubuntu 18.4:
You can download Ubuntu 18.4 from here. There are two types available “Desktop” and “Server”. Server image installs Ubuntu without GUI and desktop comes with a GUI thereof I am going with the desktop image. When you click on “64-bit PC (AMD64) desktop image” it starts downloading the file “ubuntu-18.04.4-desktop-amd64” sized 2 GB.
Create a New VM with Ubuntu 18.4:
Here, we can configure the VM RAM. I will recommend 2 GB minimum, but I am allocating 4 GB. Good thing is it’s highly scalable which means it doesn’t reserve the memory at first instead it acquires from the host OS whenever more RAM is demanded by VM.
Here, I am allocating the required space for the VM. For my POC I need some extra space hence I am allocating 25 GB. Again, same story with the storage, it doesn’t occupy all 25 GB when initially VM is created. VM just reserves the specified storage and eventually acquires the space whenever it is required.
An empty VM is created and now we need to boot it with the Ubuntu 18.4 OS software. Just follow the below directions. Select the virtual machine and click on START and select the file path of Ubuntu software we just downloaded:
Next screen about the “Installation Type” may give you a mild stroke, don’t worry, we are installing it on VM so without any doubt please go with the option “Erase Disk and Install Ubuntu”
It takes 10 to 15 min to install depends on the available resources and at the end it asks for the restart, please do continue and restart it. Once it is restarted it ask you to “Press Enter” button, once you do, it restarts the VM and take you to the login screen:
We’ve successfully installed Ubuntu 18.4 on Virtual Box.
Now, open the terminal in full screen mode and see how it looks like.
Key Takeaways:
- Oracle VirtualBox is a light weighted product and it is very useful for creating VM’s
- VirtualBox supports a wide range of Operating Systems
- You can learn / perform POC on different operating systems without disturbing the host / local machine OS.
- Obviously, Oracle VirtualBox is one of the best cost saving approach in creating the VM’s
- VirtualBox allows us to clone an Image, a master template, or existing VM just within a few minutes.
- Another beauty is VM Snapshot, so we can simply rollback VM changes incase of any failures
- Bridge networking mode is something like creating a VPN and a common network between all created VM’s.
- We can quickly transfer the files and folders across the multiple operating systems just by DRAG & DROP feature.
- It’s faster, cheaper, flexible and scalable.
There are many reasons why we should use virtualization. I have been using VirtualBox since last 1 year. From my experience I could see the major impact is on timelines. It really saves our time especially when we are running on tight deadlines.
Thank you so much sir.
BTW, can we boot the guest OS with Windows OS?
Lahari,
Yes, it supports a wide range of OS. Remember, we could see some performance issues when we use Windows Server on multiple VM’s.
Thanks
UDay Arumilli
Yes, VirtualBox is a really helpful tool.
Yes Varun, I hope your questions are answered here.
Thanks
Uday Arumilli
As usual awesome Uday Ji.
If we configure 2 VM’s, can we connect them on a common network? I mean I want to configure AlwaysOn between two systems.
Yes Raghu,
You use Bridge Networking and configure AlwaysON. But, inorder to create multiple VM’s we should have good resources on host system. All the best.
Thanks
Uday Arumilli