How to Create an Embedded Linux Development Environment on Windows Using WSL2
Creating an Embedded Linux Development Environment on Windows Using WSL2
If you are learning Embedded Linux, you will frequently work with Linux commands, GCC, Makefiles, Git, C/C++, cross-compilers, Device Tree, Linux Kernel, Buildroot, debugging tools, and shell scripting.
But what if your primary computer runs Windows?
You don't necessarily need to install Linux as your main operating system or create a dual-boot setup.
A simple and powerful solution is WSL2 — Windows Subsystem for Linux 2.
In this guide, we will create a basic Ubuntu-based Embedded Linux development environment inside Windows.
1. What is WSL?
WSL (Windows Subsystem for Linux) allows you to run a Linux environment directly inside Windows.
With WSL2, you can use:
Linux terminal
Bash shell
GCC/G++
Make
Git
GDB
CMake
Python
Device Tree Compiler
Linux utilities
Cross-compilers
Buildroot
Linux Kernel build tools
without installing Linux as your primary operating system.
Windows → WSL2 → Ubuntu → Embedded Linux Development
The basic setup looks like this:
Windows
│
└── WSL2
│
└── Ubuntu
│
├── GCC
├── Git
├── GDB
├── CMake
├── Make
├── Device Tree
└── Embedded Linux Tools2. Check Whether WSL Is Installed
Open PowerShell in Windows and run:
>wsl -l -v

If you haven't installed any Linux distribution, you may see:
Windows Subsystem for Linux has no installed distributions.
You can resolve this by installing a distribution with the instructions below:
Use 'wsl.exe --list --online'This means WSL may be available, but you don't yet have a Linux distribution such as Ubuntu installed.
3. Install Ubuntu
First, you can check the available distributions:
>wsl --list --online

You should see distributions such as Ubuntu and other Linux distributions.
For a beginner-friendly Embedded Linux environment, Ubuntu is a good choice.
Install Ubuntu using:
>wsl --install -d Ubuntu

Windows will download and install Ubuntu.
After installation, Ubuntu will start automatically.
You will see something similar to:
Downloading: Ubuntu
Installing: Ubuntu
Distribution successfully installed.
Launching Ubuntu...
Provisioning the new WSL instance Ubuntu4. Create Your Linux User
During the first Ubuntu launch, you will be asked to create a Linux user.
For example:
Create a default Unix user account: Electro4u
New password:
Retype new password:
passwd: password updated successfullyThe username does not have to be the same as your Windows username.
Remember your Linux password because you will need it when using sudo.
For example:
> sudo apt updatewill ask for your Linux user's password.
5. Verify That WSL2 Is Running
Close Ubuntu if necessary and open PowerShell.
Run:
> wsl -l -vYou should see something similar to:
NAME STATE VERSION
* Ubuntu Running 2The important part is:
VERSION = 2This confirms that Ubuntu is running under WSL2.
6. Enter Ubuntu
You can start Ubuntu from Windows PowerShell using:
>wsl -d UbuntuYou should see a Linux prompt similar to:
Electro4u@computer:~$Now you are working inside Linux.
Check your current directory:
pwdExpected output:
/home/Electro4uThe ~ symbol represents your Linux user's home directory.
You can always return to your home directory using:
cd ~7. Create an Embedded Linux Workspace
It is a good practice to keep your Embedded Linux experiments organized.
Create a dedicated directory:
mkdir -p ~/embedded_linuxEnter the directory:
cd ~/embedded_linuxCheck the location:
pwdExpected:
/home/Electro4u/embedded_linuxThis directory can become your main workspace.
For example, later you can organize it like this:
embedded_linux/
│
├── c_programs/
├── cross_compile/
├── linux_kernel/
├── buildroot/
├── device_tree/
├── drivers/
├── rootfs/
├── qemu/
└── projects/8. Update Ubuntu
Before installing development tools, update the package information:
>sudo apt updateThen upgrade the installed packages:
>sudo apt upgrade -yDepending on your system, this may take some time.
9. Install Essential Development Tools
Now install the tools required for Embedded Linux development:
>sudo apt install -y build-essential git vim gdb cmake make \
python3 python3-pip wget curl unzip bc bison flex \
libssl-dev device-tree-compilerLet's understand some of these tools.
| Tool | Purpose |
|---|---|
| GCC | Compile C programs |
| G++ | Compile C++ programs |
| Make | Automate builds |
| CMake | Build system generation |
| Git | Source-code version control |
| GDB | Debugging |
| Vim | Terminal-based text editor |
| Python3 | Build scripts and automation |
| wget | Download files |
| curl | Network requests/downloads |
| unzip | Extract ZIP files |
| bison | Parser generation/build dependency |
| flex | Lexical analyzer generation |
| libssl-dev | OpenSSL development libraries |
| dtc | Device Tree Compiler |
| build-essential | Basic compilation tools |
These tools are useful when building the Linux Kernel, Buildroot, drivers, applications, and other Embedded Linux components.
10. Verify the Installation
After installation, verify the important tools.
Check GCC
gcc --versionCheck Make
make --versionCheck GDB
gdb --versionCheck Git
git --versionCheck Device Tree Compiler
dtc --versionCheck Python
python3 --versionIf these commands return version information, your basic Linux development environment is ready.
11. Test Your First C Program
Before moving into Embedded Linux, let's verify that the compiler works.
Create a C file:
cd ~/embedded_linux
vim hello.cAdd:
#include
int main(void)
{
printf("Hello Embedded Linux!\n");
return 0;
} Compile it:
gcc hello.c -o helloRun it:
./helloOutput:
Hello Embedded Linux!Congratulations!
You have successfully compiled and executed a C program inside your Linux environment.
12. Why Is WSL Useful for Embedded Linux?
Embedded Linux development involves much more than writing C code.
You may eventually work with:
C / C++
↓
Linux Commands
↓
Makefiles / CMake
↓
Cross Compilation
↓
Root Filesystem
↓
Device Tree
↓
Linux Kernel
↓
Kernel Modules
↓
Device Drivers
↓
HardwareWSL provides a convenient Linux environment where you can learn and practice many of these concepts without replacing Windows.
13. What Should You Learn Next?
Once your WSL2 + Ubuntu environment is ready, don't stop at basic Linux commands.
A good Embedded Linux learning path is:
Stage 1 — Linux Fundamentals
Learn:
Linux filesystem
cd,ls,cp,mv,rmPermissions
Users and groups
Processes
Shell scripting
Environment variables
Pipes and redirection
grep,find,awk,sed
Stage 2 — Linux Development
Learn:
GCC
Makefiles
CMake
Static and dynamic libraries
GDB
Git
Bash scripting
Stage 3 — Cross Compilation
Understand the difference between:
Native Compilationand
Cross CompilationFor example:
x86/Windows PC
↓
WSL
↓
ARM64 Cross Compiler
↓
ARM64 ExecutableThis is one of the most important concepts in Embedded Linux.
Stage 4 — QEMU
Learn how to run an ARM-based Linux system using QEMU.
A possible learning flow is:
WSL2
↓
Ubuntu
↓
ARM64 Cross Compiler
↓
C Application
↓
QEMU
↓
ARM64 LinuxStage 5 — Buildroot
Learn how to create:
Root filesystem
BusyBox
Linux Kernel
Bootloader components
Embedded Linux image
using Buildroot.
Stage 6 — Linux Kernel
Move into:
Kernel source code
Kernel configuration
Kernel compilation
Kernel modules
Kernel boot process
Device Tree
Stage 7 — Linux Device Drivers
Finally explore:
Character drivers
GPIO
I2C
SPI
UART
Interrupts
Platform drivers
Device Tree integration
14. Final Environment
After completing the initial setup, your development environment will look like:
Windows
│
└── WSL2
│
└── Ubuntu
│
├── GCC / G++
├── Make / CMake
├── Git
├── GDB
├── Python
├── Device Tree Compiler
│
└── ~/embedded_linux
│
├── C Programs
├── Cross Compiler
├── Buildroot
├── Linux Kernel
├── Device Tree
├── RootFS
├── QEMU
└── DriversTakeaway:
WSL2 is an excellent starting point for learning Embedded Linux on a Windows machine.
You don't need to immediately replace Windows with Linux. With WSL2 and Ubuntu, you can build a practical Linux development environment and gradually move from:
Linux Basics → C Development → Cross Compilation → QEMU → Buildroot → Linux Kernel → Device Tree → Drivers
The most important thing is to practice each layer rather than simply installing tools.
Start with Linux commands and C programming, then gradually move toward cross-compilation, kernel development, and device drivers.
That progression will give you a much stronger foundation for real-world Embedded Linux development.
NOTE: contact if you need any support
contact: 8374643961
mail: anvesh.godera@electro4u.net