Enabling the Debug Console for WSL2 (Windows Subsystem for Linux)


The “Enable debug console” option in Windows Subsystem for Linux (WSL) settings allows you to access detailed debugging information directly from the WSL environment. This feature is helpful for troubleshooting issues with WSL processes, providing insights into system calls, kernel interactions, and performance bottlenecks. Especially it is very useful in debugging when your WSL env fails to start.

wsl-debug-console Enabling the Debug Console for WSL2 (Windows Subsystem for Linux) debug windows

WSL Debug Console

Enable Debug Console in WSL

To enable the debug console in WSL, follow these steps:

Open PowerShell or Windows Terminal with Administrator privileges.

Run the command:

1
wsl --update
wsl --update

to ensure you have the latest WSL version.

Enable the debug console by updating the WSL configuration file:

Open the wsl.conf file located at /etc/wsl.conf within your WSL distribution.

Add the following configuration:

[wsl2]
debugConsole=true

Save the file and restart WSL:

1
2
wsl --shutdown
wsl
wsl --shutdown
wsl

Once enabled, the debug console can provide detailed logs and system diagnostics to help resolve issues or optimize your WSL environment.

Another way to enable the WSL debug console is through the graphical user interface (GUI) of the Windows Subsystem for Linux settings. Here’s how to do it:

Open the WSL Settings:
Press Windows + I to open Settings.
Navigate to System, For developers.

wsl-settings-from-start Enabling the Debug Console for WSL2 (Windows Subsystem for Linux) debug windows

WSL Settings

Access the WSL Settings:
Scroll down to the “Windows Subsystem for Linux” section.
Click on “Manage settings” under WSL options.

Enable Debug Console:
In the WSL settings window, toggle the “Enable Debug Console” option to On.

wsl-enable-debug-console Enabling the Debug Console for WSL2 (Windows Subsystem for Linux) debug windows

Enable Debug Console for WSL

Restart WSL:
After enabling it, restart WSL either by running wsl –shutdown in the terminal or by restarting your computer.
This method is simpler and doesn’t require manually editing configuration files, making it user-friendly for those who prefer a GUI approach.

Windows Tools/Tips

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
492 words
Last Post: Teaching Kids Programming - Find if Digit Game Can Be Won
Next Post: Draw a Pumpkin using Matlab

The Permanent URL is: Enabling the Debug Console for WSL2 (Windows Subsystem for Linux)

Leave a Reply