ARCHIVED - wsl2 is a proper linux vm and has made most of these notes and settings obsolete.
My horrible configuration files for Ubuntu on Windows WSL2, and an even worse attempt at creating an installer for mucking it all up again.
Clone repo into subfolder,
$ git clone https://github.com/jonaspetersorensen/dotfiles-wsl.git ~/.dotfiles
Then run "please install" to install all I(eh, you?) need for happy development,
bash ~/.dotfiles/please.sh install
For just a quick update of all dotfiles then run "please update",
source ~/.dotfiles/please.sh update
To install misc tooling then run the bootstrap.sh
script in the corrensponding tool directory.
WSL and persisting ssh keys can be a pain.
My current solution is to configure ~/.ssh/config
as shown in repo/ssh/config example.
WSL does not pick up on network changes when enabling vpn in win10.
My current workaround is to manually set which dns WSL should use each time I start vpn in win10 as shown in vpn/win10-vpn-resolv.conf
I then simply copy this file to /etc/resolv.conf each time I enable vpn in windows.
To be able to run themes etc you need to be able to run scripts: Run Set-ExecutionPolicy RemoteSigned
https://github.com/microsoft/vscode-remote-release
zsh + tmux can sometimes be tricky to run when using the vscode remote extension. Depending on update I have to turn of automatic start of tmux to get the extension to be able to connect to wsl.
Trouble with WSL1
Sometimes VSCode remote will lock files in wsl1, see I see EACCESS: permission denied error trying to rename a folder in the open workspace
While we wait for WSL2 (the only place this will be fixed), we have the following options:
- Close VSCode, run command, reopen VSCode
- In VSCode set
remote.WSL.fileWatcher.polling
to true
For NPM troubles it usually boils down to ownership of dir node_modules
, which npm itself some times make a mess of.
Fix by executing sudo chown -R $(whoami) node_modules
Use WSL2 then reinstall "Docker for Windows" (latest stable) and let it use WSL2 when it asks during the install process.
If you use Ubuntu then this setup is quite easy:
- Follow the installation tutorials
- In the ArduPilot guide, see Setting up the waf Build Environment on Windows10 using WSL
- The "install preqreqs" script provided by ArduPilot guide will update your
.profile
You will need to move the settings that was added to.profile
to what ever is your shell profile script, see ".profile
is not read", and then restart your WSL session to reload the profile.
Verify that$PATH
now include the paths added by ArduPilot settings. - Setup x-server for visual output
- Native opengl is supported by MAVProxy Ground Control Station
- Done!
See ROS README
- Windows Subsystem for Linux Documentation
- Microsoft/WSL git repo
MS is fairly active in answering issues and providing workarounds when possible until fix is available - Managing multiple Linux Distributions
- Bash On Ubuntu On Windows
- How to Install zsh and Oh My Zsh in Windows 10
- Guide - Developing on Windows 10 using WSL
- Shell Scripting Tutorial
- Nothing so far :)
So you have installed something that added config to .profile
, but you cannot see that these changes are actually being read.
A typically example is changes to $PATH
.
Welcome to linux where everything is customized: .profile
is not read if bash
, zsh
or which ever else custom shell is present.
Solution
bash
, zsh
and similar shells have their own profile configs due to misc incompatabilities with the good'ol'days sh
.
Simply copy what you need from . profile
to .zprofile
(in case of zsh
).
For long discussion see terminal git issue 649
The only way I could fix this in my machine was to add the setting "experimental.rendering.software": true
in settings.json
WSL2 is a linux VM, currently headless, and this seems to confuse the az login
functionality resulting in errors like tcgetpgrp failed: Not a tty
.
The alternative option until MS fix this is to use device login, az login --use-device-code
.