Microsoft’s Windows Fall Creator Update was the end of Windows Subsystem for Linux (WSL)’s beta phase. As a full feature of Windows, I wanted to integrate it fully into my work environment. The primary objective for this task was to make a functional development environment with little need for leaving WSL. I chose Ubuntu from the Windows Store for my Linux distro.
Installing X11 Server
One of the first things I did was install an X11 server so I can use GUIs for the programs installed in WSL:
- Install vcxsrv
- Launch it from the Start menu and leave it running
Then, I had to set up WSL and Ubuntu by doing the following:
- From Windows PowerShell (Admin), I ran
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Restart your computer when it prompts you to restart
- Download Ubuntu from Windows Store
- Run it for the first time. Enter username and password
Setting Up X11 (for graphics)
As is, Ubuntu will only be able to open programs in the terminal and not as a GUI. To do that, I had to do the following steps:
echo "export DISPLAY=0:0 >> ~./bashrc
Setting Up Emacs (optional)
That is all for the basic installation of Ubuntu and WSL. These are additional steps I took to set up my personal development environment. It will install Emacs (with my .emacs.d), Git, GCC, and TexLive.
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get update
sudo apt-get install git gcc emacs texlive-full
git clone https://github.com/omn0mn0m/.emacs.d.git --recursive
I hope that this blog post will help with getting up and running with your own WSL environment. For a list of Linux packages and their compatibility with WSL, you can check out this repo.
NOTE: I was not able to get a full desktop environment working. When I figure that out, I will post it here.