WSL2: Roll Your Own

I have always been fond of my VMs to isolate my experiments form my main OS. For a long time it was all about using VirtualBox for running VMs, Vagrant for provisioning them and Packer for creating my own custom images. Then WSL came along, and while lightweight, it never really felt as fully featured as I wanted it to be. Over the last few years, however, Microsoft have come a long way and now there is really no need to manage VMs yourself unless you are doing something very exotic. If fact the whole WSL experience is so smooth that it is indistinguishable from pure magic. This never sits well with the control freak in me. 🤣 This post is a summary of my approach to rolling my own WSL environment and will cover topics like using custom Linux images, managing multiple environments, and tweaking more advanced WSL settings.

2023 here I come!

Are you ready for whatever 2023 can throw at you? I say, ‘2023 here I come!’ Don’t get me wrong - first few days back at work have been a massive shock to the system, there are still more questions than answers, and at least once this week I have been close to having to tell myself, ‘Fake it, until you make it, dude!’ What is it then that keeps me excited and ready to tackle the challenges ahead? I spent a little bit of time reflecting on what inspires me at a more fundamental level and how I want to be in 2023. Whenever I need help to get started or support to keep going, I go back to these inspirations.

Hello World! Again! Again!

Coming back to the idea of blogging is beginning to feel like a scene out of Groundhog Day. I’ve lost count of my false starts. I keep scribbling down ideas for blog posts and ’today I learned’ experiences in my bullet journal, but never really get beyond the good intentions stage when it actually comes to writing it all up. Whether it is urgent work stuff or personal commitments, life just seems to get in the way. 😒

PowerShell Measure-Command

Recently I was putting together some VM provisioning scripts, was running and re-running these as a part of testing and wanted to measure how long it takes for some of these scripts to run. PowerShell one-liner to the rescue!

Measure-Command {Start-Sleep -s 10; Write-Output "Done!" | Out-Host}

This snippet consists of three parts. Measure-Command {} which is the bit that does the measuring. Start-Sleep -s 10; Write-Output "Done!" is the command that I’m executing - sleeps for 10 seconds and then prints out “Done!”. Finally, output from the executed command is redirected to the command line like so | Out-Host.

Setting up Git and GitFlow

On those rare occasions when I get a chance to code I tend to work on Ubuntu based virtual environments - VirtualBox VMs and more recently WSL. It is also pretty much a given that I’d need to interact with different Git hosting services like GutHub and BitBucket, and it usually takes quite a bit of tinkering to get everything set up and working smoothly with all the various accounts. These are my steps to to get the Git and GitFlow installed and configured in a jiffy. 🚀

Hello World! Again!

It is probably something like 57th 63rd time I write my ‘first’ blog entry. Over the years I have had so many false starts that I’ve lost the count. It is usually a good few days spent tinkering with servers and hosting, checking out blogging software, switching on SEO plugins, writing a few paragraphs of content, not being able to decide what to put in ‘About Me’ page and then just giving up. I think it was only once that I managed to write a couple of posts and had an idea for a few more. What’s different this time? A good few days spent tinkering with servers and hosting… 😆