Understanding Virtual Machines and Setting Up Your First Linux VM


π₯οΈ Introduction to Virtual Machines (VMs)
A Virtual Machine is an emulated computer system that runs on top of physical hardware using a piece of software called a hypervisor.
𧱠Key Components:
Component | Description |
Host Machine | The physical system where everything runs. |
Hypervisor | The software that creates and manages VMs. |
Guest OS | The operating system running inside the virtual environment. |
Virtual Hardware | CPU, RAM, disk, and network interfaces simulated by the hypervisor. |
π Types of Hypervisors
Type | Description | Examples |
Type 1 | Bare-metal hypervisors run directly on hardware. | VMware ESXi, Microsoft Hyper-V, Xen |
Type 2 | Runs on top of an existing OS. Best for beginners. | VirtualBox, VMware Workstation |
π οΈ Setting Up a Linux Virtual Machine (Step-by-Step)
Letβs walk through setting up a Linux VM using VirtualBox, a free and beginner-friendly Type 2 hypervisor.
β Prerequisites:
Download and install VirtualBox
Download an ISO image of a Linux distribution (e.g., Ubuntu)
π§ Step 1: Create a New VM
Open VirtualBox and click "New".
Name it (e.g.,
DevOps-Lab
) and select Linux > Ubuntu (64-bit).Set RAM (at least 2048 MB recommended).
Create a virtual hard disk (20 GB dynamically allocated is a good start).
π Step 2: Attach ISO and Install Linux
Select your VM and click "Start".
Browse and attach your downloaded Linux ISO.
The VM will boot from the ISO β follow the on-screen steps to install the OS.
βοΈ Step 3: Post-Installation Setup
Install Guest Additions (for better resolution, clipboard sharing).
Update packages:
bashCopyEditsudo apt update && sudo apt upgrade -y
Install useful tools:
bashCopyEditsudo apt install curl git vim -y
π§ͺ Optional: Snapshot Your VM
Before doing major changes, take a snapshot to save the current state:
- Right-click your VM β Snapshots β Take
π― Use Cases of VMs in DevOps
Local Dev/Test Environments: Spin up different OS setups easily.
Simulate Server Environments: Mimic production-like setups without touching real servers.
Practice Infrastructure Automation: Use tools like Ansible, Docker, and Terraform inside VMs.
π Whatβs Next?
Now that youβve set up a Linux VM, you're ready to start experimenting with DevOps tools inside a safe, isolated sandbox. In upcoming lessons, we'll use this VM as our playground to explore:
Terminal commands
Shell scripting
Configuration management (e.g., Ansible)
Containerization (e.g., Docker)
Subscribe to my newsletter
Read articles from M. T. H. Titumir directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

M. T. H. Titumir
M. T. H. Titumir
π Curious mind | Problem solver π Learning & creating π Observing the world, one thought at a time