Virtual Machines, Cloud, and Distributed Systems
Learning outcomes:
- Explain how virtual machines and hypervisors work, and compare virtual machines with containers
- Describe cloud service models (IaaS, PaaS, SaaS), and evaluate the weaknesses of relying on the cloud
- Compare how operating systems differ for personal computers, phones, servers, NAS devices, and data centers
- Explain what distributed systems are, why they are hard, and how clusters, peer-to-peer systems, and distributed file systems work
Would you like to download my PowerPoint to follow along?
- Virtual Machines
- A virtual machine (VM) is a software version of a whole computer
- A guest OS runs inside the VM, on top of the real computer, the host
- Like an apartment inside a building: each one has its own rooms and lock, but they share the same foundation and plumbing
- The guest thinks it has its own processor, memory, drive, and network card (Week 13)
- The software that runs VMs is called a hypervisor
- Hypervisors
- Type 1 (bare metal): the hypervisor is the operating system on the real hardware. Used in servers and data centers
- KVM, built into Linux, and Proxmox, which is built on it (Linux kernel documentation: KVM)
- Microsoft Hyper-V and VMware ESXi (Microsoft: Hyper-V virtualization)
- Type 2 (hosted): an app running on your normal OS. Used on laptops and desktops
- VirtualBox and VMware Workstation, and Parallels or UTM on Macs (VirtualBox)
- Modern processors have built-in support (Intel VT-x and AMD-V), so VMs run nearly as fast as the real hardware
- What VMs Are Used For
- Running another OS, like the Linux VMs used for labs in this course
- Testing software or risky files safely, then throwing the VM away
- Running many servers on one physical machine, which saves money and power
- Keeping old software running on a newer computer
- WSL2 runs a real Linux kernel in a lightweight VM on Windows (Microsoft: What is Windows Subsystem for Linux)
- Historical note: Windows 7 included "XP Mode", a Windows XP VM for old programs, and Microsoft Virtual PC has been retired. Still worth knowing because the same idea, a VM for old software, is still common
- Virtual Machine Requirements
- Fidelity: programs run the same in a VM as on a real computer
- Performance: programs run at close to full speed
- Safety: a program in one VM can't affect the host or other VMs
- To do this, the hypervisor catches anything the guest OS tries to do directly to the hardware, and handles it safely
- Special guest drivers (VirtualBox Guest Additions, for example) make the virtual disk, network, and screen faster
- Snapshots, Shared Folders, and Networking
- Snapshots save a VM at a moment in time, so you can roll back after a mistake (Week 10)
- Shared folders let the guest and host share files
- Turning them off keeps the guest more isolated, which is safer for testing risky files
- Networking: NAT, bridged, or host-only (Week 13)
- A whole VM is just a few files, so it's easy to copy, back up, or move to another computer
- Weaknesses of Virtual Machines
- Each VM needs its own memory, drive space, and a full OS to update
- Too many VMs on one host can slow everything down
- VM escape: a rare but serious bug that lets a program break out of the guest into the host
- Licensing can change overnight: after Broadcom bought VMware, it ended perpetual licenses and moved to subscriptions, raising costs for many companies (Ars Technica: Broadcom ends VMware perpetual license sales)
- Many moved to alternatives like Proxmox and Hyper-V (Proxmox Virtual Environment)
- Containers vs. Virtual Machines
- A VM includes a whole guest OS. A container shares the host's kernel, and just packages the app and what it needs (Week 2) (Red Hat: Containers vs. VMs)
- Containers start in seconds and use little memory
- VMs give stronger isolation, and can run a different OS than the host
- Docker builds and runs containers. Kubernetes runs large numbers of them across many servers (Docker: What is Docker?)
- Like shipping containers: the same box fits on any ship or truck (Kubernetes: Overview)
- In the cloud, containers often run inside VMs, to get the benefits of both
- The Cloud
- Cloud computing means renting computers you don't own, over the internet, and paying for what you use, like electricity (NIST SP 800-145: The NIST Definition of Cloud Computing)
- Underneath, it's huge data centers running hypervisors and containers
- The biggest providers are Amazon Web Services, Microsoft Azure, and Google Cloud
- Most cloud servers run Linux
- Cloud Service Models
- IaaS (infrastructure as a service): rent a virtual server and manage the OS yourself
- PaaS (platform as a service): upload your app, and the provider runs the OS and servers
- SaaS (software as a service): just use the app, like Google Docs, Microsoft 365, or your school's learning system
- Serverless: upload a small function that runs only when needed. There are still servers, you just never see them
- Like housing: IaaS is renting an empty apartment, PaaS is a furnished one, and SaaS is a hotel
- Weaknesses of the Cloud
- Outages can take down many companies at once
- In October 2025, an AWS bug left DynamoDB with an empty DNS record in its busiest region, and apps such as Snapchat and Slack went down for hours (AWS: Summary of the DynamoDB service disruption)
- Costs can grow quickly, and moving away from one provider is hard (lock-in)
- You share hardware with strangers, and you depend on the provider's security
- Your data may be stored in another country, under different laws
- Data Centers and Energy
- Data centers used about 1.5% of the world's electricity in 2024 (IEA: Energy and AI)
- The IEA expects that to more than double by 2030, driven mostly by AI
- Operating systems help by putting idle cores to sleep, packing VMs and containers onto fewer servers, and turning off unused machines
- Edge computing: process data close to where it's made, in phones, cars, and IoT devices, instead of sending everything to a data center (Week 13) (IBM: What is edge computing?)
- Different Jobs, Different Operating Systems
- Personal computers and phones: a GUI, one main user, frequent updates, and battery life matters
- Servers: often no screen at all, managed remotely over the network, serving thousands of users, and expected to run for months or years without rebooting
- NAS boxes: a stripped-down OS whose main job is storing and sharing files (Week 10)
- Data center hosts: a hypervisor or minimal container OS, managed by software rather than people
- Embedded, phones, and cars: built for one device, with the maker controlling updates (Weeks 1 and 13)
- Server Operating Systems
- Servers favor stability over new features, so they use long-term support releases
- Red Hat Enterprise Linux: 10 years of support for each major version (Red Hat: RHEL life cycle)
- Ubuntu LTS: a new long-term release every 2 years, with 5 years of standard security updates (Ubuntu: Release cycle)
- Windows Server LTSC: 5 years of mainstream and 5 of extended support (Microsoft: Windows Server servicing channels)
- Usually installed without a GUI, and managed with the command line and automation tools
- IBM mainframes still run z/OS and Linux for banks and airlines (Week 1) (IBM Z)
- NAS and Data Center Operating Systems
- NAS operating systems are managed through a web page, and focus on storage, RAID, snapshots, and sharing
- TrueNAS, built around the ZFS file system (Week 9) (TrueNAS Community Edition)
- Synology's DiskStation Manager, which is Linux-based (Synology: DiskStation Manager)
- Container-focused operating systems are tiny and update themselves as a whole, so there is less to attack (Fedora CoreOS)
- Fedora CoreOS, and Amazon's Bottlerocket (AWS: Bottlerocket)
- Hypervisor hosts run Proxmox, Hyper-V, VMware ESXi, or KVM on Linux
- Distributed Systems
- Many computers working together over a network, so that users feel like they are using one machine (IBM: What are distributed systems?)
- Computing and storage are spread across many machines
- Examples you use every day: search engines, streaming services, online games, and cloud storage
- Goals: performance, scalability, reliability, and working even when some machines fail
- Why Distributed Systems Are Hard
- No shared memory: computers coordinate only by sending messages over the network (Week 2)
- No shared clock: each computer's clock is slightly different, so "what happened first" is tricky
- Mutual exclusion has to be done with messages instead of shared locks (Week 6)
- Parts can fail, or the network can split, at any moment
- The system must keep working anyway, and agree on what the data is
- Consistency Trade-offs
- When data is copied to many servers around the world, the copies can briefly disagree
- Like the number of likes on a post showing differently on your phone and your laptop for a few seconds
- The CAP theorem: when the network splits, a system has to choose between staying fully consistent and staying available (IBM: What is the CAP theorem?)
- A bank picks consistency. A social media feed picks availability
- Distributed File Systems
- Share files across many computers, as if they were on one drive
- NFS mounts a folder from another computer (Weeks 9 and 13) (Linux kernel documentation: NFS)
- Large systems spread files across many servers, and keep copies in case one fails
- Cloud storage like OneDrive and Google Drive is a distributed file system you use every day
- Clusters
- A cluster is a group of computers that work together as one system (IBM: What is high-performance computing?)
- High-performance: every computer works on one big job, like supercomputers (Week 1)
- High-availability: backup computers take over if one fails
- A head node hands out the work, and worker nodes do it. The diagram in the PowerPoint uses the older term "slave nodes"
- You may hear these called master and slave nodes. We use head and worker instead, because the old terms come from slavery and can make people feel unwelcome, and the new terms describe the job just as clearly
- Peer-to-Peer
- Every computer (peer) is both a client and a server
- Centralized: a server helps peers find each other, then they connect directly
- Pure: no server at all. Peers find each other by asking around, which can be slow
- Examples: BitTorrent, some game updates, and video calls that connect directly (BitTorrent: Protocol specification)
- Grid and Volunteer Computing
- A grid connects computers in different places, often owned by different groups, to work on one big problem
- Volunteer computing: people donate their computer's spare time
- Folding@home studies how proteins fold, to understand diseases (Folding@home)
- BOINC runs many science projects this way (BOINC)
- Historical note: many earlier projects, like Docking@Home, have finished. Still worth knowing because the same idea powers research today
Suggested Activities and Discussion Topics:
- Activity: install VirtualBox or use the virtual machine from this course. Take a snapshot, make a change (like deleting a file), then roll back to the snapshot. What happened to your change?
- Activity: compare a VM and a container. If you can, install Docker, run docker run hello-world, and time how long it takes to start. Compare that to starting your VM. Why is there such a difference?
- Activity: for three services you use (for example email, a game, and your school's learning system), decide whether each is IaaS, PaaS, or SaaS from your point of view, and explain why
- Activity: look up when your own operating system and one server OS (such as Ubuntu LTS or Red Hat Enterprise Linux) stop getting updates, using endoflife.date. Why do servers get longer support than phones and laptops?
- Discussion: a single cloud outage in October 2025 took down apps for millions of people. Should companies spread their services across several cloud providers? What would that cost them?
- Discussion: data centers are using more and more electricity, mostly for AI. Who should be responsible for that energy use: the cloud companies, the people building AI, or the people using it?
- Discussion: when you post something, your friends may see different like counts for a few seconds. When is that kind of inconsistency fine, and when would it be a serious problem?
Would you like to see some more classes? Click here