{"id":20246991,"url":"https://github.com/oleksis/wsl2-linux-kernel-config","last_synced_at":"2025-07-03T08:07:40.380Z","repository":{"id":37741522,"uuid":"435059732","full_name":"oleksis/wsl2-linux-kernel-config","owner":"oleksis","description":"Custom Linux/x86 Kernel Configuration","archived":false,"fork":false,"pushed_at":"2023-05-05T15:28:39.000Z","size":2889,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:38:13.329Z","etag":null,"topics":["linux-kernel","wsl2"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleksis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-05T02:58:23.000Z","updated_at":"2025-02-27T23:40:11.000Z","dependencies_parsed_at":"2024-11-14T09:45:05.859Z","dependency_job_id":null,"html_url":"https://github.com/oleksis/wsl2-linux-kernel-config","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/oleksis/wsl2-linux-kernel-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleksis%2Fwsl2-linux-kernel-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleksis%2Fwsl2-linux-kernel-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleksis%2Fwsl2-linux-kernel-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleksis%2Fwsl2-linux-kernel-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleksis","download_url":"https://codeload.github.com/oleksis/wsl2-linux-kernel-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleksis%2Fwsl2-linux-kernel-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263287864,"owners_count":23443084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux-kernel","wsl2"],"created_at":"2024-11-14T09:34:43.166Z","updated_at":"2025-07-03T08:07:40.352Z","avatar_url":"https://github.com/oleksis.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Linux/x86 Kernel Configuration\nMerge the last [linux kernel configuration from Microsoft for Windows Subsystem for Linux 2](https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-6.1.y/Microsoft/config-wsl) with the [upstream torvalds linux sources](https://github.com/torvalds/linux/)\n\n## Compile Mainline Kernel for WSL2\nSteps for compile [Kernel Linux 6.1.y](https://github.com/microsoft/WSL2-Linux-Kernel/tree/linux-msft-wsl-6.1.y).\nCan use the script `build.sh` to automate the download, configuration, and compilation of the kernel source code for WSL2\n\n## Video Youtube\n[![Compile Linux Kernel in Windows Subsystem for Linux 2](https://img.youtube.com/vi/4QSsyZsQMqE/mqdefault.jpg)](https://youtu.be/4QSsyZsQMqE)\n\n\n## Actual Kernel\n```bash\nuname -a\nLinux DESKTOP-ID 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 GNU/Linux\n```\n\n## Work dir linux\n```bash\nmkdir -p linux\ncd linux\n```\n\n## Install requirements for Build\n```bash\nsudo apt install git bc build-essential flex bison libssl-dev libelf-dev dwarves\n```\n\n## Download Linux source code\n```bash\nwget https://github.com/torvalds/linux/archive/refs/tags/v5.15.tar.gz -O v5.15.tar.gz\n```\n\n## Untar linux sources\n```bash\ntar -xf v5.15.tar.gz\n```\n\n## Download config WSL\n```bash\nwget https://github.com/microsoft/WSL2-Linux-Kernel/raw/linux-msft-wsl-5.10.y/Microsoft/config-wsl\n```\n\n## Copy config WSL as default config to the linux config dir\n```bash\ncp config-wsl linux-5.15/arch/x86/configs/wsl_defconfig\n```\n\n## Generate the Configuration and Build\n```bash\ncd linux-5.15\nmake KCONFIG_CONFIG=arch/x86/configs/wsl_defconfig -j4\n```\n\n## Copy Linux kernel to YOUR_USER\n```bash\npowershell.exe /C 'Copy-Item .\\arch\\x86\\boot\\bzImage $env:USERPROFILE'\n```\n\n## Point to your custom kernel in .wslconfig:\n```bash\npowershell.exe /C 'Write-Output [wsl2]`nkernel=$env:USERPROFILE\\bzImage | % {$_.replace(\"\\\",\"\\\\\")} | Out-File $env:USERPROFILE\\.wslconfig -encoding ASCII'\n```\n\n```\n[wsl2]\nkernel=C:\\\\Users\\\\\u003cYOUR_USER\u003e\\\\bzImage\n```\n\n## Shutdown WSL\n```bash\nwsl --shutdown\n```\n\n## Check shutdown the distro WSL\n```bash\nwsl -l -v\n```\n\n## Start distro\n```bash\nwsl -d Debian\n```\n\n## New Kernel Linux\n```bash\nuname -a\n```\n\n```\nLinux HP450-2 5.15.0-oleksis-microsoft-standard-WSL2 #1 SMP Mon Nov 29 01:14:26 EST 2021 x86_64 x86_64 x86_64 GNU/Linux\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleksis%2Fwsl2-linux-kernel-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleksis%2Fwsl2-linux-kernel-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleksis%2Fwsl2-linux-kernel-config/lists"}