Forked from charlie-x/gist:96a92aaaa04346bdf1fb4c3621f3e392
Last active
December 28, 2022 05:11
-
-
Save aramg/baf69ce8047cf6fd82b4df12ebec5f79 to your computer and use it in GitHub Desktop.
custom wsl2 kernel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install -y autoconf bison build-essential flex libelf-dev libncurses-dev libssl-dev libtool libudev-dev | |
sudo dnf install git bc diffutils make gcc flex bison openssl-devel elfutils-libelf-devel ncurses-devel kmod unzip | |
#get kernel version | |
uname -r | |
5.10.16.3-microsoft-standard-WSL2 | |
# get matching version, this is mine | |
wget https://github.com/microsoft/WSL2-Linux-Kernel/archive/refs/tags/linux-msft-wsl-5.10.16.3.tar.gz | |
#extract it (change to your kernel version) | |
tar -xf linux-msft-wsl-5.10.16.3.tar.gz | |
cd WSL2-Linux-Kernel-linux-msft-wsl-5.10.16.3/ | |
zcat /proc/config.gz > .config | |
make prepare modules_prepare | |
make menuconfig # Enable Extra Features or Modules | |
make -j4 | |
sudo make modules_install | |
# see "modules.builtin" for the static included modules | |
# copy to windows drive | |
cp vmlinux /mnt/c/Users/user/ | |
cat > /mnt/c/Users/user/.wslconfig | |
[wsl2] | |
kernel=C:\\Users\\user\\vmlinux | |
exit | |
# exit wsl and back to windows | |
# reboot the linux subsystem | |
wsl --shutdown | |
wsl -d distro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment