Getting a Linux machine to practice on

Beginner · 10 min

A local VM, WSL2, a cloud instance or a container shell: what each one gives you, what it hides, and why snapshots make breaking things cheap.

Before thisDistributions and release models

Tony Teaches Tech · 10 min

Getting a Linux machine to practice on

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by Tony Teaches TechReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Practise on a machine you are allowed to break. Half of this roadmap is about boot, disks, users and firewalls, and those lessons are only real when you can lock yourself out and recover.
  • A local virtual machine is the closest thing to a real server: its own kernel, firmware, bootloader, disks and network. Take a snapshot before every risky exercise.
  • WSL2 runs a real Linux kernel in a managed VM. It is excellent for daily shell work but hides the boot path and the firmware, and Microsoft builds the kernel.
  • A container shell shares the host's kernel and usually has no init system, so it cannot teach boot, modules, systemd or kernel tuning.
  • A small cloud instance is the most realistic way to practise SSH, firewalls and public networking. It costs money and is exposed to the internet from the first minute.

You need something to break

Reading about Linux administration is like reading about swimming. The lessons ahead change bootloaders, add users, rewrite sudo rules, partition disks and drop firewall rules in front of your own SSH session. Each of those can leave a machine unbootable or unreachable. That is fine, and even useful, as long as the machine is yours, cheap, and easy to put back.

So the requirement is not “a Linux machine”. It is a Linux machine you can wreck and restore in a minute. There are four common ways to get one, and they differ in how much of a real server they actually show you.

A local virtual machine

A hypervisor such as VirtualBox, VMware, Hyper-V, Parallels, UTM or KVM pretends to be a whole computer: virtual firmware, a virtual disk, a virtual network card. You install a distribution into it from the normal installer image. Everything is real. The VM has its own kernel, its own bootloader, and its own disks to partition.

That makes it the best practice machine for this roadmap. You can watch the boot console, pick a different kernel in the GRUB menu, add a second virtual disk for the storage lessons, and break networking without losing your connection to it.

The feature that matters most is the snapshot. A snapshot freezes the disk and settings at a point in time. Take one before each exercise. When you lock yourself out, roll back. It is the undo button that real servers do not have.

Two practical points. Install a server image, not a desktop one, and log in over SSH from your own terminal, the way you would reach a real server. That is exactly what the embedded video does. And match the architecture to your host: an Apple Silicon Mac runs arm64 guests. VirtualBox added Apple Silicon hosts in version 7.1, with arm64 Linux guests only, and UTM, Parallels, VMware Fusion and Canonical’s Multipass also work. Multipass is the fastest route to an Ubuntu VM: one command, and it supports snapshots.

WSL2 on Windows

Microsoft’s documentation describes WSL 2 as running “a Linux kernel inside of a lightweight utility virtual machine”, with “full system call compatibility”. The kernel is built by Microsoft from kernel.org sources and updated through Windows Update. For daily shell work, scripting and the commands in shell-bash, it is excellent and nearly free.

It hides things you need later. You never see firmware or a bootloader, because WSL starts the distribution for you. Networking is NAT behind Windows by default. And systemd is not always PID 1: Microsoft’s docs say the current Ubuntu uses systemd by default, while other distributions start with WSL’s own init until you add systemd=true under [boot] in /etc/wsl.conf and restart WSL. Use WSL for the early lessons and a VM for the boot and storage ones.

A container shell

docker run -it debian bash gives you a Debian prompt in a second. It is tempting, and for package-manager practice it is fine. But a container is not a machine. It shares the host’s kernel, as the devops lesson what a container really is shows. I unpacked the official Debian 13 image while writing this roadmap and its /boot directory is empty: there is no kernel to boot. Usually there is no systemd either, because the first process is your shell. So containers cannot teach boot, kernel modules, sysctl, or services. Use them for throwaway userland experiments only.

A cloud instance

A small instance from any cloud provider is a real server on a real public network. It is the most honest way to practise SSH hardening, firewalls and DNS. Two cautions. It bills by the hour, so destroy it when you are done. And it is on the internet immediately, so set up key-based SSH before anything else; automated scanners sweep public address ranges continuously, so assume the SSH port is being tried from the start. Most providers offer disk snapshots, which play the same undo role as in a local VM.

What to use for this roadmap

A reasonable setup: one local VM running Debian 13 or Ubuntu 26.04 LTS, and a second running Rocky Linux, AlmaLinux or Fedora, so you see both families from the previous lesson. Give each a second empty virtual disk for the storage group. Take a snapshot called “clean” right after installation. Add a cloud instance when you reach networking and security.

About the video

The embed is Tony Teaches Tech’s “How to Run an Ubuntu Server VM with VirtualBox (and login via SSH)”, June 2023, about 10 minutes, in full. Chapters cover creating the VM, installing Ubuntu Server, setting up SSH access and running the VM headless. That is the setup this lesson recommends. It does not cover snapshots, WSL, containers or cloud instances, which the lesson does in prose, and it shows an x86 host. English was judged from the title, channel and the original English audio track. Michael Horn’s video in deeper explains what WSL is and is not for.

Nothing was run for this lesson apart from inspecting the downloaded Debian image. The WSL statements come from Microsoft’s documentation, the VirtualBox 7.1 Apple Silicon support from Oracle’s release notes as reported in search results, and Multipass from Canonical’s docs, all checked 2026-11-28.

Check yourself

  1. 01You want to practise recovering from a broken GRUB configuration. Which of VM, WSL2, container or cloud instance is the best fit, and why?

    A local VM. It has its own firmware and bootloader, you can watch the console during boot, and you can roll back to a snapshot. WSL2 and containers skip the bootloader entirely.

  2. 02Inside a container you run lsmod and see modules you never loaded. Where do they come from?

    From the host. A container shares the host's kernel, so it sees the host's loaded modules, and it normally cannot load or unload them.

  3. 03What is the one habit that makes a practice VM safe to break?

    Taking a snapshot before each risky change, so a broken boot or a deleted file is a one-click rollback.

  4. 04Why might systemctl not work in a WSL distribution?

    WSL can start distributions with its own init instead of systemd. The current Ubuntu enables systemd by default; other distributions need systemd=true under [boot] in /etc/wsl.conf.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark