ericsysmin's DevOps Blog

Configuring Docker Desktop on WSL2

Configuring Docker Desktop on WSL2

First steps, you’ll need to install and configure WSL2. To install WSL2 you can use the Microsoft Store or follow these instructions: https://learn.microsoft.com/en-us/windows/wsl/install

Then to install Docker to run on Windows and WSL2 you’ll need to follow these instructions: https://docs.docker.com/desktop/wsl/

During some testing and trying to simplify my WSL2 environment I stumbled upon an annoying issue that prevented me from running docker ps each time I attempted to run docker ps I’d receive the following error.

To get around this issue you’ll need to run the following commands:

Once those are ran you should be able to run docker without hitting permissions errors.

Those commands are adding/ensuring that the docker group exists and adding your existing user to the docker group. It then modifies the docker.sock to allow the docker group access to the socket.

Continue reading...
Installing ZSH on WSL: Ubuntu

Installing ZSH on WSL: Ubuntu

Having moved away from development of Ansible/Python/Terraform, and others on Windows a few years ago. I’ve heard that WSL has become much better, especially with its support of VS Code now that they have a WSL connector. So, I decided to give it a try.

However, I did run into one surprising inconvenience, BASH! I have become so accustomed to ZSH over the years on Apple and using oh-my-zsh that all my shortcuts and quick ways to doing things just weren’t there.

I did attempt to use oh-my-bash but there just aren’t the number of plugins already to support the plethora of plugins I need and use on a regular basis. So, next logical step is to install ZSH on my WSL: Ubuntu system.

Requirements

WSL with Ubuntu installed

Steps to install ZSH

  1. Install ZSH.
  2. Verify that ZSH has been installed on the system.
  3. Set ZSH as your default shell.
    NOTE: This used to require modifications to the shortcut to access WSL but in newer versions of WSL you can use the following.

    For older versions you will need to modify the shortcut to WSL and use the command:

  4. Once you close and reopen your WSL Ubuntu shell you should now be in ZSH shell.
    zsh-shell-screenshot

Install of Oh-my-zsh

  1. Ensure that your terminal session is open and use the following command as per https://ohmyz.sh/#install
  2. You should now be able to configure your oh-my-zsh installation by modifying your .zshrc file and enable any plugins you need.
  3. The final result! 🙂 

    Screenshot of oh-my-zsh on WSL: Ubuntu

 

Hopefully that helps, I know it helped me as I venture back to Windows for development of my Ansible playbooks and other tools.

Continue reading...