Microsoft disables the NTFS functionality on purpose on their WSL Kernel releases. This is my custom kernel where I only enable NTFS functionality and touch nothing else. Made for people who want to mount NTFS formatted devices in their WSL Container/Distro without the extra steps needed to compile their own kernels. Also solves issues like: missing NTFS3 kernel modules, etc
- If you launched your WSL distro(s) or instance(s), shut them down (all at once) by entering
wsl --shutdown
in PowerShell. If you want to shut down a specific Distro do that by enteringwsl -t DISTRO-NAME
. Get the distro names withwsl --list --verbose
. - Download my latest kernel from the releases, or compile it yourself.
- Put the file wherever you want on your Windows Host (the file has to stay there as long as you use that kernel, without the file in place your WSL2 distros won't launch).
- Create a file called
.wslconfig
in your user home directory (generallyC:\Users\<username>
or aka%HOMEDRIVE%\%HOMEPATH%
, in a simpler form%UserProfile%
) with the following contents, my kernel file name is 'vmlinux' and I placed it inC:\Users\<myuser>
(the default kernel filename is 'vmlinux' if you don't change it, also the double backslashes are for escaping characters, so they are needed):
[wsl2]
kernel=C:\\Users\\main\\vmlinux
- Launch your (default) distro with the new kernel by typing
wsl
or a specific one withwsl -d DISTRO-NAME
.
NOTE: You can use a barebone Linux Install or a Virtual Machine for the building process. You can do it on WSL too, but you have to make sure not to do it under your Windows Hosts filesystem (so don't clone the repo inside /mnt/c
or a subfolder of that, the same when compiling too. Use a folder like ~/tmp
for the cloning and compilation). Else you'll get errors because of filesystem case-sensivity conflicts. The easiest workaround is this. You can also configure case-sensivity on a folder basis on Windows, which would be another way (which I never tested).
- Install dependencies:
- Ubuntu/Debian Based Distros:
apt install -y build-essential flex bison dwarves libssl-dev libelf-dev
- Arch Based Distros:
pacman -S base-devel bc python pahole
- Alpine:
apk add make gcc libc-dev flex bison linux-headers libressl-dev elfutils-dev python3 perl pahole
- Fedora:
dnf install make gcc flex bison openssl openssl-devel bc elfutils-devel diffutils dwarves
- Ubuntu/Debian Based Distros:
- Clone the repo
git clone https://github.com/bioluks/WSL2-Linux-Kernel-NTFS.git
- In the directory, do
make KCONFIG_CONFIG=./.config