Fore Into Development on Windows

My work laptop is currently a Windows 10 PC. I've gone the virtual machine route for Ubuntu within the Hyper-V and Virtual Box Hypervisors. This is a fore into giving Powershell based development on Windows a try.

Ian Cleary

Posted: Friday, August 6, 2021

3 min read

Table of Contents

Article Content

This is Fine Meme to illustrate that I prefer to not develop software on Windows 10

Windows 10 Development

While I still am used to my preference of debian based host operating systems for development workflows (gh repo clone icanccleary/ubuntu-dev-playbook), this is a some documentation around what I've installed and what my development workflow on Windows 10 is like.

Edit: This allows me to build a docker contianer, use git, make, npm, and ssh keys on Windows. However, if I want to do anything with network mounts or anything more serious, I avoid Windows. Please treat this as some notes on how to install some software tools on Windows and a few helpful tips along my adventure.

Software

Powershell

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7.1

Chocolately to install Node

https://nodejs.org/ is easier to install with Chocolately, which is a windows package manager https://chocolatey.org/install.

After you have it installed, proceed to https://community.chocolatey.org/packages/nodejs-lts

Docker for Windows

https://docs.docker.com/docker-for-windows/install/

git

https://gitforwindows.org/

gh

https://github.com/cli/cli/releases/

Windows Terminal

https://www.microsoft.com/store/productId/9N0DX20HK701

VS Code

https://code.visualstudio.com/download

PowerShell Versions

Software Versions displayed in Windows Powershell Window

Adding SSH Keys to Windows

https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement

Make sure you're running as an Administrator!

# By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work.
# Make sure you're running as an Administrator.
Get-Service ssh-agent | Set-Service -StartupType Manual

# Start the service
Start-Service ssh-agent

# This should return a status of Running
Get-Service ssh-agent

# Now load your key files into ssh-agent
ssh-add ~\.ssh\id_ed25519

Edit to load automatically:

It's best to configure OpenSSH Authentication Agent service to automatically start. Alternatively, you can start it manually every time when opening powershell for the first time:

Start-Service ssh-agent

To have SSH agent to automatically start with Windows, you can run (from elevated powershell prompt):

Set-Service ssh-agent -StartupType Automatic

After that, you need to add your ssh key once:

ssh-add C:\Users\your-name\.ssh\id_rsa

Now everytime the ssh-agent is started, the key will be there. You can check which keys are registered with the ssh-agent:

ssh-add -l

Credit: https://superuser.com/questions/1327633/how-to-maintain-ssh-agent-login-session-with-windows-10s-new-openssh-and-powers Credit: https://dmtavt.com/post/2020-08-03-ssh-agent-powershell/

Above doesn't seem to work.

Git Bash terminal does.

https://github.com/microsoft/terminal/issues/7200#issuecomment-672786518 gets rid of screen white flicker

Select Git Bash inside VS Code

https://stackoverflow.com/questions/42606837/how-do-i-use-bash-on-windows-from-the-visual-studio-code-integrated-terminal

Make install with choco

Open Powershell as administrator

choco install make

StackOverflow source

Experience So Far

I'm going to stick with a Hyper-V Virtual Machine if I need to do anything serious on a Windows host. My preference is to encapsulate what I know works wihtin a fast enought VM on a Windows Host. My current employer is very tied into Windows and this is just a better experience for me.