How I Enhance WSL for Development (Personal Approach)

Norfa Bagas
2 min readOct 23, 2019
Image taken winaero.com

Windows Subsystem for Linux (WSL) right now is taking more attention among developers, especially for those who are in love with Windows Operating System but still have a lot of job to do with Linux. One of the solution is using WSL.

WSL acts as a terminal or console that is based on Linux Operating System (ubuntu, debian, etc) that runs on Windows, and it works just like a native terminal. For me, it’s a better solution rather than installing programming language or any development tools on Windows environment (such as python terminal, git, PostgreSQL/MySQL server).

But until this blog post is published, one of the problem when using WSL is the file system. It is cannot be denied that WSL stores data in Local Disk (usually C: Drive). And one of the problem is, we need to separate our code(s) on our chosen Drive (not in Local Disk) if we need to access our code easily. Navigating WSL terminal to our chosen directory is not an effective task. So, here is a simple solution that I use to resolve it.

Using Virtual Studio Code

For me, Virtual Studio Code (VSCode) is the best solution for this problem. What we need to do is just get a fresh install of this text editor on your PC. And then add an extension called ‘Remote — WSL’ that can help us to open any folder in WSL.

Note : Don’t install anything on Windows (except WSL and VSCode)

For example, if we want to develop using PHP, we need to install LAMP Stack. First, we need to install Apache2, MySQL server, PHPMyAdmin or any database client service, and PHP language on our WSL. Usually if we work on Linux, we need to store our code(s) on /var/www/html directory.

If we work on blog project, we need to point our WSL to blog directory

cd /var/www/html/blog

then to open our VSCode on that directory, just type

code .

and it will open up our code(s) within blog/ directory.

Note : We need to notice file access permission no Linux. If you still cannot make a change on your code(s) you need to change file and directory permission especially for html/ directory.

sudo chmod –R 775 /var/www/html/

So, it’s supposed to be a simple article, thanks for reading :)

--

--

Norfa Bagas

Software engineer. I also do some research related to Computer Vision and Artificial Intelligence