Skip to content
This repository has been archived by the owner on Dec 25, 2021. It is now read-only.

jonaspetersorensen/dotfiles-wsl

Repository files navigation

ARCHIVED - wsl2 is a proper linux vm and has made most of these notes and settings obsolete.

dotfiles-wsl

My horrible configuration files for Ubuntu on Windows WSL2, and an even worse attempt at creating an installer for mucking it all up again.

Usage

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.

SSH

WSL and persisting ssh keys can be a pain.
My current solution is to configure ~/.ssh/config as shown in repo/ssh/config example.

VPN

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.

Windows terminal

Powershell

To be able to run themes etc you need to be able to run scripts: Run Set-ExecutionPolicy RemoteSigned

VSCode remote

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:

  1. Close VSCode, run command, reopen VSCode
  2. 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

Docker

Use WSL2 then reinstall "Docker for Windows" (latest stable) and let it use WSL2 when it asks during the install process.

ArduSub development environment

If you use Ubuntu then this setup is quite easy:

  1. Follow the installation tutorials
  2. In the ArduPilot guide, see Setting up the waf Build Environment on Windows10 using WSL
  3. 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.
  4. Setup x-server for visual output
    • Native opengl is supported by MAVProxy Ground Control Station
  5. Done!

ROS development environment

See ROS README

Resources

Official documentation
Setup
Examples
Shell scripting

Odd bits

  • Nothing so far :)

Troubleshooting

.profile is not read

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).

Windows terminal is dropping frames when nvidia G-Sync is active

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

az login fails on WSL2

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published