A blog about tech & coding

Install Docker in WSL2 with Ubuntu 22.04 LTS

By Marco on Sun May 15 20221 min readUbuntu

When installing Docker in WSL2 with Ubuntu 20.04 LTS, you can install Docker by following the official instructions. After installing Docker, you can start Docker by simply running sudo service docker start.

However, when you install Docker in WSL2 with the latest Ubuntu 22.04 LTS, you will notice that Docker will not start after running sudo service docker start. You will receive errors when starting a container, and sudo service docker status will tell you Docker is not running.

The reason this errors occurs is because Ubuntu 22.04 LTS uses iptables-nft by default. You need to switch to iptables-legacy so that Docker will work again:

  1. Run sudo update-alternatives --config iptables
  2. Enter 1 to select iptables-legacy
  3. Now run sudo service docker start, and Docker will start as expected!
The selection window for the iptables configuration in Ubuntu 22.04

Restore WSL2 network connectivity when using a VPN

If you are using WSL for the company you are working for, it might be that the VPN solution may affect network connectivity in WSL, resulting in no internet connectivity. wsl-vpnkit is a solution for this problem

Tue May 17 2022

Automated backups using cloud storage with rclone

There's a simple rule for file backups, the so-called 3-2-1 rule: 3 copies, 2 different media, 1 offsite. Applying this simple rule ensures that in the case of a calamity there is a high chance you are able to recover your files. However, creating automated offsite backups is not a trivial task. Luckily, rclone comes to the rescue. Rclone is command-line tool similar to rsyncwith cloud storage support. This means that you can copy your files to cloud providers such as Dropbox, OneDrive, Google

Sun Jan 23 2022