I'm moving to a Mac, so I made myself a WSL for it
DEV Community

I'm moving to a Mac, so I made myself a WSL for it

MSL stands for Mac Subsystem for Linux. Yes, it's a play on the WSL name. That's it. I wish I were kidding.

I made it for one single reason. My Surface Laptop 3 is starting to show its age, and I'm planning to move to a MacBook Air in a few months. The one thing I really didn't want to give up was WSL. Ubuntu running on a Mac, with the Linux build of Chromium open as a normal Mac window.

"Just use Docker" I know. Docker, OrbStack, VirtualBox: there are already plenty of ways to run Linux on a Mac. Docker is pretty much the standard, and it's a hugely powerful tool built by people with a clear goal. I just wanted to go my own way. I'm too used to WSL.

What I wanted was the WSL feeling:

  • a Linux shell right in my normal terminal,
  • fast to start,
  • something I can call from the terminal or from a script, and it just happens.

That's the whole goal of MSL. Honestly, it's a glorified, slightly sucky virtual machine with a lot of UI and UX integration put on top.

The shell is the main thing

Open any terminal on your Mac and type msl <instance>. You get a Linux shell right there, with no clunky VM window. From fully powered off it takes about 6 seconds, and once the instance is running it's basically instant. A real kernel and a real arm64 userland. Nothing's emulated.

msl # lists every distro you can download
msl install debian # downloads it, then asks for a name, CPUs, memory and disk
msl debian # first start asks you to create your Linux account

From then on, msl debian drops you straight into your shell, signed in as your own user. Your Mac's home folder is already in there at /mnt/mac. It works in scripts, from Terminal.app, from whatever terminal you like, and over SSH if you want it (MSL sets up ssh msl-<name> for you, so scp and VS Code Remote-SSH just work).

Under the hood, every instance is a lightweight VM on Apple's Virtualization framework, the same idea as WSL 2. It isn't really a "subsystem": nothing is woven into macOS and there's no kernel extension. I just liked the name.

There are twelve distros ready to download, from Alpine to Nix. Every download is checked against its published checksum before it's used. You can also build your own image from any arm64 container.

You can have up to eight named instances, with four running at once. Each one gets its own CPUs, memory and disk, and its disk only takes up the space Linux actually writes. Leave an instance alone and it suspends itself so it stops burning CPU. Close the lid and MSL freezes your instances before the Mac sleeps.

Your files, both ways

WSL lets Windows and Linux see each other's files, and I wanted that too. Your Mac home folder shows up inside Linux. In the other direction, Linux shows up on the Mac in MSL Files.

A running instance does technically appear in Finder, but as a network volume called 127.0.0.1, with nothing telling you which instance it is. So I wrote MSL Files instead. It looks like Finder. It isn't Finder. (β—žβ€Έβ—Ÿ)

A Linux filesystem with its real permissions and symlinks, right under your Mac folders. Your Mac folders sit in the sidebar right above every running instance, so getting a file from Downloads into Linux takes one drag. It also has git integration, because Finder workflow go brr >:3

mslgd, because WSL has WSLg

This one exists only because I thought, "WSL has WSLg, so MSL should have something similar." It's arguably where most of my effort went, and it's a weird little side project.

mslgd is an X server that draws Linux windows as real Mac windows (NSWindows). With XQuartz, every Linux app lives under one XQuartz icon. With mslgd, each Linux app gets its own window and its own icon in the Dock and in ⌘-Tab, like any other Mac app. Type gimp and GIMP just opens.

MSL finds the GUI apps in an instance. You can add any of them to your Applications folder or pin it to the Dock. GTK and Qt apps run: GIMP, Krita, LibreOffice, Chromium, and of course xeyes. OpenGL, EGL and libGL support is still a work in progress, though it kind of works. The whole GUI side is labelled experimental, and I mean it.

The submodules nobody asked for

Most of these exist because I personally needed them:

  • Camera and mic passthrough. My ROS2 project uses a camera, which is honestly why I even thought of this.
  • Basic USB passthrough. I don't have Apple entitlements, but if macOS has no driver for some absolutely cursed piece of hardware, you can hand it to Linux.
  • MSLPS (Peripheral Subsystem), for HID-like devices.
  • PublicMSL, to easily configure an instance so it's reachable from the internet.
  • MSLAP (Admin Portal), to limit MSL features on managed Macs.
  • MSL Shipments. A low-effort way to turn an instance into one small file you can share. Think of it as a shoddy, primitive, but easy version of what Docker does lol.

There's also a Sandbox that can cut an instance off from the network, your Mac files, graphics or input, plus a live traffic monitor showing what the host and guest are actually saying to each other.

The catches

  • Apple silicon only, on macOS 14 Sonoma or later. Apple's VM framework on Intel is hellishly limited, and there's no emulation, so Intel Macs can't run MSL at all.
  • The installer isn't notarized, because I don't have a paid Apple developer account (I'm broke). The first time you open the .pkg, macOS blocks it. Go to System Settings β–Έ Privacy & Security and click Open Anyway. I know how that sounds. All the source is there if you'd rather build it yourself than trust the package.
  • It's one person's project. Shells, instances, snapshots, files and the sandbox are solid. The GUI apps and anything behind the Experimental Features window are experiments, not promises.

Try it, or just poke around MilkmanAbi / MSL

MSL; WSL feel for macOS. Integration as a priority, seamlessness as a philosophy

MSL Mac Subsystem for Linux Real Linux on your Mac. A shell in about a second, your files on both sides, and Linux apps that open as Mac windows with Dock tiles of their own Getting started Β· MSL Files Β· mslgd Β· The guide Β· The MSL family

MSL runs real Linux distributions on your Mac - an actual kernel, an actual userland, on Apple's own Virtualization framework. Nothing's emulated, and there's no VM window to babysit. Type msl and you're in. Your home folder's already there. Linux apps show up in the Dock, in Spotlight, in ⌘-Tab, like they always lived there.

It's been over a year getting here, and most of that time was spent on problems I didn't know existed until I hit them. It's free, open source, and still held together by a fair amount of stubbornness. No like genuinely, around 4 months in planning… View on GitHub

The docs are a 121-article guide that also ships inside the app. You can read them on the MSL Wiki before installing anything (no domain, it's just GitHub Pages). The little knight on there was drawn by neekocat_2025.

mslgd is GPLv3 and everything else is MIT. Bug reports, ideas and PRs are all welcome. And if you like it, a 🌟 makes me feel fuzzy and nice inside. Kind of like a cow. A cow with super APT powers.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.