Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Latest commit

 

History

History
83 lines (50 loc) · 2.96 KB

10.md

File metadata and controls

83 lines (50 loc) · 2.96 KB

Prerequisites

Supported development platforms are:

  • Windows 10 Professional build 2003 with WSL2 and Ubuntu 18.04

Also your workstation needs at least 8gb of memory.

It may work on other configurations but it is not tested.

Windows configuration is a bit more complex. The steps are:

  • update Windows 10 to build 2009
  • install Ubuntu-18.04 under WSL2
  • install Docker for Windows
  • use docker from WSL2-Ubuntu
  • create an ssh proxy to access localhost

More details below.

Update to build 2009

You need to update Windows 10 at lest to build 2009 in order to have WSL2.

Check here to read more informations to update windows are here

Install Ubuntu-18.04 under WSL2

Go into the Microsof Store and seach for Ubuntu. Install version 18.04 and launch it.

By default it may be installed on WSL1, so you need to ensure it works with WSL2.

Open PowerShell, ensure you see Ubuntu-18.04 with the command wsl -l then type: wsl --set-version Ubuntu-18.04 2.

Now you can enter in the distro with the command wsl -d Ubuntu-18.04

Install Docker Desktop for Windows

Instructions to install Docker Desktop for Windows are here. You need at least version 2.3.0.2

Use docker for windows as docker backend in WSL 2

This step is critical.

After installation follow these instructions to use the Docker running in Windows as the Docker to use in WSL.

Setup a port forwarding to localhost

A common assumption for development tools is that they listen to localhost.

This is the case for development mode of Svelte, since it listens to http://localhost:5000. However in version 2004 of WSL is not yet possible to access localhost, as everything is run in a virtual machine with its own ip address. To access localhost you need to setup port forwarding with ssh.

You can do as follows in Ubuntu (for other distributions you need to adapt). First install and start SSH:

sudo apt-get remove --purge openssh-server
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y openssh-server
sudo service ssh start

Then get the ip address of your virtual machine. For example:

$ ifconfig | grep "inet "
    inet 172.17.166.104  netmask 255.255.240.0  broadcast 172.17.175.255
    inet 127.0.0.1  netmask 255.0.0.0

The IP is the one that is NOT 127.0.0.1. The output in your case can be different.

Once you found your IP address, use an SSH client to create a tunnel. I used the one included in Git for Windows.

Type:

ssh -L 5000:127.0.0.1:5000 <user>@<ip>

where <user> is the user you set up when you installed WSL2, and <ip> is the IP address you just found. You will also need to type the password you setup when you istalled WSL2.

Before doing anything, you have to setup your environment.