Make Windows normal again

Make Windows normal again

An Overview of Developer Tools for Windows - Welldone Software - Medium

WSL Related

Linux’izing your Windows PC into a dev machine – Part 2 | cepa.io

Composer on WSL

https://www.jeffgeerling.com/blog/2018/installing-php-7-and-composer-on-windows-10 http://kizu514.com/blog/install-php7-and-composer-on-windows-10/ https://getcomposer.org/download/

MySQL on WSL

The mysql user folder is not set correctly by default and the server will complain about it when started (No directory, logging in with HOME=/). To fix, change the mysql user’s home directory to /var/lib/mysql:

sudo usermod -d /var/lib/mysql mysql

I had to add protocol=TCP in /etc/mysql/my.cnf

In my app living in WSL, changing the host from localhost to 127.0.0.1 in also helped.

# /etc/mysql/mysqld.conf.d/mysqld.conf
[client]
protocol=tcp

https://www.reddit.com/r/bashonubuntuonwindows/comments/78z18d/mariadb_server_on_wsl/

sudo add-apt-repository ppa:mysql-ubuntu/mariadb-10.1
sudo apt-get update
sudo apt-get install mariadb-server

grep socket -R /etc/mysql/


## /etc/mysql/mysql.conf.d/mysqld.cnf

Go to the file /etc/mysql/debian.cnf which has as the format:

[client]
host     = localhost
user     = debian-sys-maint
password = XXXXXXXX
socket   = /var/run/mysqld/mysqld.sock 
Take from there the password, that is randomly generated when installing MySQL (e.g. it differs between servers);



mysql -udebian-sys-maint -p02cShQo3PUHOFfzY



mysql -udebian-sys-maint -p02cShQo3PUHOFfzY --protocol TCP -h 127.0.0.1

[WSL 2] NIC Bridge mode 🖧 (Has Workaround🔨) · Issue #4150 · microsoft/WSL · GitHub


Find the IP address of your WLS2 Ubuntu host (use ifconfig) and connect to that IP using your Web browser.

sudo usermod -aG docker $USER

You will need to log out for this change to take effect.


Lando? wget https://github.com/lando/lando/releases/download/v3.0.0-rc.18/lando-v3.0.0-rc.18.deb


Multipass is WSL2 alternative

Multipass - Orchestrates virtual Ubuntu instances

That’s Ubuntu take on WSL2. Creating an instance is much slower, but much more things work (snaps without hacks). Is also supports cloud-init (as Hetzner Cloud and Exoscale also do). In essence, it is what Vagrant used to be.

multipass launch --name mpass
# or even without name

# enter the instance shell
multipass shell mpass

Working with Multipass instances

To be honest, Vagrant does do that. For sure, just like in theory KVM or Vmware can be used for that too. You can also set up a build farm and a Jenkins server to try to run “hello world”. The advantage of multipass is that to use it, all you have to do is:

snap install multipass


Snaps won’t work on WSL2

snaps don’t work on WSL2 as you need them for every command installed in that way!

The easiest way is to use snap (it is cross-distribution packager):

Using snapd in WSL2 - WSL2 - Ubuntu Community Hub Snapd on WSL2 (Insiders only for now) - snapd - snapcraft.io arkane-systems/genie: A quick way into a systemd “bottle” for WSL

sudo apt install -y daemonize

# this must be done on reboot
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target 

# this must be done on every login to WSL
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME 

snap version
sudo snap install kubectl --classic

Compiling kernel on WSL2 is easy: k3s on WSL2


How to register JetBrains PhpStorm

  1. Add the line 0.0.0.0 account.jetbrains.com to hosts file
  2. Enter activation key (mine worked from https://gist.github.com/MartirosyanMurad/54029eff68f02b31fcf5fc3e77635c3c#gistcomment-3037948)
  3. We can host our own jetbrains-license-server

Use PhpStorm for WordPress Development


Installing Windows Subsystem For Linux For Web Development On Windows

date 11. Oct 2019 | modified 10. Jun 2024
filename: Windows » Dev Environment » Dump