Windows WSL: How to Fix Broken bashrc File

Problem:

When there’s an incorrect setup of Windows Subsystem for Linux (WSL), where $HOME/.bashrc is corrupted or having an ‘exit’ statement during its runtime, Windows cannot log into is WSL using the normal wsl command.

How To Fix:
# Execute bash using a different home directory
C:\Windows\System32\bash.exe ~ -c /bin/bash

# Edit the broken bashrc file
vim ~/.bashrc

 

Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *