The previous article "Install Linux on Windows 11 in 5 Minutes" covered how to install WSL2 and get it running. Once you've had it going for a while, the quirks start to show.

You delete a bunch of files inside Linux — Windows disk space doesn't move. You try to access Windows files from inside WSL2 — painfully slow. A network script that worked fine yesterday stops connecting after a wsl --shutdown.

None of this is a bug. It all comes directly from how WSL2 is designed under the hood. Once you understand the key design decisions, these problems become easy to diagnose.


What Kind of VM Is It, Exactly?

There are two types of hypervisors. Type 1 (Bare Metal) runs directly on hardware and hosts multiple operating systems — no host OS in between. Type 2 runs on top of an existing OS, like VirtualBox or VMware on your Windows desktop.

Type 1 is more efficient, suited for data center servers. Type 2 is more flexible, better for developer workstations.

So where does WSL2 fit?

At first glance, it looks like Type 2 — Linux is running inside Windows, it can't run standalone, and we're using it on a client machine. But the performance is surprisingly good, almost like running on bare metal.

The reality is it's neither. Or rather, it has the efficiency of Type 1 and the flexibility of Type 2.

WSL2 runs a real Linux kernel inside Windows.

But this "VM" isn't like VirtualBox or VMware. It's called a Utility VM, running on Microsoft's own Hyper-V Hypervisor.

A regular VM has to simulate an entire hardware stack: motherboard, BIOS, GPU drivers, storage controllers — all of it. WSL2's Utility VM skips all of that:

  • No BIOS emulation
  • No virtual hardware drivers
  • No fixed memory reservation

It only exposes what the Linux kernel actually needs: CPU time, memory pages, and I/O channels. The result is fast startup and near-zero memory use when idle.

If we had to put a label on it: Type 1.5 — Hyper-V underneath, but far lighter than a traditional VM.

One thing worth clarifying: Hyper-V actually has two layers. The first is the Hypervisor itself, loaded directly by the Windows 11 bootloader at startup — it runs below the OS at Type 1 level, and it's always on. That's the layer WSL2 uses. The second layer is the Hyper-V management services — the "Hyper-V xxx" entries you see in services.msc. Those are for Hyper-V Manager and traditional VM management. WSL2 doesn't use them at all, so it's completely normal for those services to be stopped.


From WSL1 to WSL2: Why the Design Changed

Why is WSL2 designed this way? We need to look back at the history — starting with how WSL1 worked and where it broke down.

WSL1, released in August 2016, was built around syscall translation: when you ran ls or make inside it, WSL1 intercepted those Linux kernel calls and translated them into Windows API calls in real time. Clever idea — but it fell apart under real workloads.

Problem 1: Translation itself has a cost. Every syscall — reading a file, spawning a process, checking permissions — goes through three steps: intercept, translate, execute. This isn't something that happens occasionally. A running program can trigger thousands of syscalls per second. The overhead adds up fast.

Problem 2: The file systems are fundamentally incompatible. Linux uses ext4, built around inodes. Windows uses NTFS, with a completely different permission model. WSL1 had to do real-time mapping between the two — but Linux concepts like symlinks, permission bits, and case-sensitive filenames either have no equivalent in Windows or behave differently. The translation cost was high, and the results weren't always correct.

Problem 3: Some things simply can't be translated. This was WSL1's real breaking point. Containers (Docker) depend deeply on two Linux kernel mechanisms: namespaces, which isolate what a process can see, and cgroups, which limit resource usage. These are native Linux kernel capabilities — Windows has no equivalent. There's nothing to translate to. So Docker in WSL1 never worked, period.

WSL2's solution was direct: stop translating. Put a real Linux kernel in there instead.

With that, Linux syscalls go straight into the kernel — no middle layer. The ext4 file system runs natively inside the VM with no NTFS mapping. Namespaces and cgroups actually exist, so Docker just works.

The performance gain wasn't a tweak. It was a fundamental rethink.


Your Entire Linux Lives in One File

Let's see what Linux actually looks like inside the Windows file system.

Open File Explorer and navigate to C:\Users\[username]\AppData\Local\wsl\. You'll find a subfolder with a GUID name (something like {445ca81a-6e98-4e8d-aa7b-da5591a61d49}). Inside it is a file called ext4.vhdx.

(Older versions of WSL2 used the distro name as the folder name, like Ubuntu. Newer versions switched to GUIDs.)

Linux in the Windows file system

Your entire Linux system is that one file. Every package installed, every repo cloned, every line written to a log — it's all in there.

Here's a counterintuitive trap: .vhdx is dynamically expanding, so it grows as you add data. But deleting files inside Linux does not shrink the .vhdx.

Delete 20 GB of dependencies? Windows disk usage won't budge. After a few months, the .vhdx ballooning to several hundred GB is common — even if the actual Linux content is much smaller.

The fix is Windows' built-in diskpart. Close all WSL windows, run wsl --shutdown, then:

diskpart
> select vdisk file="C:\Users\[username]\AppData\Local\wsl\{your-GUID}\ext4.vhdx"
> attach vdisk readonly
> compact vdisk
> detach vdisk
> exit

This compresses the empty space inside the virtual disk and gives it back to Windows. Anyone maintaining a WSL environment long-term should run this periodically.


Why Is Cross-System File Access So Slow?

This is WSL2's most common performance complaint: accessing Windows files from inside Linux (anything under /mnt/c/) is painfully slow. Restarting WSL or switching commands doesn't help.

What about the other direction? Opening Linux files from Windows Explorer (the penguin icon in the left sidebar) — just as slow.

Same reason: both directions go through the same channel.

WSL2 runs two completely separate file systems:

  • ext4, inside the Linux Utility VM (paths like ~/projects/)
  • NTFS, on the Windows side (accessed from Linux as /mnt/c/)

Whichever direction you're crossing, every request goes through: the Hyper-V virtualization layer → tunneled via the 9P protocol → reaches the other side → data comes all the way back. Every single file operation makes that round trip.

(9P is a network file-sharing protocol. WSL2 runs a 9P server internally — it essentially treats the other side's file system like a network share on a LAN.)

For anything that reads and writes lots of small files frequently, each operation is a 9P round trip through the virtualization layer — 10 to 50× slower is completely normal.

The rule is simple: keep files where you use them. Files you work on in WSL2 go in the Linux file system (~/). Windows projects stay in NTFS. Don't make files cross the boundary repeatedly — no configuration can work around this physical constraint.


The IP That Keeps Changing

When WSL2 starts, Windows builds a small internal virtual LAN: Linux gets a virtual network card, the Windows host gets one too, and they talk through this private network using addresses in the 172.x.x.x range.

The problem: every time WSL2 restarts via wsl --shutdown, this virtual LAN gets rebuilt and IPs are reassigned. It might be 172.28.80.1 one time, 172.19.32.1 the next.

This creates two distinct issues — worth separating:

Windows connecting to Linux services: Say you're running a web server inside Linux and want to open it in a Windows browser — don't worry about the IP. Just use localhost. Microsoft handles automatic forwarding on the Windows side. Nothing to configure here.

Linux connecting to Windows services: This direction is trickier. If a script needs to call an endpoint on the Windows host, or connect to a database running on Windows, Linux needs to know the current Windows host IP to get there.

And that IP is exactly the one that changes every restart.

The good news: every time WSL2 starts, it automatically writes the current Windows host IP into /etc/resolv.conf on the Linux side:

cat /etc/resolv.conf
# nameserver 172.28.80.1  ← this is the Windows host IP right now

Any script that needs to reach back to Windows should read this value dynamically — never hardcode a specific IP. Hardcode it, and after the next restart it silently stops working. No error, no warning — just mysterious failures that take a long time to trace.


Keeping WSL2 From Eating All Your Memory

Let's talk about resource limits. By default, WSL2 can use up to 50% of system memory and all CPU cores. On a 32 GB machine running heavy workloads, that noticeably squeezes Windows-side applications.

How do we configure it? Windows now includes a built-in GUI tool called WSL Settings — just search for it and open it. Memory limit, CPU core count, and swap size are all right there. Adjust and save.

WSL Settings

If you prefer editing manually, create or edit .wslconfig in C:\Users\[username]\:

[wsl2]
memory=8GB
processors=4
swap=2GB

Both approaches work the same way. Run wsl --shutdown after saving — changes take effect on the next start. Tune the numbers to your machine; there's no universal right answer.


Why Did Microsoft Build This?

Some people wonder — why would Microsoft go to all this trouble to run Linux inside Windows? Weren't they worried about it cutting into their business?

There's a clear business logic behind it. Three reasons, actually.

Reason 1: Win back developers. Between 2010 and 2018, a massive number of developers moved from Windows to MacBooks — because macOS natively supports Unix toolchains, while Windows developers were fighting Cygwin, path escaping, and permission incompatibilities. Microsoft saw the pattern: control the developer experience, control the ecosystem. WSL2 was the counterpunch — make Windows a platform developers actually want to use.

Reason 2: A beachhead for the cloud. Every major cloud platform runs Linux. Developers who use WSL2 locally — learning shell, apt, systemd — build skills that transfer directly to cloud environments. When they're ready to move workloads up, the path of least resistance leads straight to Azure.

Reason 3: A prerequisite for the container era. Docker and Kubernetes require a real Linux kernel. Without WSL2, Docker Desktop on Windows needed a much heavier standalone VM. WSL2 made containers feel natural on Windows — and comfortable Docker users are one step closer to Azure.

WSL2 isn't a product. It's a layer of strategic infrastructure. A company that once called Linux "a cancer" spent years building what is arguably the most polished Linux environment on any platform. Once the business logic clicks, everything makes sense.


Quick Reference: Things That'll Bite You

wsl --unregister is a hard delete. The .vhdx file disappears instantly — no confirmation, no Recycle Bin, no recovery. Always run wsl --export [distro-name] [backup.tar] before using it.

The .vhdx silently bloats. Disk space freed inside Linux doesn't return to Windows automatically. On long-running WSL machines, run diskpart compact vdisk periodically — otherwise one day you'll suddenly find the C drive full.

Where files live affects performance. Files that need frequent access inside WSL2 should live in the Linux file system (~/), not /mnt/c/. Making this clear resolves most "why is WSL2 so slow" complaints.

Kernel errors: update before reinstalling. WSL2's Linux kernel is maintained by Microsoft separately from your distro. For mysterious crashes, run wsl --update first — reinstalling the distro almost certainly won't fix a kernel-level issue.


Installing WSL2 is the first step. Understanding how it actually behaves is what makes you comfortable using it.


WSL2 底层:一个虚拟机、一个文件、一个会变的 IP

2026-02-27 by Vincent Ping cn en 

装好 WSL2 之后,用着用着就会碰到一些奇怪的问题:Linux 里删了几十 GB,Windows 磁盘纹丝不动;跨系统访问文件,速度慢得离谱;网络脚本昨天还好好的,重启 WSL 就连不上了。这些都不是 Bug,根子在 WSL2 的底层设计——一个特殊的虚拟机、一个装着整个 Linux 的文件、还有一个每次重启都会变的 IP。搞清楚这三件事,那些让人懵的问题就都说得通了。

read more

Install Linux on Windows 11 in 5 Minutes

2026-02-26 by Vincent Ping en cn 

A practical guide to building a native Linux environment on Windows 11 using WSL2, bypassing the resource overhead of traditional virtual machines. Covers enabling BIOS virtualization, one-command deployment with wsl --install, file system mapping, and a warning about the irreversible data erasure caused by --unregister.

read more

Windows 11 下 5 分钟安装 Linux

2026-02-26 by Vincent Ping cn en 

详解利用 WSL2 在 Windows 11 下构建原生 Linux 环境的实战流程,避开资源繁重的传统虚拟机。 涵盖 BIOS 虚拟化开启、wsl --install 一键部署及文件系统映射机制,并预警 --unregister 彻底抹除数据的风险。

read more

I Built a Study Tool While Preparing for CompTIA A+ — Now It's Open Source

2026-02-22 by Vincent Ping en cn 

I was studying for CompTIA A+ when I got frustrated with reviewing wrong answers in a plain document. So I built a tool — and now it's open source.

read more

备考 CompTIA A+,我用 Python 做了个错题练习工具

2026-02-22 by Vincent Ping cn en 

备考 CompTIA A+ 期间,用文档记录错题越来越不方便,于是我用 Python 做了一个交互式的错题练习工具,现已开源。

read more

龙龙读书记1:爱上植物的第一本书

2025-02-12 by Vincent Ping

天下没有不爱阅读的孩子,关键是要找到孩子的兴趣!所以对于家长来说,培养孩子的阅读习惯,从发现孩子的兴趣开始。

read more

科幻故事 | 咖啡留香:一次关于意识上传的实验记录

2024-11-05 by Vincent Ping

"意识不是被给予的,而是不断创造的。"这是李元教授生前常说的一句话。作为一名量子物理学家,他用自己最后的时光,完成了一场惊世骇俗的实验。

read more

带儿子学魔方的几点体会

2020-12-16 by Vincent Ping

从龙龙5岁就和孩子一起玩,学了忘,忘了学,前前后后好几年,值得么?

read more

Tkinter根窗口设置小技巧:程序启动最大化和程序窗口图标设置

2020-10-27 by Vincent Ping

介绍Tkinter程序根窗口的设置方法,同时介绍程序启动时窗口最大化和程序窗口图标设置的小技巧。

read more

Hello World,编写一个Tkinter程序需要哪些基本步骤?

2020-10-13 by Vincent Ping

Tkinter程序的开发工作可以分成四个步骤。

read more

孩子运动,是选篮球还是足球??

2020-08-24 by Vincent Ping

篮球和足球都是团体对抗的球类运动,训练方式也相似,对于提高身体素质,培养孩子的对抗意识和团队合作意识很有帮助。但是因为运动形式的差别,篮球更有利于身体的全面锻炼,对孩子长身高有帮助,同时也有利于脑部发育。

read more

2020年温针灸足三里筑基记录

2020-06-03 by Vincent Ping

2018年的温针灸足三里百次筑基,对我的身体有很大帮助。今年准备再次温针灸足三里,希望经过三伏天,重新百次筑基。6月1号开始第一次,特记录如下。

read more

Python自带的GUI库Tkinter是否值得学习?

2020-05-29 by Vincent Ping

Python语言可以用在很多方面,网站开发、数据分析、运营维护、游戏开发等等,那么桌面应用程序GUI呢?其实Python标准库里自带Tkinter就是干这个的。相比PyQT、wxPython等等,Tkinter有哪些优势和不足,是否值得学呢?

read more

站桩记录2:调身、调气和调心

2016-06-22 by Vincent Ping

站桩的过程实际上首先就是“调身”的过程。“下紧上松”,从双脚开始,到膝盖,再到裆部的放松。上半身则要求头部顶悬、下颌微内收;松肩沉肘,双掌环抱。

read more

站桩记录1:开始练习站桩

2016-05-22 by Vincent Ping

最近看了一些关于站桩的资料,同时也接触了一些师傅,请教了养生的问题,大家都比较推崇站桩。于是决定试试。

养生桩练 …

read more

创意与验证:如何获得好的创意?——Udacity课程《产品设计》学习笔记2

2016-05-08 by Vincent Ping

要想有一个好的创业点子,一定要对所做的事情有激情。千万不要只是为了创业而去创业。我们之所以要创业,是因为要解决一个问题,一个会让我们日夜寻思的问题。

read more

Breeze,让无车者也能成为Uber/Lyft司机

2016-04-28 by Vincent Ping

对于Uber和Lyft这样的打车平台来说,随着对出行市场的占有率越来越高,他们面对的问题和别的行业有所不同。对于他们来说,获取用户非常简单,甚至太简单了,导致现在他们常常面临的问题是:用户太多,而司机太少。

read more

创业者应该具有怎样的素质?——Udacity课程《产品设计》学习笔记1

2016-04-20 by Vincent Ping

企业家是否能够培养?这本身就是一个问题。一个企业家所扮演的角色非常广泛,除了企业内的经营管理工作,还有很多企业外的作用,所以要找到一个简单的成功公式非常困难。

read more

Instacart创业者早期的故事

2016-04-16 by Vincent Ping

故事从2010年1月说起,80后的Apoorva Mehta在亚马逊已经工作了2年,作为一个开发工程师,他在亚马逊学到了很多,但同时也开始对公司里缓慢官僚的气氛有些感到厌倦,他希望有所改变。

read more

美式音标练习笔记——“李阳疯狂英语手势突破发音”

2015-12-28 by Vincent Ping

本文是我为了练习美式英语而学习美式音标的笔记,采用了“李阳疯狂英语手势突破发音”教程。

read more

如何去除Joomla 3网站静态化URL地址中的分类ID和文章ID

2015-10-01 by Vincent Ping

Joomla是一个非常专业的网站内容管理系统(CMS),但是其在SEO搜索引擎优化后的URL模式上有一些不足。这里记录了我的一些改进方法。

read more

Remove Category and Article ID from URL in Joomla 3

2015-10-01 by Vincent Ping

Joomla is a very professional content management system (CMS), but there're some minor shortcoming within the SEO URL Mapping.

read more

深深网络深似海----搜索引擎之外的网络世界

2003-11-10 by Vincent Ping

互联网是一个信息的海洋,那么搜索引擎抓取只是这个海洋的表面,而在信息海洋的深处,存在巨大数量的内容,搜索引擎无法启及,这些内容叫着“DEEP WEB”,或者“INVISIBLE WEB”。

read more

robots.txt和Robots META标签

2003-10-18 by Vincent Ping

对于网站管理者和内容提供者来说,有时候会有一些站点内容,不希望被ROBOTS抓取而公开。为了解决这个问题,ROBOTS开发界提供了两个办法:一个是robots.txt,另一个是The Robots META标签。

read more

RSS及其发展历程简介

2003-10-10 by Vincent Ping

RSS是一种描述和同步网站内容的格式,是目前使用最广泛的XML应用。RSS应用在国外已经非常普遍,从个人博客(Blog)栏目、企业站点到世界级的门户都提供基于RSS的服务。

read more

动态网站的搜索引擎策略

2003-09-08 by Vincent Ping

动态网站提高了网站与用户的交互,方便网站的维护和管理。但是如何提高动态网站在搜索引擎中的排名呢?

read more

网络推广新潮流——发行免费电子图书

2002-11-04 by Vincent Ping

使用免费电子图书进行营销就像共享软件一样,非常流行。它真正体现了为访问者着想,同时用户也可以收藏,以备进一步的阅读参考。每一本电子书一旦放到网上,就如同有了自己的生命,到处传播,不需要我们再去费心,同时电子书籍又可以保证内容的完整。

read more

如何迅速增加电子杂志的订户数

2001-02-01 by Vincent Ping

当我们建立起一份电子杂志后,除了系统的管理、内容的准备等等外,最终也会面对临一个推广的问题:怎么样能迅速扩大自己的知名度,增加杂志的订户数呢?

read more

自动回复机----电子邮件营销中的另一种秘密武器

2001-01-26 by Vincent Ping

小小的电子邮件,有这么多的应用方法,而且还在不断诞生着一些极具创造性的新应用。这里想给大家介绍的是电子邮件营销中的另一个秘密武器:自动回复机(AutoResponder)

read more

开始建立你的邮件列表

2000-05-12 by Vincent Ping

邮件列表是保持与客户沟通的一种很好的工具。

read more

网上淘金——新世纪的八条网络解决之道

2000-02-01 by Vincent Ping

互联网究竟能不能赚钱,除了依赖那些风险基金、为上市奋斗外,我们是否还有其他方式生存和发展呢?

read more

网页中META标签的使用

2000-01-04 by Vincent Ping

网页中使用META值,以便搜索引擎能知道网页的内容。

read more

让用户知道你——建设企业网站之推广篇

1999-10-07 by Vincent Ping

初步完成一个站点的设计建设,只是企业网站经营的开始。为了真正发挥一个站点的作用,我们要以该站点为基础,在网上网下开展长期而有效的推广工作。

read more

组织网站内容——建设企业网站之建设篇

1999-09-27 by Vincent Ping

在做完“企业网站定位”工作、确定了网站“为什么做”和“为谁而做”,接下来就需要根据目标访问者的潜在需求确定网站的内容。

read more

为什么做与为谁而做——建设企业网站之定位篇

1999-09-23 by Vincent Ping

建设一个企业网站,首先需要做的应该是确定建站的目的,也就是确定为什么做和为谁而做的问题。

read more

提高在搜索引擎中的排名

1999-09-09 by Vincent Ping

提高网站在搜索引擎中的排名,相关的几个问题

read more

企业网站的4种模型

1999-09-02 by Vincent Ping

互联网上每个站点都有其商务模式,虽然这些模式是千差万别的,但实际上都可以归结到4种典型的商务模式上来,这些模式构成了网站的基础结构。

read more

注册搜索引擎问与答

1999-08-26 by Vincent Ping

注册搜索引擎过程中一些常见问题及其解答。

read more

未来五个热门的互联网方向

1999-08-19 by Vincent Ping

很多朋友都希望能在网上创立自己的事业,但如何选择自己的方向呢?下面是我的五条建议。

read more

了解搜索引擎

1999-06-10 by Vincent Ping

在所有网络推广的方法中,搜索引擎是大家谈论最多的,我们的推广之旅也将从这里开始。

read more