How to Create an Embedded Linux Development Environment on Windows Using WSL2

05 Sep 2026 Anvesh G 0 Linux

 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 Tools

2. 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 Ubuntu

4. 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 successfully

The 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 update

will ask for your Linux user's password.


5. Verify That WSL2 Is Running

Close Ubuntu if necessary and open PowerShell.

Run:

> wsl -l -v

You should see something similar to:

NAME      STATE      VERSION
* Ubuntu  Running    2

The important part is:

VERSION = 2

This confirms that Ubuntu is running under WSL2.


6. Enter Ubuntu

You can start Ubuntu from Windows PowerShell using:

>wsl -d Ubuntu

You should see a Linux prompt similar to:

Electro4u@computer:~$

Now you are working inside Linux.

Check your current directory:

pwd

Expected output:

/home/Electro4u

The ~ 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_linux

Enter the directory:

cd ~/embedded_linux

Check the location:

pwd

Expected:

/home/Electro4u/embedded_linux

This 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 update

Then upgrade the installed packages:

>sudo apt upgrade -y

Depending 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-compiler

Let's understand some of these tools.

ToolPurpose
GCCCompile C programs
G++Compile C++ programs
MakeAutomate builds
CMakeBuild system generation
GitSource-code version control
GDBDebugging
VimTerminal-based text editor
Python3Build scripts and automation
wgetDownload files
curlNetwork requests/downloads
unzipExtract ZIP files
bisonParser generation/build dependency
flexLexical analyzer generation
libssl-devOpenSSL development libraries
dtcDevice Tree Compiler
build-essentialBasic 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 --version

Check Make

make --version

Check GDB

gdb --version

Check Git

git --version

Check Device Tree Compiler

dtc --version

Check Python

python3 --version

If 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.c

Add:

#include 

int main(void)
{
    printf("Hello Embedded Linux!\n");
    return 0;
}

Compile it:

gcc hello.c -o hello

Run it:

./hello

Output:

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
   ↓
Hardware

WSL 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, rm

  • Permissions

  • 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 Compilation

and

Cross Compilation

For example:

x86/Windows PC
       ↓
      WSL
       ↓
ARM64 Cross Compiler
       ↓
ARM64 Executable

This 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 Linux

Stage 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
                    └── Drivers

Takeaway:

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


Author
BY: Anvesh G

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.