This document describes how to set up Windows 10 for cross-platform development (Go, NodeJS, etc) with Windows Subsystem for Linux (WSL).
Most of the information here is collected from
The problem is in the installed keyboard (windows input service).
In your Control Panel > Region and Language > Keyboards and Languages you'll most likely find US Keyboard - International, which is an input service that has the ugly autocomplete feature. Add a new keyboard English - US (or Serbian or any other you like) and make it the default keyboard (in the drop down list above). Remove the "buggy" keyboard. Voila!
- Download Brave beta and Firefox browsers, make either default.
- Install 1Password for Windows, sign into personal and company accounts.
- Add 1Password X extension in Brave and Firefox
- Enable WSL and install latest version of Ubuntu from Microsoft Store
- Create C:\home directory, move user's home folder there and update
/etc/passwd
with the new location
# in /etc/wsl.conf
# Enable extra metadata options by default
[automount]
enabled = true
options = "metadata,umask=22,fmask=11"
mountFsTab = true
Move home directory like below
Changing the home directory with WSL is done the same way as in Linux:
Enter bash
- Type the command sudo vim /etc/passwd
- Find your account's line, which might look like:
harry:x:1000:1000:"",,,:/home/harry:/bin/bash
- Change the home directory, which above is /home/harry, to the new directory, using WSL notation
- Save the file
- Exit bash and re-launch it
- To test, use the commands:
- cd ~
- pwd
Ubuntu will create a default user on the initial run. It can also be done manually:
- Create new user in Ubuntu:
useradd -Um roustem
- Make sure that user is added to
sudoers
- Change default user (using PowerShell Admin):
ubuntu config --default-user roustem
sc stop LxssManager
sc start LxssManager
sudo apt update
sudo apt upgrade
sudo apt remove gnupg gpg
sudo apt install gnupg2 fish tree graphviz build-essential unzip
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
See Linuxbrew here (https://docs.brew.sh/Homebrew-on-Linux)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
After installation run the ff to add linuxbrew to path
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
https://www.brianketelsen.com/byobu-wsl/
https://github.com/lra/mackup
pip install --upgrade mackup
brew install mackup
export GO_VERSION=1.11.4
curl -O "https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz"
sudo mv /usr/local/go /usr/local/go.bak.$GO_VERSION # if installing new version
sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt -get install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn
# Export key to `key.asc` file and then import
gpg --import key.asc
# or add --pinentry-mode if there is ap problem with entering the password
gpg --import --pinentry-mode loopback key.asc
git config --global commit.gpgsign true
git config --global user.signingkey E25C1E01F3A98447
git config --global gpg.program /usr/bin/gpg
git config --global user.email [email protected]
git config --global user.name Roustem
git config --global url."[email protected]:".insteadOf "https://gitlab.1password.io/"
git config --global url."[email protected]:".insteadOf "[https://gitlab.com](https://gitlab.com)"
Debugging gpg signing:
echo “Test” | gpg --clear-sign
https://cloud.google.com/sdk/docs/downloads-apt-get
sudo apt install kubectl
gcloud init
gcloud container clusters get-credentials cluster-dev
- Visual Studio Code
- Git
- Go
- WSLtty
- Gpg4win
- Ditto
After installing Go, press Win-S
, type PATH
and change the GOPATH
to C:\home\roustem\go
. This will make sure that GOPATH is shared with WSL and Go can pickup all libraries and vendored code.
git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"
git config --global commit.gpgsign true
git config --global user.signingkey E25C1E01F3A98447
git config --global user.email [email protected]
git config --global user.name Roustem
git config --global core.filemode false
git config --global core.autocrlf input
Also, make sure that local .git/config
file has correct settings as well.
Note: you might have to do this without --global
in the repo as well.
Install MinGW to get access to make and other command line tools. Update PATH to Include
C:\MinGW\bin
C:\MinGW\msys\1.0\bin
Based on Speeding up WSL I/O ..., turn off Windows Defender protection for some folders and processes:
Exclude folder: %USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
Exclude processes:
- git
- node
- npm
- dpkg
- go
WSL Interoperability with Docker
go get -d github.com/jstarks/npiperelay
// on Windows:
go install github.com/jstarks/npiperelay
// in WSL:
sudo apt install socat
sudo apt install docker.io
touch ~/docker-relay
chmod +x ~/docker-relay
vim ~/docker-relay
// contents of ~/docker-relay
#!/bin/sh
exec socat UNIX-LISTEN:/var/run/docker.sock,fork,group=docker,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/docker_engine",nofork
// end ^^^
sudo adduser roustem docker
Set keyboard shortcut to Alt-V
Exclude 1Password
binary
Add image clipboard type
Keyboard Shortcuts:
-
Cmd-Shift-S
– take a screenshot and save it to clipboard -
Win-.
– show emoji panel (see Advanced Keyboard settings to control if emoji panel closes automatically) Configure system and user path: -
Win-S
, type "PATH" Configure taskbar: -
Cmd-S
, type "system icons"