18

@JoshBent and @nikola1402 requested a tutorial for installing i3wm in a windows subsystem for linux. Here it is. I have to say though, I'm no expert in windows nor linux, and all I'm going to put here is the result of duckduck searches, reddit and documentation. As you will see, it isn't very difficult.

First things first: Install WSL. It's easy and there's a ton of good tutorials on this. I think I used this one: https://msdn.microsoft.com/en-us/...

Once you got it installed, I guess it would be better to run "sudo apt-get update" to make sure we don't encounter many problems.

Install a windows X server: X is what handles the graphical interface in linux, and it works with the client/server paradigm. So what we'll do with this is provide the linux client we want to use (in this case i3wm) with an X server for it on windows. I guess any X server will do the work, but I highly recommend vcXsrv. You can download it here:
https://sourceforge.net/projects/...

for i3 just "sudo apt-get install i3"

Configurations to make stuff work:

open your ~/.bashrc file ("nano ~/.bashrc" vim is cool too). You'll have to add the following lines to the end of it:
"""
export DISPLAY=:0.0 #This display variable points to the windows X server for our linux clients to use it.

export XDG_RUNTIME_DIR=$HOME/xdg #This is a temporary directory X will use

export RUNLEVEL=3

sudo mkdir /var/run/dbus #part of the dbus fix

sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf #part of the dbus fix
"""

Ok so after this we'll have a functional x client/server configuration. You'll just have to install your desktop enviroment of choice. I only installed i3wm, but I've seen unity and xfce working on the WSL too. There are still some files that X will miss though.

*** Here we'll add some files X would miss and :

With "nano ~/.xinitrc" edit the xinitrc to your liking. I only added this:
"""
#!/usr/bin/env bash
exec i3
"""

Then run "sudo chmod +x ~/.xinitrc" to make it an excecutable.

Then, to make a linking file named xsession, run:
"ln -s ~/.xinitrc ~/.xsession"

Now you'll be able to run whatever you put in ~/.xinirc with:
"dbus-launch --exit-with-session ~/.xsession"

There's a ton of personalisation to be done, but that would be a whole new tutorial. I'll just share a github repo with my dotfiles so you can see them here:
https://github.com/DanielVZ96/...

SHIT I ALMOST FORGOT:

Everytime you open any graphical interface you'll need to have the x server running. With vcXsrv, you can use X launch. Choose the options with no othe programs running on the X server. I recommend using "one window without title bar".

Comments
Add Comment