Skip to content

Custom-Kernel-Compiler-For-WSL2 compiles custom Linux kernels for Windows Subsystem for Linux (WSL). It optimizes WSL with custom kernels, featuring automated build scripts, kernel version compatibility, and seamless WSL2 integration. Ideal for developers seeking enhanced performance and customization.

Notifications You must be signed in to change notification settings

Yaliance/Custom-Kernel-Compiler-For-WSL2-Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WSLCustomKernelCompiler

English Instructions

An Automation bash script to compile custom kernels for WSL

The script walks you though the process of compiling a custom kernel for WSL. It installs all dependencies. Clones the official WSLKernel repository. Brings up the customization menu for the WSL Kernel. Compiles the Kernel modules Copies the Kernel and .wslconf file to your windows folder so it is ready to be used

Usage

clone the repository using git clone https://github.com/Yaliance/WSLCustomKernelCompiler.git then just follow this simple commands

cd WSLCustomKernelCompiler/

Currently the script needs to be converted to unix format since it was uploaded using Windows, for that use the following command:

sudo dos2unix CustomKernel.sh

then just run it using:

sudo bash CustomKernel.sh

the script will ask you for your windows user name so it can copy the files to the right folder. you can get the windows user name by opening cmd and using the command

echo %USERNAME%

now we need to shutdown the WSL instance to avoid any file corruption. For that just execute the following command on cmd:

wsl.exe --shutdown

To start using your new kernel you will just have to copy both files (bzImage & .wslconfig) to the root of the Windows user folder (C:/Users/yourusername/).

By default the file bzImage (kernel) will be copied to a folder called "CustomKernel" inside your Windows user folder (C:/Users/yourusername/) along with the .wslconfig file.

After moving both files to your user folder and starting WSL again it will boot using your custom kernel, it may take a little longer to start for the first time with the new kernel so just be aware.

Enjoy!

Use

The main usage I gave to compiling a custom kernel is for me to be able to compile drivers using make and load them using modprobe so i can use wifi cards over USBIP. Compiling your custom kernel for WSL will allow you to do many more things but that depends on your needs.

Instrucciones en Español

Un Script de automatizacion para la creacion de Kernels para WSL personalizados

El script te guía a través del proceso de compilación de un kernel personalizado para WSL. Instala todas las dependencias. Clona el repositorio oficial de Kernel para WSL. Muestra el menú de personalización del kernel de WSL. Compila los módulos del Kernel. Copia el Kernel y el archivo .wslconf a tu carpeta de Windows para que esté listo para usarse.

#Uso Clonar el repositorio usando git clone https://github.com/Yaliance/WSLCustomKernelCompiler.git Luego simplemente hay que seguir los commandos

cd WSLCustomKernelCompiler/

Por el momento se debe convertir el script al formato unix ya que fue subido usando Windows. Puedes convertirlo usando el siguiente comando:

sudo dos2unix CustomKernelSpanish.sh

Luego solo ejecutar usando:

sudo bash CustomKernelSpanish.sh

el script te pedirá tu nombre de usuario de Windows para poder copiar los archivos en la carpeta correcta. puedes obtener el nombre de usuario de Windows abriendo cmd y usando el comando

echo %USERNAME%

Y ahora hay que apagar la instancia de WSL para evitar corrupcion. puedes hacerlo ejecutando el siguiente comando en cmd:

wsl.exe --shutdown

Para comenzar a utilizar tu nuevo kernel sera necesario copiar los dos archivos (bzImage & .wslconfig) a la carpeta raiz de usuario en windows(C:/Usuarios/tu-nombre-de-usuario/)

Por defecto el archivo bzImage(kernel) sera copiado a la carpeta "CustomKernel" dentro de la carpeta raiz de usuario en windows (C:/Usuarios/tu-nombre-de-usuario/) junto con un archive .wslconfig

Despues de haber copiado ambos archivos solo falta iniciar WSL denuevo y esta vez iniciara usando tu nuevo kernel personalizado, considera que puede que tome un poco mas de tiempo en iniciar la primera vez usando el nuevo kernel.

Que lo disfrutes!

#Proposito El uso principal que le di a la compilación de un kernel personalizado es poder compilar controladores usando make y cargarlos usando modprobe para poder usar tarjetas wifi a través de USBIP. Compilar tu kernel personalizado para WSL te permitirá hacer muchas más cosas, pero eso depende de tus necesidades.

About

Custom-Kernel-Compiler-For-WSL2 compiles custom Linux kernels for Windows Subsystem for Linux (WSL). It optimizes WSL with custom kernels, featuring automated build scripts, kernel version compatibility, and seamless WSL2 integration. Ideal for developers seeking enhanced performance and customization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages