The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)

Introduction

The WSL2-Linux-Kernel repo contains the kernel source code and configuration files for the WSL2 kernel.

Reporting Bugs

If you discover an issue relating to WSL or the WSL2 kernel, please report it on the WSL GitHub project. It is not possible to report issues on the WSL2-Linux-Kernel project.

If you're able to determine that the bug is present in the upstream Linux kernel, you may want to work directly with the upstream developers. Please note that there are separate processes for reporting a normal bug and a security bug.

Feature Requests

Is there a missing feature that you'd like to see? Please request it on the WSL GitHub project.

If you're able and interested in contributing kernel code for your feature request, we encourage you to submit the change upstream.

Build Instructions

Instructions for building an x86_64 WSL2 kernel with an Ubuntu distribution are as follows:

  1. Install the build dependencies:
    $ sudo apt install build-essential flex bison libssl-dev libelf-dev
  2. Build the kernel using the WSL2 kernel configuration:
    $ make KCONFIG_CONFIG=Microsoft/config-wsl

Install Instructions

Please see the documentation on the .wslconfig configuration file for information on using a custom built kernel.

Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
Comments
  • Optimized kernel config for better general kernel support and saner defaults

    Optimized kernel config for better general kernel support and saner defaults

    This configuration was originally based on Clear Linux's kernel config options toned down for general kernel usage and enabled a number of scenarios some of which that are addressed in other simpler PRs. This should make it easier to troubleshoot the Hyper-V side for bringing support to some features. USBIP has been enabled as this is a known working scenario with use of extra software installed on both Windows and WSL2. Adds ExFAT, NTFS, and IPv6 support (still needs work on the VM side). This is part of the resolution to https://github.com/microsoft/WSL2-Linux-Kernel/issues/114. attn: @craigloewen-msft and @sashalevin

    Update: Fixed OP to reflect current config changes.

  • fix tools/perf bugs: perf_env__arch return dangling pointer, normalize_arch function read out of bound, global variable multiple defined

    fix tools/perf bugs: perf_env__arch return dangling pointer, normalize_arch function read out of bound, global variable multiple defined

    fix tools/perf 3 bugs: 1 perf_env__arch return dangling pointer 2 normalize_arch function read out of bound when the arch is "i*86". 3 global variable like "the_var" defined in muliple files without "static" key word qualified, lead to linkage error.

  • Add socketcan support.

    Add socketcan support.

    This change enables the usage of the virtual vcan socketcan driver. This allows linux users to add a virtual socketcan device, and test programs which make use of socketcan in WSL2.

  • Optimized kernel config for better general kernel support and saner defaults

    Optimized kernel config for better general kernel support and saner defaults

    This configuration was originally based on Clear Linux's kernel config options toned down for general kernel usage and enabled a number of scenarios some of which that are addressed in other simpler PRs. This should make it easier to troubleshoot the Hyper-V side for bringing support to some features. USBIP has been enabled as this is a known working scenario with use of extra software installed on both Windows and WSL2. Adds ExFAT, NTFS, and IPv6 support (still needs work on the VM side). This is part of the resolution to #114. attn: @craigloewen-msft and @sashalevin. Options not supported in 5.4 should be ignored during compilation.

  • Optimized kernel config for better general kernel support and saner defaults

    Optimized kernel config for better general kernel support and saner defaults

    Enables a number of scenarios some of which are addressed in smaller PRs. USBIP has been enabled as this is a known working scenario with use of extra software installed on both Windows and WSL2. Adds ExFAT, NTFS, and IPv6 support. This should make it easier to troubleshoot the Hyper-V side for bringing support to some features. Improves the security posture and boosts performance of the kernel. Use bcc to compare the difference (Required kernel options are enabled in this PR). @craigloewen-msft and @sashalevin.

  • Microsoft: Update Linux/x86 Kernel config for 4.19.121

    Microsoft: Update Linux/x86 Kernel config for 4.19.121

    For use with the latest version, we need the updated config. This also can be used as a base to build the mainline version.

    Solve issues:

    microsoft/WSL#5366 microsoft/WSL#5481 #142

  • Add iptables conntrack extension to config-wsl

    Add iptables conntrack extension to config-wsl

    iptables conntrack doesn't work, even on the latest master branch.

    $  iptables -A PREROUTING -t raw -p tcp --dport 21 -j CT
    iptables: No chain/target/match by that name.
    

    After some intensive digging, it looks like NETFILTER_XT_TARGET_CT is not enabled. Once enabled, the above works flawlessly.

  • README.md: Add dwarves to list of build dependencies

    README.md: Add dwarves to list of build dependencies

    dwarves package provides pahole without which build fails with

    BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
    Failed to generate BTF for vmlinux
    Try to disable CONFIG_DEBUG_INFO_BTF
    
  • Not about source code ,but resource download

    Not about source code ,but resource download

    Would your ms team upgrade the wsl2 kernel download packages address which still the old version 5.4 released in april 2021. Only kernel version above 5.10.43.3 will work on nvidia cuda. https://docs.microsoft.com/en-us/windows/wsl/install-manual

    I am a wsl2 ML user just change win11 back to win10 ltsc 2022. As ms announced win10 21h2 support wsl gpu accelerated ml training , however the github release packages seem only some source code, and official download address still old one.

    After several failed attempts make the kernel myself, I finally get your official release one in windows catalog. Wish all your efforts not just hidden in corner.

  • Support for strict confinement of snaps

    Support for strict confinement of snaps

    These are proposed edits made by @diddlesnaps to enable strict confinement of snap packages on WSL2.

    Post on Snapcraft forum: https://forum.snapcraft.io/t/running-snaps-on-wsl2-insiders-only-for-now/13033

  • enable CONFIG_SECURITY_YAMA=y

    enable CONFIG_SECURITY_YAMA=y

    Ref WSL#4286. Aligns with stock Ubuntu kconfig. Brings back /proc/sys/kernel/yama/ptrace_scope which oddly enough is a WSL1 feature (ref microsoft/WSL#121).

Slackware for Windows Subsystem for Linux (WSL)
 Slackware for Windows Subsystem for Linux (WSL)

WSLackware: Slackware on Windows! Slackware for Windows Subsystem for Linux (WSL) WSLackware is an unofficial version of Slackware for Windows Subsyst

Dec 30, 2022
Minimal-ish implementation of Unreal Online Subsystem + ImGui UI

Minimal-ish implementation of Unreal Online Subsystem + ImGui UI

Mar 14, 2022
The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer
The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer

pico-probe-programmer The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-sou

Oct 15, 2022
A personal collection of Windows CVE I have turned in to exploit source, as well as a collection of payloads I've written to be used in conjunction with these exploits.

This repository contains a personal collection of Windows CVE I have turned in to exploit source, as well as a collection of payloads I've written to

Dec 28, 2022
A kernel module that patches Linux kernel "on-the-fly" to skip TASK_RSS_EVENTS_THRESH check in check_sync_rss_stat

split-rss-counting-patch A kernel module that patches Linux kernel "on-the-fly" to skip TASK_RSS_EVENTS_THRESH check in check_sync_rss_stat. Why? Read

Mar 6, 2022
GLSL optimizer based on Mesa's GLSL compiler. Used to be used in Unity for mobile shader optimization.

GLSL optimizer ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilati

Jan 3, 2023
Windows kernel information leakage POCs on Windows 10 RS1+
Windows kernel information leakage POCs on Windows 10 RS1+

This repository covers various techniques and methods I write while conducting research into infoleaks, these are for leaking various Windows kernel a

Dec 18, 2022
Implements a Windows service (in a DLL) that removes the rounded corners for windows in Windows 11

ep_dwm Implements a Windows service that removes the rounded corners for windows in Windows 11. Tested on Windows 11 build 22000.434. Pre-compiled bin

Dec 29, 2022
Historic source code for version 0.01 of the Linux kernel

Linux v0.01 Source Code (A historic repository of the first official release of the Linux Kernel) About This Repo This repo is a means of keeping and

Jun 27, 2022
Kernel source for j7y17lte - the goal is to make it as closest to linux-stable sources as possible without breaking OneUI compatibility.

Linux kernel release 3.x <http://kernel.org/> These are the release notes for Linux version 3. Read them carefully, as they tell you what this is al

Oct 28, 2021
Linux kernel source tree

Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML an

Jul 5, 2022
Linux kernel source for the Redmi Note 9(T) 5G codenamed canon(g)

Linux kernel ============ This file was moved to Documentation/admin-guide/README.rst Please notice that there are several guides for kernel develop

Dec 27, 2021
Defender-control - An open-source windows defender manager. Now you can disable windows defender permanently.
Defender-control - An open-source windows defender manager. Now you can disable windows defender permanently.

Defender Control Open source windows defender disabler. Now you can disable windows defender permanently! Tested from Windows 10 20H2. Also working on

Dec 28, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

Jan 2, 2023
A kernel module to provide /system/xbin/su to Android Kernel (especially to WSA)

WSA-Kernel-SU Intro This is a kernel module to provide /system/xbin/su to Android Kernel (especially to WSA). Only works on 4.17+ kernel. For older ke

Jan 3, 2023
NetHunter Kernel for the OnePlus 7 Series based on DragonHeart Kernel

Linux kernel ============ This file was moved to Documentation/admin-guide/README.rst Please notice that there are several guides for kernel develop

Mar 13, 2022
a unix inspired, non posix compliant micro kernel (more of a monolithic kernel for now though) that i am working on in my spare time

toy-kernel a unix inspired, non posix compliant micro kernel (more of a monolithic kernel for now though) that i am working on in my spare time prereq

Nov 27, 2022
Open source release of challenges and other code used in the Hack-A-Sat 2 Qualifier in 2021.

Hack-a-Sat 2 Qualifier This repository contains the open source release for the Hack-a-Sat 2 qualifier from 2021. Released artifacts include: Source c

Sep 18, 2022