VM, WSL, live media, and bare metal
On this page
You ask four people how to start practicing Linux, and you get four different answers:
- “Install WSL. It is already part of Windows.”
- “Put Ubuntu on a USB stick and start the computer from it.”
- “Make a virtual machine.”
- “Remove Windows and install Linux. That is the only way to really learn.”
Each answer gives you a Linux system with a prompt. Later in this course, you will change settings, stop services, remove files, and make mistakes on purpose. One of the four setups lets you undo that with a few clicks. With others, a mistake can reach your own files.
By the end of this lesson, you can compare the four setups with four questions, say which one fits which job, and explain why this course uses a full virtual machine.
Before you start
Section titled “Before you start”- Kernel, user space, and distributions (B01.3), for kernel and user space, and Choosing a distribution and understanding use cases (B01.4), where the term virtual machine first appears.
- You do not need a Linux system yet. You install nothing in this lesson; lesson B02.3 builds the lab.
Four ways to run Linux
Section titled “Four ways to run Linux”Bare metal. Linux is installed on the computer’s own storage and runs directly on the hardware. If it shares the computer with another operating system, such as Windows, you choose one at startup; this is dual booting, and only one runs at a time.
Live media. You copy an installation image of Ubuntu Desktop to a USB stick and start the computer from it. On the first screens, Try Ubuntu starts a complete desktop from the USB stick without installing anything: a live session. The same stick can also install Ubuntu on bare metal.
A virtual machine. A virtual machine, or VM, is a simulated computer that runs as a program on your computer. The VirtualBox manual uses two terms for the two sides:
- The host is “the physical computer, such as a laptop or server, where you run VirtualBox”, with its own operating system, the host OS.
- The guest OS is “the OS that is running inside a virtual machine”.
The guest has virtual hardware: a number of CPUs, an amount of memory, and a virtual disk, which is a file on the host that the guest uses as its storage drive. A full VM runs a complete guest OS, with its own kernel.
WSL. The Windows Subsystem for Linux is a feature of Windows that runs a Linux distribution, such as Ubuntu, alongside Windows. It exists in two versions that work in different ways:
- WSL 1 has no Linux kernel. It translates the requests of Linux programs, their system calls (lesson B01.1), into requests to Windows.
- WSL 2 runs a real Linux kernel. Microsoft’s documentation says it runs “a Linux kernel inside of a lightweight utility virtual machine (VM)”. Windows creates and manages that VM for you. WSL 2 is the default.
Four questions to ask about each setup
Section titled “Four questions to ask about each setup”- Isolation. If something goes wrong inside Linux, what else can it reach: your own files, your other operating system, the computer’s disks?
- Persistence. After you restart, are your files and changes still there?
- Hardware access. Does Linux use the real hardware, or devices that are simulated for it?
- Snapshots. Can you save the whole system’s state and return to it later? A snapshot is such a saved state. The VirtualBox manual says it lets you “save a particular state of a virtual machine for later use”.
The answers depend mostly on two things: where the Linux kernel runs, and what sits between it and the hardware.
Where the kernel runs
Section titled “Where the kernel runs”Guess first: in WSL 2, the Ubuntu distribution runs on a Linux kernel. Is it Ubuntu’s kernel, as in lesson B01.3?
Check your guess
No. The kernel in WSL 2 is built by Microsoft from the kernel source code, and Windows updates it. The user space is Ubuntu’s: its libraries, its shell, its package manager. So a lesson that depends on how Ubuntu’s own kernel behaves may not match what you see in WSL 2.
Now compare a full VM, WSL 2, and a live USB session side by side:
Read the diagram from the bottom up.
- Full VM. The hardware runs your host OS: Windows, macOS, or Linux. VirtualBox runs on the host OS, and inside the VM the guest has its own Ubuntu kernel and user space. The dashed line is the boundary between guest and host. The guest stores everything on its virtual disk, so it is kept after a restart.
- WSL 2. The bottom layer is different. A hypervisor is software that runs virtual machines; VirtualBox is one, and it runs as a program on the host OS. WSL 2 uses Hyper-V, Microsoft’s hypervisor, which sits directly on the hardware. Windows then runs on Hyper-V too, beside the managed VM. Windows is still the host OS, because it starts and manages the VM. Your Linux files are kept in a virtual disk file,
ext4.vhdx. - Live USB session. No other operating system runs. The Ubuntu kernel from the USB stick runs directly on the hardware, so there is no host and no guest. By default, the session keeps nothing.
Guess first: in a live session, you save a file on the desktop, then restart from the same USB stick. Is the file there?
Check your guess
No. Ubuntu’s documentation describes the live session as a way to try Ubuntu “without making any permanent changes”. What you change in the session, including files on its desktop, is gone after a restart.
But the opposite trap exists too. A live session runs on the real hardware, so it can open the computer’s internal disk and any USB drive. A file you save there stays, and a file you delete there is gone.
Comparing the four setups
Section titled “Comparing the four setups”Bare metal is not in the diagram, because it has no layers to compare: Linux and its kernel run on the hardware, and everything is kept on the computer’s own disk.
| Full VM (VirtualBox) | WSL 2 | Live USB session | Bare metal | |
|---|---|---|---|---|
| Isolation | Strong: own kernel and disk; host files only through a shared folder you set up | Partial: own kernel, but Windows drives at /mnt/c |
None for storage: it can open the internal disks | None: Linux is the system |
| Persistence | Kept on the virtual disk | Kept in ext4.vhdx |
Lost by default | Kept |
| Hardware access | Virtual devices; a host USB device can be passed in | USB through usbipd-win; no serial ports |
The real hardware | The real hardware |
| Snapshots | Yes, restored with a few clicks | No; wsl --export saves a copy |
Not applicable | No; only backups |
| Suits this course? | Yes: the reference | Partly: kernel, startup, and desktop differ | A first look only | Possible, but mistakes affect your real system |
Notice the WSL 2 isolation cell. WSL 2 has its own kernel, but Microsoft built it to be close to Windows: C: appears at /mnt/c, and Windows programs start from the Linux prompt. That closeness makes WSL good for daily work on Windows, and it is why WSL is not a sealed lab.
In the snapshots row, wsl --export saves the whole distribution as one file that you can import again. It works as a backup, not as a snapshot that you restore in place.
Why this course uses a full VM
Section titled “Why this course uses a full VM”This course is built and tested on Ubuntu 24.04 LTS Desktop in a VM made with Oracle VirtualBox 7. A full VM is the reference environment for three reasons, which together make it safe to break:
- Isolation. The guest has its own kernel and its own disk. A command that damages the guest does not reach your files on the host.
- Snapshots. Before a risky exercise, you take a snapshot. When you restore it, the VirtualBox manual says, “the current state of the machine is lost”, which here is the point: the mistake is gone, and the system is as it was.
- A real kernel and systemd. The guest runs Ubuntu’s own kernel and starts with systemd, the init program from lesson B01.3, as an installed Ubuntu does, so lessons about services, startup, and the desktop match what you see.
VirtualBox is free and runs on Windows, macOS, and Linux hosts, so one set of steps serves most learners. Lesson B02.3 creates the VM and notes where the hosts differ, including Macs with Apple silicon.
Mistakes to recognize
Section titled “Mistakes to recognize”These mistakes produce no error message. You notice them by what is missing or what changed.
A command in WSL changed Windows files. You ran a command on a path under /mnt/c, and files changed in Windows. In WSL, /mnt/c is your Windows C: drive, not a copy.
Expecting WSL 1 to behave like Linux. A program that works in WSL 2 fails in WSL 1. WSL 1 has no Linux kernel and does not support every system call. The Windows command wsl --list --verbose shows which version each distribution uses.
Good to know
Section titled “Good to know”Microsoft’s WSL documentation lists VirtualBox together with WSL 2 as “unsupported”, because of remaining challenges, and advises using the current versions of both if you run them together. The diagram shows why they meet: with WSL 2 on, Hyper-V runs under Windows, and VirtualBox is a program on that Windows. If you already use WSL 2, lesson B02.3 shows what you see in VirtualBox and what you can do.
Security Angle
Section titled “Security Angle”Security work often means running something you do not trust yet, such as a sample from an exercise that is meant to be harmful. Suppose it encrypts every file it can reach. In a full VM with no shared folder, that is only the guest’s virtual disk, and restoring the snapshot you took first removes the damage. The VM boundary is strong, but VirtualBox is software too and receives security fixes, so keep it updated.
Try it yourself
Section titled “Try it yourself”Goal: Choose a setup for each situation and give a reason from isolation, persistence, hardware access, or snapshots.
- A friend wants to know whether the Wi-Fi adapter in their laptop works with Ubuntu, before installing anything.
- You want to follow an exercise that changes how the system starts. If you get it wrong, the system may no longer start.
- A developer on Windows wants Linux tools every day, on files that Windows programs also open.
- An old laptop will be used only for Linux, as a small home server.
Expected: A setup and one reason for each situation.
Hint
For 1, which setups use the real hardware without installing? For 2, how do you get back to a working system? For 3, does closeness to Windows help here? For 4, is a host OS needed at all?
Solution
- Live USB session. It runs on the real hardware, including the Wi-Fi adapter, and changes nothing on the laptop. A VM sees only a virtual network device.
- Full VM, with a snapshot first. If the system no longer starts, restore the snapshot. On bare metal, the same mistake could leave the computer unable to start.
- WSL 2. Windows drives appear in Linux. For a lab, that closeness is a weakness; here, it is the purpose.
- Bare metal. Linux is the only system on the laptop, so no host OS is needed, and Linux gets the real hardware.
- Bare metal runs Linux on the hardware; a live session runs from a USB stick and keeps nothing by default; a full VM runs a guest OS with its own kernel; WSL 2 runs Microsoft’s Linux kernel in a managed VM on Hyper-V, beside Windows; WSL 1 has no Linux kernel.
- Compare setups by isolation, persistence, hardware access, and snapshots.
- WSL 2 is close to Windows on purpose: your Windows drives appear at
/mnt/c. A live session can open the disks inside the computer. - This course uses Ubuntu 24.04 LTS Desktop in VirtualBox 7: a full VM is isolated, has snapshots, and runs a real Ubuntu kernel and systemd.
Next, in Downloading and verifying installation media (B02.2), you download Ubuntu and check that the file is the one Ubuntu published.
Further reading
Section titled “Further reading”All sources were checked on 1 November 2026, except the Hyper-V architecture page, checked on 2 November 2026.
- Oracle VirtualBox User Guide, release 7.2: Introduction, with host, guest OS, and virtual machine; Working with virtual machines, on snapshots and restoring them; Shared Folders, which need the Guest Additions; and USB support, on passing host USB devices to a guest.
- Microsoft Learn, Windows Subsystem for Linux: What is WSL?; Comparing WSL versions, on the WSL 2 kernel, the managed Hyper-V VM, the WSL 1 translation layer, USB and serial ports, and VirtualBox; Working across file systems, on
/mnt/cand running Windows programs; How to manage WSL disk space, on theext4.vhdxfile; Basic commands for WSL, includingwsl --exportandwsl --list --verbose; and Use systemd to manage Linux services with WSL. - Microsoft Learn, Windows Server: Hyper-V architecture, on the hypervisor between the hardware and the operating systems, and Windows in the root partition.
- Ubuntu Desktop documentation: Try Ubuntu Desktop and Install Ubuntu Desktop, both for 24.04 LTS.