Slide 1

Slide 1 text

Porting a macOS Clojure dev setup to Windows WSL2 Michiel Borkent @borkdude 2020-09-10

Slide 2

Slide 2 text

About me • Clojure/Script developer for over 10 years • Moved to Mac roughly 10 years ago (cmd.exe, Clojure tooling) • I like the flexibility of laptops, but I also like the power of a desktop

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

https://covid19.doctorevidence.com/

Slide 5

Slide 5 text

A new PC • 128GB memory, 2GB SSD, Ryzen 3950X, NVIDIA graphics • Equivalent Mac Pro machine would 3x more ($3000 vs $9000) • Want to use it as a remote dev machine • But no macOS: now what? • Windows + WSL2 to the rescue?

Slide 6

Slide 6 text

Installing Windows without Windows • Tried bootable USB on macOS without success • Friend with Windows laptop, Rufus • Could MS make this more streamlined for non-Windows users?

Slide 7

Slide 7 text

Basic setup

Slide 8

Slide 8 text

Transferring work dev setup • Needed to copy my zsh scripts and a couple of databases • Wanted to use rsync. • Enabled ssh:
 $ sudo service ssh start • How to enable on boot? Systemd, but wsl should already be running? • Windows firewall doesn't forward and blocks port 22 ...

Slide 9

Slide 9 text

Open/forward ports: #4150 Useful Powershell script in comments:

Slide 10

Slide 10 text

Start wsl / ssh at login

Slide 11

Slide 11 text

All rsynced, dev setup runs! Worth noting: even ClojureScript hot reloading works over remote connection! Tailscale for access outside home

Slide 12

Slide 12 text

Emacs on remote machine In Terminal: git-gutter, flycheck-inline
 Other options: tramp, ssh -X, FUSE/sshfs Fix iTerm2 key bindings: https://joppot.info/en/2017/09/12/4056

Slide 13

Slide 13 text

VSCode + Calva + clj-kondo + SSH extension

Slide 14

Slide 14 text

Reboot after patch Tuesday Configure in group policy, see this article

Slide 15

Slide 15 text

WSL2 executing Windows programs