Published: September 23, 2025
6
32
63

Successfully able to run FreeBSD on WSL2! ๐ŸŽ‰ This is an experimental personal project with zero changes to the #FreeBSD base system. I had to make some changes to WSL2 (Open Source) to make it work. @freebsd @freebsdfndation @FreeBSDHelp #EuroBSDCon A thread on how I did it ๐Ÿงต

Firstly, this is not a sponsored project โ€” purely personal curiosity and a PoC. Not Production grade What works? โœ… #FreeBSD console works with most commands. โŒ Networking and 9P filesystem mounts are not enabled yet. Next steps: networking, then host fs mount. #FreeBSDonWSL2

Iโ€™ve been wishing for #FreeBSD on #WSL2. Once it became Open Source, spent my weekends experimenting. Found out WSL2 uses the HCS API, not Hyper-V. My first small C program confirmed FreeBSD could run inside HCS. That was a big go-ahead signal for me https://x.com/balajesankar/sta...

Couldnt setup HCN networking though. Generated the HCS Json from within Wslservice and tested it with #FreeBSD. Virtio Console was not working. So setup serial console. Then tested if FreeBSD works with hvsock - both server and client. It worked!!

Once I got the individual pieces working, I did the experimental changes to the WSL2 OSS. My approach is different from Linux's I used a full #FreeBSD VHDX instead of the kernel+init+userland method. I also wrote 2 programs, hvinit & hvbridge, to handle all the hvsock handshakes

I've pushed the WSL2 OSS related changes to GitHub. Will share the #FreeBSD side code soon. Thanks to all the brilliant minds who built both FreeBSD and WSL2 for making this possible. https://github.com/BalajeS/WSL... #FreeBSD #WSL2 #Windows #OpenSource #Tech #EuroBSDCon

Apologize code is as-is pushed with my changes. Requires clean up of everything including ReadMe.

@balajesankar @freebsd @freebsdfndation @FreeBSDHelp Nice work, gonna add that to next Valuable News :) You should change http://README.md to contain FreeBSD and not Linux information as its kinda confusing for some :)

Image in tweet by balajesankar

@vermaden @freebsd @freebsdfndation @FreeBSDHelp Sure. I will do that soon.

@balajesankar @freebsd @freebsdfndation @FreeBSDHelp Congratulations! You summoned the beastie daemon and trapped it inside a Windows environment.. :)

Share this thread

Read on Twitter

View original thread

Navigate thread

1/13