Separating WSL (Linux) path and Window path

I often find myself hacking the Linux kernel for fun and profit. This time I was trying out Buildroot Embedded Linux build system and the first stumbling block using WSL was the fact that Windows path containing spaces were appended to the WSL path which the Linux file system has issues with. Running make for the Buildroot gives the error below:

Your PATH contains spaces, TABs, and/or newline (\n) characters

Follow the steps below for the solution:

  1. Create a config file for WSL interop in the WSL distro you are using. sudo nano /etc/wsl.conf
  2. Copy and paste the config below in the file:
[interop]
appendWindowsPath=false
  1. Save then restart the WSL distro in the Windows shell (not the WSL distro).
wsl -d [distribution name] --shutdown
wsl -d [distribution name]
  1. Check the path to echo $PATH to ensure all is well, only the Linux path should remain.
  2. And we are done! Finally we can build our kernel without worries.

Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.