![]() ![]() Immediately terminates all running distributions and the WSL 2 lightweight utility virtual machine. See the Automount options in the Advanced Settings Configuration doc. You can instead change the default user for imported distributions using the /etc/wsl.conf file. This command will not work for imported distributions, because these distributions do not have an executable launcher. Ubuntu config -default-user johndoe would change the default user for the Ubuntu distribution to the "johndoe" user. The user has to already exist inside the distribution in order to become the default user. Change the default user for a distribution config -default-user Ĭhange the default user for your distribution log-in. To run WSL as a specified user, replace with the name of a user that exists in the WSL distribution. Run as a specific user wsl -u `, `wsl -user See a list of options and commands available with WSL. Check WSL version wsl -versionĬheck the version information about WSL and its components. See general information about your WSL configuration, such as default distribution type, default distribution, and kernel version. ![]() ![]() -web-download: Download the latest update from the GitHub rather than the Microsoft Store.Update your WSL version to the latest version. To print the current user name, use the command whoami. If the user doesn't exist in the WSL distribution, you will receive an error. Debian) and with the name of an existing user (ie. To run a specific Linux distribution with a specific user, replace with the name of your preferred Linux distribution (ie. Run a specific Linux distribution from PowerShell or CMD wsl -distribution -user To jump from any directory back to home from within a WSL command prompt, you can use the command: cd ~. The ~ can be used with wsl to start in the user's home directory. To set the default Linux distribution that WSL commands will use to run, replace with the name of your preferred Linux distribution. Set default Linux distribution wsl -set-default WSL 2 is only available in Windows 11 or Windows 10, Version 1903, Build 18362 or later. To set a default version of WSL 1 or WSL 2, replacing with either the number 1 or 2 to represent which version of WSL you would like the installation to default on for new Linux distribution installations. Set default WSL version wsl -set-default-version To designate the version of WSL (1 or 2) that a Linux distribution is running on, replace with the name of the distribution and replace with 1 or 2. Set WSL version to 1 or 2 wsl -set-version Additional options that can be used with the list command include: -all to list all distributions, -running to list only distributions that are currently running, or -quiet to only show distribution names. This command can also be entered as: wsl -l -v. See a list of the Linux distributions installed on your Windows machine, including the state (whether the distribution is running or stopped) and the version of WSL running the distribution (WSL 1 or WSL 2). ![]() List installed Linux distributions wsl -list -verbose This command can also be entered as: wsl -l -o. See a list of the Linux distributions available through the online store. List available Linux distributions wsl -list -online If you running WSL on Windows 10 or an older version, you may need to include the -d flag with the -install command to specify a distribution: wsl -install -d. -no-distribution: Do not install a distribution when installing WSL.-enable-wsl1: Enables WSL 1 during the install of the Microsoft Store version of WSL by also enabling the "Windows Subsystem for Linux" optional component.(WSL updates will be received via Windows updates, rather than pushed out as-available via the store). -inbox: Installs WSL using the Windows component instead of using the Microsoft Store.When WSL is not installed options include: -web-download: Install from an online source rather than using the Microsoft Store.-no-launch: Install the Linux distribution but do not launch it automatically.You can find available distributions by running wsl -list -online. -distribution: Specify the Linux distribution to install.For a valid list of distribution names, run wsl -list -online. You can also use this command to install additional Linux distributions by running wsl -install. Install WSL and the default Ubuntu distribution of Linux. For a full list of commands, run wsl -help. To run these commands from a Bash / Linux distribution command line, you must replace wsl with wsl.exe. The WSL commands below are listed in a format supported by PowerShell or Windows Command Prompt. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |