Skip to the content.

Windows Installation Detailed Instructions

  1. Upgrading WSL1 to WSL2
  2. Running without Docker Desktop

Upgrading WSL1 to WSL2

If you have previously tried out Windows Subsystem for Linux (WSL), you may have the original WSL1 version installed.

For many reasons, you probably want to upgrade from WSL1 to WSL2.

To upgrade, you need to be running at least version 1093 of Windows 10 - you can check by running winver

If you happen to have installed WSL to play around, and have an old version around, you might want to update the version of that installed distro (but, then again, it might be an old distro, so that might not be the best idea; if it doesn’t have anything useful, you might be better off starting with a brand new, up to date Ubuntu distro).

In any case, the best way to get the core WSL2 components installed, and updated is

wsl.exe --install
wsl.exe --update

To then check if you have any WSL 1 distros installed, you can run the wsl -l -v command that will show you the version of any distros

  NAME      STATE           VERSION
* Ubuntu    Running         2

If any are running version 1, you can upgrade them to version 2 with wsl --set-version <distro-name> 2, for example wsl --set-version Ubuntu 2

Running without Docker Desktop

The host system will require:

You will need to carry out this setup in several phases, and will need to terminate WSL in between several steps.

You will want several terminal windows open - Windows Terminal is ideal as you can configure it to start administrative sessions of command prompts, powershell, and regular sessions of command prompts, powershell, and Ubuntu (WSL) tabs.

Install prerequisites

Initial WSL Install / Update

Enable systemd

[boot]
systemd=true

Enable Bridged Networking and DHCP Allocation

# Settings apply across all Linux distros running on WSL 2
[wsl2]
networkingMode = bridged
vmSwitch = WSLBridge
#ipv6 = true
#macAddress = AA:BB:CC:DD:EE:FF

# Enable experimental features
[experimental]
#sparseVhd=true
#autoMemoryReclaim=dropcache

Experimental Features

Experimental Features require a preview version of WSL - install by wsl --update; wsl --update --pre-release

Once you have enabled these settings in .wslconfig, shutdown your WSL instance with wsl --shutdown from a command prompt, then re-start WSL.

Log into WSL, and type ip a

You should see something like this - note the link/ether and inet values for eth0

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.125/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever

Grab the mac address listed, and use this to set up a DHPC reservation in your router with a hostname (e.g. wsl2) and update your .wslconfig file with this mac address, and uncomment the line. wsl --shutdown to shutdown WSL, then restart, and WSL should come up on the DHCP allocated IP address, and if you log in, ip a should show the new IP address.

Open up the firewall port that Grafana will use, so that it’s ready on first run, for later: administrator command prompt: netsh advfirewall firewall add rule name= "Powerwall-Dashboard" dir=in action=allow protocol=TCP localport=9000

Docker Setup

If you installed Ubuntu 22.04 (which is likely as it is an up to date release), Docker won’t run unless you change iptables to use iptables legacy. This is because 22.04LTS uses iptables-nft by default.

There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).

  Selection    Path                       Priority   Status
------------------------------------------------------------
  0            /usr/sbin/iptables-nft      20        auto mode
* 1            /usr/sbin/iptables-legacy   10        manual mode
  2            /usr/sbin/iptables-nft      20        manual mode

The Docker installation reference is here but at the time of documentation, the following steps are correct:

Add the repository to Apt sources:

echo
“deb [arch=”$(dpkg –print-architecture)” signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu
“$(. /etc/os-release && echo “$VERSION_CODENAME”)” stable” |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update

* Install Docker `sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`
* Check Docker Runs `sudo docker run hello-world`
* Create the Docker Group `sudo groupadd docker`
* Add your user to that group `sudo usermod -aG docker $USER`
* Log out of WSL, then log back in
* Check Docker Runs without SUDO `docker run hello-world`
* Configure Docker to start on WSL Startup

sudo systemctl enable docker.service sudo systemctl enable containerd.service sudo systemctl start docker.service sudo systemctl start containerd.service systemctl status docker.service systemctl status containerd.service ```

Create Windows Task Scheduler Task to Start WSL when the Windows host Starts (or Restarts)

image image image image image

Powerwall-Dashboard Installation

Run the remainder of the Powerwall Dashboard Installation as per the Quick Start README or Manual Installation