Closed scottmuc closed 4 years ago
Some good details on WSL here (as in what's the difference between WSL 1 and 2): https://wiki.ubuntu.com/WSL
Going through the Microsoft Store installer of the recommended version of Ubuntu.
More good info here: https://docs.microsoft.com/en-us/windows/wsl/compare-versions
When launching the Ubuntu App, the shell begins in $HOME in the container which is /home/username
.
If I launch wsl
from cmd.exe
I started a unix path where my Windows homedir is mounted /mnt/c/Users/summer
.
Line endings are a thing: https://stackoverflow.com/questions/44694331/what-is-the-m-notation-and-where-is-it-documented
There's a known issue that the filesystem mounted from windows adds ^M
line endings: https://www.scivision.dev/git-line-endings-windows-cygwin-wsl/
Here's someone reporting the file permissions differences: https://www.turek.dev/post/fix-wsl-file-permissions/
Moar WSL drvfs stuff: https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/
Ultimately the line-ending cruft of the comments above pointed to just cloning in the container, rather than using the mounted filesystem.
Some hurdles along the way:
Revealed that certain homedir scripts weren't in the path like easy-op
. Once added to the path, it revealed op
and jq
were not installed. jq
seemed to be uninstallable via apt-get install
for reasons we don't understand. An apt package name for op
didn't stand out. We downloaded a zip from the website (which required the installation of unzip
. Once those were installed and working, needed to install git-crypt
.
Next phase was to be able to run ./scripts/terraform init dns
. This resulted in the need to install terraform
(and a 0.12.x
specific version). As well as golang
to compile the gandi-terraform provider. The existing script was built specifically for osx
so some intervention was required.
Eventually, a no-op DNS change was able to execute.
Looking at nix might be interesting: https://hugoreeves.com/posts/2019/nix-home/
There's a lot more to dive into with WSL. The setup of the linux container is one thing. The downloading and configuring of the linux guest containers is another. I still don't know if WSL1 or WSL2 is more fitting for my use case.
I think I need to start placing usable cross-platform scripts into their own location. Though I'm worried about the web of dependency complexity that I might be introducing. This will be further explored when I actually use WSL more often.
The pain reaching the definition of done was mainly due to much of the prior scripting being written in an macOS specific environment.
A quick summary of improvements that need to be made:
base64
has different flags in macOS vs UbuntuFor future work, this link is good at describing how to download and install a specific Linux distro: https://docs.microsoft.com/en-us/windows/wsl/install-manual
Objective
I want to repurpose my macbook Airr which means I won't have a stable unix-terminal to perform my routine administration of my home network.
This must be easily replicated upon re-pave.
Done When
I can update my DNS records via my existing unix tool-chain.