Containers
Hyper-V
Get-WindowsFeature -Name Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Windows Subsystem for Linux
(WSL)
REM displays installed linux systems
wsl -l -v
REM sets default to version 2
wsl --set-default-version 2
REM updates the system (can fix start errors)
wsl.exe --update
REM adds a firewall rule to enable inbound from WSL
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
strings "/mnt/c/Program Files/WSL/wslservice.exe" | egrep "^wsl2\.|^experimental\."
C:\Users\<username>\.wslconfig
(create the file and restart WSL afterwards)[wsl2]
memory=12GB
swap=0GB
debugConsole=false
localhostforwarding=true
# nestedVirtualization=true doesn't work
nestedVirtualization=false
vmIdleTimeout=60000
safeMode=false
# options: NAT (default), mirrored, bridged
networkingMode=NAT
# networkingMode=bridged
# vmSwitch="Internet"
[experimental]
# default: true
autoMemoryReclaim=dropcache
# default: false
sparseVhd=true
# ignoredPorts=
# default: false
hostAddressLoopback=true
# assuming Visual Studio Code has been installed on Windows 10 in "C:\Programs\Microsoft VS Code"
echo 'export PATH=$PATH:"/mnt/c/Programs/Microsoft VS Code/bin/"' >> ~/.bashrc
exec "$SHELL"
code .
Windows Settings
> System
> Display
> Graphics settings
> Graphics performance preference
<Path_to_Documents>\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
in Visual Studio Codecode $PROFILE
Microsoft Photos
Microsoft Clipchamp
Raw Image Extension
Ubuntu on Windows
/etc/wsl.conf
file to enable chmod (required for SSH) and avoid issues with npm commands (see Advanced settings configuration in WSL)# /etc/wsl.conf
[automount]
options = "metadata"
[interop]
appendWindowsPath = false
wsl --shutdown
cp -r /mnt/c/Users/<myusername>/.ssh/id_rsa* ~/.ssh/
chmod 700 ~/.ssh/
chmod 644 ~/.ssh/*.pub
chmod 600 ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_rsa
Add-AppxPackage .\Microsoft.WindowsTerminal_Win10_xxx.msixbundle
Add-AppxProvisionedPackage -online -PackagePath .\Microsoft.DesktopAppInstaller_xxx.msixbundle -LicensePath .\xxx_License1.xml
winget list
Get-AppxPackage microsoft.desktopappinstaller
and uninstall it with Remove-AppxPackage -Package Microsoft.DesktopAppInstaller_xxx
"C:\Program Files\7-Zip\7z.exe" e *.zip
sudo groupadd docker
sudo adduser $USER docker
sudo chown root:docker /var/run/docker.sock
sudo chmod g+w /var/run/docker.sock
newgrp docker
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1
Review Docker configuration: C:\ProgramData\docker\config\daemon.json
Start Docker
"C:\Programs\docker-20.10.19\docker\dockerd.exe" -H npipe:////./pipe/docker_windows
docker context create win --docker host=npipe:////./pipe/docker_windows
docker -c win ps
Git Bash
(see Adding a new SSH key to your GitHub account) # ED25519
ssh-keygen -t ed25519 -C "firstname.lastname@email.com"
# RSA
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@email.com"
%userprofile%\.gitconfig
)# git config --global --edit
git config --global core.longpaths true
git config --global core.autocrlf false
KeePassHttp
KeePassHttp-Connector
# update packages
npm update -g
## update NPM
npm install npm@latest -g
podman machine init
and start it with podman machine start
# looks for the available versions
winget search RubyInstallerTeam.Ruby
# installs a specific version and restarts the terminal
winget install RubyInstallerTeam.Ruby.3.2
# makes sure ruby is available from the terminal
ruby -v
gem -v
VAGRANT_DEFAULT_PROVIDER
environment variable to virtualbox
or hyperv
and restart WindowsExtensions:
Angular Language Service
, CMake Language Support
, CSS Formatter
, Debbuger for Firefox
, Dev Containers
, Docker
, EditorConfig for VS Code
, ESLint
, Excalidraw
, Go
, HashiCorp Terraform
, Kubernetes
, Makefile Tools
, Markdown Table Pretifier
, markdownlint
, MongoDB for VS Code
,
PHP Intelephense
, Playwright Test for VSCode
, Puppet
, Python
, Puppet Debugger
, Snippets and Syntax Highlight for Gherkin (Cucumber)
, Tailwind CSS IntelliSense
, Vue - Official
, WSL
, YAML
User > setttings.json
(C:\Users\<username>\AppData\Roaming\Code\User\settings.json
):
{
"editor.minimap.enabled": false,
"security.workspace.trust.untrustedFiles": "open",
"redhat.telemetry.enabled": false,
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
},
"terminal.integrated.defaultProfile.windows": "Ubuntu (WSL)",
"[python]": {
"editor.formatOnType": true
},
"playwright.reuseBrowser": true,
"vs-kubernetes": {
"vs-kubernetes.crd-code-completion": "disabled"
},
"workbench.colorTheme": "Visual Studio Dark",
"typescript.updateImportsOnFileMove.enabled": "always",
"git.openRepositoryInParentFolders": "never",
"puppet.installDirectory": "C:\\Programs\\PuppetDevelopmentKit",
"puppet.installType": "pdk",
"go.toolsManagement.autoUpdate": true,
"workbench.editorAssociations": {
"*.md": "default"
},
}
settings.json
:{
"folders": [
...
],
"settings": {
...
"vs-kubernetes": {
"disable-linters": ["resource-limits"],
...
}
}
}
winget install --id MikeFarah.yq
Key | Value |
---|---|
DOCKER_HOST | tcp://localhost:2375 |
docker run --name helloworld hello-world
docker logs helloworld
docker rm helloworld
psexec -i -s cmd.exe
# installs Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# installs Firefox
choco install -y firefox
# installs Windows Terminal
choco install -y microsoft-windows-terminal
# VSCode + Extensions (an example provided here)
choco install -y vscode --params "/NoDesktopIcon"
code --install-extension ms-vscode.powershell
# installs git client
choco install -y git.install --params "/GitOnlyOnPath /NoAutoCrlf /NoShellIntegration"
# installs .NET Framework 4.8 developer pack
choco install -y netfx-4.8-devpack
# installs latest .NET SDK (6.0 in October 2022)
choco install -y dotnet-sdk
# installs Visual Studio 2022 Build tools & NuGet
choco install -y visualstudio2022buildtools nuget.commandline
# installs Notepad++
choco install -y notepadplusplus