MS Guide: https://docs.microsoft.com/en-us/windows/wsl/install
wsl --install
Follow Up Guide: https://docs.microsoft.com/en-us/windows/wsl/setup/environment
sudo apt update && sudo apt upgrade
Tip: Open Explorer in current WSL dir: explorer.exe
Tip: Open Windows file system from WSL: cd /mnt/c/Users/username
https://docs.docker.com/desktop/windows/install/
Download installer and run.
Use command from an Admin PowerShell Console: Get-Service ssh-agent | Set-Service -StartupType Automatic
Start the agent manually first time: ssh-agent
Generate a new key from PowerShell (non-admin) ssh-keygen -t ed25519 -C "mike@computer"
Add the new key to the agent: ssh-add .\.ssh\id_ed25519
Add public key to bitbucket and github profiles.
Test the SSH connection: ssh -T [email protected]
Download and run Windows installer. Choose the following:
- Editor: Vim
- Branch Name: Overide with "main"
- Git from command line and 3rd party software
- Use external OpenSSH
- Use OpenSSL library
- Line endings: Default (checkout windows style, commit unix style)
- Terminal: Use MinTTY
- Git Pull: Default
- Git Credential Manager
- Extra options: use defaults
- No experimental options
git config --global user.name "Mike Rose"
git config --global user.email "[email protected]"
Open a cmd prompt and try to clone a repo.
Git is installed on WSL2 by default.
https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-git
Maybe someday follow the "Git Credential Manager setup" in the MS link above.
From WSL Console:
Edit .bashrc and add the following. Can use this to edit: notepad.exe ~/.bashrc
#Use SSH key from Windows FS
echo "Starting ssh agent..."
eval "$(ssh-agent -s)"
echo "Adding ssh key: /mnt/c/Users/cumul/.ssh/id_ed25519"
ssh-add - < "/mnt/c/Users/cumul/.ssh/id_ed25519"
VS Code doesn't use .profile, but .profile should execute .bashrc so this should work for terminal and vscode.
Edit .bash_logout and add the following. Can use this to edit: notepad.exe ~/.bash_logout
#added to clean up ssh agents if possible
kill $SSH_AGENT_PID
Close WSL console and open a new one. You should see a message about starting the ssh agent.
Test SSH to github:
ssh -T [email protected]
Finish git config:
git config --global user.name "Mike Rose"
git config --global user.email "[email protected]"
Might as well install vscode at this point. Download and install.
Install Pluggins:
- Docker
- Remote - Containers