DEV Community

Turjo Chowdhury
Turjo Chowdhury

Posted on

Understanding Virtual Machines: A Docker Journey Begins

What Are Virtual Machines?

Before diving into Docker, I needed to understand virtual machines (VMs). Think of a virtual machine as a computer inside your computer. It's software that mimics physical hardware, letting you run a completely separate operating system on your existing machine.

For example, I can run Ubuntu Linux on my Windows laptop, or run Windows on my Mac, all through virtual machines.

How Virtual Machines Work

A virtual machine uses something called a hypervisor. This is special software that sits between your physical hardware and the virtual machines. Popular hypervisors include VirtualBox, VMware, and Hyper-V.

Here's what happens: the hypervisor divides your computer's resources (CPU, RAM, storage) and allocates portions to each VM. Each VM thinks it has its own dedicated hardware, but really it's sharing with your main system.

Why Use Virtual Machines?

Isolation: Each VM is completely separate. If one crashes or gets infected with malware, it doesn't affect your main system or other VMs.

Testing environments: I can test software on different operating systems without needing multiple physical computers.

Learning safely: Perfect for experimenting with new tools or configurations without risking my main setup.

Running incompatible software: Sometimes you need Windows-only software on a Mac, or vice versa.

My Takeaway

Virtual machines taught me the concept of isolation and resource allocation. Understanding VMs makes it easier to grasp why Docker and containers were created. They solve many of VM's limitations while keeping the benefits of isolation.


This is part of my journey learning Docker and containerization. Follow along as I document what I learn!

Top comments (0)