# Building a Linux Open-Source GIS Development Environment with Windows

Using:

• Windows Subsystem for Linux Version 2
• Windows Powershell

Included:

• Node.js Dev Environment
• PostgreSQL/PostGIS
• PG_TileServ
• PG_FeatureServ
• Jupyter Notebook
• VSCode

## Part 1: Windows Subsystem for Linux

### What is WSL?

The Windows Subsustem for Linux (WSL) allows you to run Linux on Windows without the overhead of a VM or (shutter) dual boot. Learn all about it here: https://docs.microsoft.com/en-us/windows/wsl/about

I originally started writing this about how to use VirtualBox to run Debian on your machine, but if your system can support WSL, it is much easier to deal with, and doesn’t destroy your battery life.

### How do I get it?

The guide can be found here: https://docs.microsoft.com/en-us/windows/wsl/install-win10

I’m going to walk through the manual install because it’s really not too many steps, and it gives you an idea about what it’s doing.

### System Requirements

(Copypasta’ed from the Microsoft website)

To install WSL 2, you must be running Windows 10.

• For x64 systems: Version 1903 or higher, with Build 18362 or higher.
• For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
• Builds lower than 18362 do not support WSL 2. Use the Windows Update Assistant to update your version of Windows.

To check your version and build number, select Windows logo key + R, type winver, select OK.

### Security Note

All the commands I have here are copied directly from Microsoft.com and I trust them. Make sure to verify any command before running them on your machine!

These commands require the use of Deployment Image Servicing and Management (DISM.exe) [which] is a command-line tool that can be used to service and prepare Windows images.

## Begin the Install!

1. Open Windows Power Shell as Administrator
2. Enable the Windows Subsystem for Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

3. Enable the Virtual Machine feature thats required for WSL2
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

4. Reboot your machine! We have been using commands that end in /norestart to prevent dism.exe from rebooting the machine, but eventually we actually need to reboot it.
6. https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
7. Run the Linux Kernel Update package
8. Find the msi file that you downloaded, and open it
9. If you see a window with this messaage: This update only applies to machines with the Windows Subsystem for Linux, you will need to Follow the directions here: https://github.com/microsoft/WSL/issues/5035#issuecomment-729914763
10. If it all works properly, you should see this screen
11. Click next, and it should install quickly.
12. Enable WSL Version 2
13. Bring Power Shell back up as an Administrator and run this command: wsl --set-default-version 2
14. Youll see a kind of cryptic message For information on key differences with WSL 2 please visit https://aka.ms/wsl2 which basically means it worked!
15. Install a distro of linux
16. I had originally written this for Debian, but it doesnt really make a difference, and there are more guides for Ubuntu, so Ill continue with Ubuntu 20.04.
17. Navigate your browser to the MS Store for WSL: https://aka.ms/wslstore
18. Click Ubuntu and click Get
19. When its done, you should see this screen:
21. Go ahead and press that Launch button.
23. At this point, you can also access the linux drive from your host by going to file://wsl\$ or from within linux, you can go to /mnt/c/ to get to the hosts C drive. 1. Be aware that the file permissions work different on the two OSes.