Turn Your Windows PC into a Linux & FreeBSD Learning Lab with WSL2 and Incus
DEV Community

Turn Your Windows PC into a Linux & FreeBSD Learning Lab with WSL2 and Incus

If you're using Windows 11 and want to learn Linux, you don't necessarily need to dual-boot your computer, install several heavyweight virtual machines, or buy another machine just for a learning lab. You can build a surprisingly capable Linux and Unix learning environment using something you may already have: A Windows PC. The idea behind this project is simple: Use Windows as the host, WSL2 as the foundation, and Incus as the laboratory. From there, you can create Linux containers, experiment with networking and services, and even run a FreeBSD virtual machine. The result is the Incus WSL Learning Laboratory - a structured, hands-on environment designed for students and beginners who want to learn Linux by actually using it. Why Build a Linux Lab on Windows? Learning Linux from a book or watching tutorials is useful, but eventually you need somewhere to experiment. You want to be able to: - create users - install packages - break configurations - configure networking - run web servers - experiment with DNS - manage services - create multiple machines - destroy them - start again Doing these experiments directly on your main computer isn't always a good idea. Dual-booting introduces another layer of complexity. Traditional virtual machines work, but managing multiple VMs can become cumbersome, especially on a modest laptop. This is where WSL2 + Incus becomes interesting. The Architecture The laboratory uses several layers: Windows 11 │ └── WSL2 │ └── Debian │ └── Incus │ ├── Linux Containers │ ├── Debian │ ├── Ubuntu │ └── Alpine │ └── Virtual Machines └── FreeBSD The important thing here is that each layer has a different purpose. Windows 11 is your everyday operating system. WSL2 provides the Linux environment running alongside Windows. Debian becomes the Linux environment where Incus is installed. Incus becomes the laboratory manager. Once Incus is running, you can create isolated Linux containers and virtual machines for your experiments. Why Incus? You may already know tools such as Docker, VirtualBox, or VMware. Incus solves a slightly different problem. It is designed to manage system containers and virtual machines. Instead of thinking only in terms of application containers, you can think in terms of small Linux systems. For example: incus launch images:debian/13 debian01 Now you have a Debian system. You can enter it: incus exec debian01 -- bash And start working with it like a small Linux machine. You can create another one: incus launch images:ubuntu/24.04 ubuntu01 And perhaps an Alpine system: incus launch images:alpine/3.22 alpine01 Now your Windows PC has several Linux environments running side by side. That's already a useful learning laboratory. From One Linux Machine to a Small Network This is where things become more interesting. Instead of learning Linux on one machine, you can create several machines and make them communicate with each other. For example: Incus │ ┌────────┼────────┐ │ │ │ Debian Ubuntu Alpine 10.10. 10.10. 10.10. 10.101 10.102 10.103 │ │ │ └────────┼────────┘ │ Network You can then start experimenting with concepts such as: - IP addressing - routing - DNS - SSH - HTTP/HTTPS - firewalls - service discovery - network troubleshooting Commands such as: ping ip ss curl dig nslookup traceroute become practical tools instead of commands you only read about. This changes the learning experience significantly. You're no longer asking: "What does DNS do?" You're asking: "Why can't this container resolve that hostname?" That's a much better question to learn from. Linux Distributions Become Your Playground One of the advantages of using Incus is that you don't have to commit to a single Linux distribution. You can have: Debian Ubuntu Alpine running simultaneously. This makes it easy to compare how different distributions approach similar tasks. For example: Debian apt install nginx Ubuntu apt install nginx Alpine apk add nginx The commands are different, the package management is different, and the base systems are different. That difference is useful. It encourages you to learn Linux concepts, rather than memorizing commands for one particular distribution. And Then There Is FreeBSD The laboratory isn't limited to Linux. One of the things I wanted to explore was FreeBSD. FreeBSD isn't Linux. It has its own kernel, userland, tooling, filesystem concepts, service management, networking tools, and system administration philosophy. That's exactly why it makes a useful addition to a Linux learning environment. With Incus virtual machines, you can create a FreeBSD VM and start exploring another Unix-like operating system: Windows 11 │ └── WSL2 │ └── Debian │ └── Incus │ ├── Debian container ├── Ubuntu container ├── Alpine container │ └── FreeBSD VM This gives students an opportunity to ask interesting questions: - How is FreeBSD different from Linux? - How does service management work? - How does networking differ? - What is a BSD jail? - How does a BSD system organize its base system? - What happens when you leave the Linux ecosystem? The goal isn't to make FreeBSD behave like Linux. The goal is to learn another Unix-like operating system on its own terms. Breaking Things Is Part of the Curriculum One of the best things about a laboratory environment is that you are allowed to make mistakes. You can experiment with things like: rm chmod chown systemctl ip iptables nft You might break a service. You might misconfigure networking. You might lock yourself out of something. That's okay. You can delete the container and create another one. incus delete debian01 Then: incus launch images:debian/13 debian01 You're back to a clean environment. This is one of the reasons I prefer learning through an isolated lab. Failure becomes part of the learning process. Snapshots: Your Save Point Incus also provides snapshots. Before making a major change, you can create a snapshot: incus snapshot create debian01 before-change After experimenting, you can restore it if necessary. Conceptually: Working system │ โ–ผ Snapshot │ โ–ผ Experiment │ ├── Works │ └── Broken │ โ–ผ Restore Think of it as a save point for your laboratory. This is particularly useful when learning system administration because you're encouraged to experiment instead of being afraid of making mistakes. What You'll Learn The laboratory is organized as a progression rather than simply being a collection of commands. Level 1 - Windows, WSL2 and Debian Start from the Windows environment. You'll learn: - Windows Terminal - WSL2 - Linux filesystem basics - Debian - shell commands - users and permissions - packages The objective is to become comfortable inside a Linux terminal. Level 2 - Introduction to Incus Once Debian becomes familiar, Incus is introduced. You'll learn: - installing Incus - creating containers - starting and stopping containers - entering containers - managing images - viewing resources - snapshots At this point, your single Linux environment becomes a small laboratory. Level 3 - Networking and Services Now the machines start communicating. You'll explore: - Incus bridges - IP addresses - DNS - SSH - HTTP - service ports - network troubleshooting For example: Incus Network │ ┌──────────┼──────────┐ │ │ │ web01 dns01 client01 │ │ │ Nginx DNS curl Instead of simply reading about networking, you can build a small network and troubleshoot it yourself. Level 4 - Programming and FreeBSD Once the basic system concepts are understood, the laboratory can become a programming environment. You can start building services with: - PHP - Laravel - Python - Go - shell scripting And then introduce FreeBSD as a separate virtual machine. This creates an interesting bridge between: Programming → Linux → Networking → Systems Level 5 - Projects The final stage is intentionally open-ended. Students can build their own projects. For example: - a small web server - a DNS server - a monitoring system - a reverse proxy - a multi-container application - a network troubleshooting lab - a basic security monitoring environment - a self-hosted service At this point, the laboratory stops being a tutorial and becomes a playground. What Makes This Different from a Typical Linux Tutorial? A lot of beginner Linux tutorials follow this pattern: Read ↓ Copy command ↓ See output ↓ Next command That can teach syntax, but it doesn't necessarily teach systems thinking. This project tries to follow a different approach: Concept ↓ Build ↓ Experiment ↓ Break ↓ Troubleshoot ↓ Understand For example, instead of simply explaining what DNS is, you can create a small environment where one machine provides DNS and another machine consumes it. Instead of explaining HTTP theoretically, you can deploy Nginx and connect to it from another container. Instead of explaining SSH, you can actually log into another machine. The computer becomes the classroom. Prerequisites You don't need an expensive server. The basic requirements are: - 64-bit Windows 11 - WSL2 support - Internet connection - Administrator access for initial setup - Approximately 20 GB of available storage More RAM and CPU will obviously make the laboratory more comfortable, especially when running several environments simultaneously. You don't need a dedicated server. You don't need dual-boot. You don't need a cloud VPS. Your existing Windows PC can become the lab. Suggested Learning Path A possible progression looks like this: | Stage | Topic | Suggested Time | |---|---|---| | 1 | Windows, WSL2 & Debian | 1-2 hours | | 2 | Linux fundamentals | 2-3 hours | | 3 | Incus & first container | 1-2 hours | | 4 | Multiple distributions | 2-3 hours | | 5 | Networking & services | 2-3 hours | | 6 | Programming laboratory | 2-3 hours | | 7 | FreeBSD introduction | 2-4 hours | | 8 | Student projects | Ongoing | These aren't strict course durations. The idea is to give learners a direction rather than a deadline. Where Can You Go After This? Once you understand the basics, the same laboratory can grow with you. Linux Administration Mo

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.