Using WSL2 + Visual Studio Code for Jekyll blogging on Windows 10
Tags: visualstudiocode, windows10, jekyll, wsl2
Published: 2020-02-15 18:23:09

---
title: Using WSL2 + Visual Studio Code for Jekyll blogging on Windows 10
published: true
date: 2019-09-05 16:11:56 UTC
tags: visualstudiocode,windows10,jekyll,wsl2
canonical_url: https://medium.com/@hjgraca/using-wsl2-visual-studio-code-for-jekyll-blogging-on-windows-10-99489deb4650 
---

If you are like me and have your blog hosted on GitHub pages you are using Jekyll as your blog generation engine. Turns out that Jekyll does not support Windows so you have to do some hacking in order to make it work on Windows. In this post I will show you how to take advantage of [**WSL2**](https://docs.microsoft.com/en-us/windows/wsl/wsl2-about) and Ubuntu 18.04 to install Jekyll and locally run your blog.

### What is Windows Subsystem for Linux 2?

The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows.

WSL 2 is a new version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1 (the current widely available version). Individual Linux distros can be run either as a WSL 1 distro, or as a WSL 2 distro, can be upgraded or downgraded at any time, and you can run WSL 1 and WSL 2 distros side by side. WSL 2 uses an entirely new architecture that uses a real Linux kernel.

How to install WSL2 is documented [here](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install)

### Visual Studio Remote WSL

If you have VS Code already installed you will need to install the Remote WSL extension so that you are able to run linux commands and applications against your mounted Windows folder where your Jekyll blog is.

Extension is [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)

After the extension is installed you will see a small icon on the bottom left of VS Code

![](https://cdn-images-1.medium.com/max/65/1*9WQv38Ec3lCDPtacVpF22A.png)<figcaption>VS Code Remote icon</figcaption>

What I usually do is open the folder that as the blog before starting the remote session. Once I have the folder open in VS Code I click on the Remote WSL icon and are presented with the following options:

![](https://cdn-images-1.medium.com/max/1024/1*Dfah7F6wfj7jOkYNovh9_A.png)<figcaption>Remote WSL options</figcaption>

You will then choose **Remote-WSL: Reopen Folder in WSL** (if you had the folder opened). Once everything is finished the icon will change to:

![](https://cdn-images-1.medium.com/max/247/1*7woqt-9S1PTtl-NQRygCfA.png)<figcaption>Session established</figcaption>

Now open the terminal window and you will see that the context is your Ubuntu machine and the folder is a mount to your Jekyll blog folder

![](https://cdn-images-1.medium.com/max/922/1*Oru1mLVcQqsScP8u5JqbSA.png)

### Installing Jekyll in WSL Ubuntu 18.04

{% gist https://gist.github.com/hjgraca/0e1f546c079fa5a37123d189cdb934df %}

And now you can run your blog locally in Windows 10 with the power of WSL2 and Linux without having to hack your way installing Jekyll on Windows.