DEV Community

Dendi Handian
Dendi Handian

Posted on • Edited on

37

Debian in WSL

This post is my journal on trying debian in WSL and playing around with it as starter.

Requirements

  • Having WSL (WSL2) activated

Installing Debian WSL

Open Microsoft Store and search for Debian. Get to install and Open after it installed.

debian wsl microsoft store

It will launch debian program window. Fill the new user and password to use it.

debian wsl first initiation

Download Package Information



sudo apt-get update


Enter fullscreen mode Exit fullscreen mode

debian wsl apt-get update

Checking Debian Version



sudo apt-get install lsb-release


Enter fullscreen mode Exit fullscreen mode


lsb_release -a


Enter fullscreen mode Exit fullscreen mode

checking debian version

Simple Python Server Test in Debian WSL

Installing Python



sudo apt-get install python3


Enter fullscreen mode Exit fullscreen mode

debian wsl installing python

Verifying Python Installation



python3 --version


Enter fullscreen mode Exit fullscreen mode

debian wsl python installation check

Starting a Simple Webserver

Here is the command to start a simple web server in python



python3 -m http.server 8000


Enter fullscreen mode Exit fullscreen mode

python simple web server command

Open the http://localhost:8000 in your browser to confirm if it accessible.

python simple web server UI

Installing Pip (For Further Python Development)



sudo apt-get install python3-pip


Enter fullscreen mode Exit fullscreen mode

debian wsl installing python3-pip

Browse Files in Visual Studio Code

Install the WSL extension

VSCODE WSL extension

After it installed, you can click the arrow-like icon at bottom-left of VSCode

VSCODE SSH icon

And it will open the menu for SSH connections, pick the Connect to WSL using Distro and choose Debian

VSCODE SSH Menu

It will open a new VS Code window and wait a while for the server connection and then you can browse and manage the files inside the WSL Debian through VS Code.

You can close the connection to the WSL later by clicking the same arrow-like icon and choose close connection.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay