commonplace
  • Commonplace
  • AWS
    • Control Tower
      • Building a Scalable and Secure Multi-VPC AWS Network Infrastructure
    • Talks / Articles
      • Encrypting Everything with AWS (SEP402)
      • The Tension Between Absolutes & Ambiguity in Security (SEC310)
      • Best practices for authoring AWS CloudFormation (DOP302-R1)
    • Useful Links
    • Notes
      • awscli
      • Cloudformation
        • Using Parameters
  • Infrastructure Security
    • Amazon Web Services
      • Tools
    • Tools
  • Security
    • Articles
      • If You're Not Doing Continuous Asset Management You're Not Doing Security | Daniel Miessler
      • Living Off the Land
        • Living Off The Land: Part 2
    • Cryptography
      • Shamir Secret Sharing Algorithm
    • Distros
      • REMnux
    • DoD
    • Email
    • GPG
    • Shodan
    • SSH
  • Resources
    • AWS Toolbox
    • CTF
      • AWS
    • Dev Setup
      • Windows Terminal
    • Documentation
      • MOCK Press Release Template
      • Design Document Template
    • Docker
      • Notes
      • Configure Docker w/TLS for WSL
    • Kubernetes
      • Raspberry Pi 4 (4GB) Cluster
    • Linux
      • zsh config
      • Users and Groups
    • Python
      • AWS
        • Lambda
      • Random Strings
    • Security News
    • Tools
    • Unity SSDLC
    • vscode
      • Cloudformation
    • Windows
      • WSL2
        • Scratchpad
        • Install a GUI (xfce)
        • Creating Additional WSL2 Instances
    • Youtubers
      • youtube-dl snippets
  • Lab
    • Building a Better Workstation
      • Notes / Guide
  • Misc
    • Notes
      • youtube-dl
  • Recipes
Powered by GitBook
On this page
  • https://docs.microsoft.com/en-us/windows/wsl/wsl-config
  • Set the default user for a WSL2 instance
  • Enable localhostForwarding
  • Remove Windows Path from WSL
  • Start WSL2 as a specific user
  • Notes when creating from rootfs

Was this helpful?

  1. Resources
  2. Windows
  3. WSL2

Scratchpad

/etc/wsl.conf

PreviousWSL2NextInstall a GUI (xfce)

Last updated 3 years ago

Was this helpful?

Set the default user for a WSL2 instance

[user]
default=<string>

Enable localhostForwarding

[wsl2]
localhostForwarding=true

Remove Windows Path from WSL

[interop]
appendWindowsPath=false

Start WSL2 as a specific user

wsl -d <distro> -u <user>

Notes when creating from rootfs

Create a non-root user

# in Ubuntu, you'll be root by default
adduser username

# Do you want to be able to sudo?
usermod -aG sudo username

Within Windows Terminal, ctrl + , for settings. Select the wsl instance from the left pane and set the starting directory to //wsl$/distroname/home/username

https://docs.microsoft.com/en-us/windows/wsl/wsl-config