
You will now see as the output based on this example. Start your distribution again to see your new default user by running this command in PowerShell: wsl -terminate CentOS You must now quit out of that instance and ensure that all WSL instances are terminated.
#Clion wsl install
yum update -y & yum install passwd sudo -yĮcho -e "\ndefault=$myUsername" > /etc/wsl.conf In this example, the username will be 'caloewen'.
#Clion wsl password
Use this command to install sudo and password setting tools into CentOS, create a user account, and set it as the default user. To set up user account with the CentOS distribution we just imported, first open PowerShell and boot into CentOS, using the command: wsl -d CentOS You can set up your own user account, but note that the set up process will vary slightly based on each different Linux distribution. Use the command wsl -l -v to check which distributions you have installed.įinally, use the command wsl -d CentOS to run your newly imported CentOS Linux distribution.Īdd WSL specific components like a default userīy default when using -import, you are always started as the root user. wsl -import CentOS E:\wslDistroStorage\CentOS.

Use the command wsl -import to import the tar file. Open PowerShell and ensure that you have a folder created where you'd like the distribution to be stored. To import the CentOS distribution tar file into WSL: Once you have a tar file ready, you can import it using the command: wsl -import. This process exports the CentOS tar file from the Docker container so that we can now import it for use locally with WSL. Grab the CentOS container ID using grep and awk: dockerContainerID=$(docker container ls -a | grep -i centos | awk '')Įxport the container ID to a tar file on your mounted c-drive: docker export $dockerContainerID > /mnt/c/temp/centos.tar Run the CentOS container inside Docker: docker run -t centos bash ls / Start the Docker service: sudo service docker start Open the command line (Bash) for a Linux distribution that you've already installed from the Microsoft Store (Ubuntu in this example).
#Clion wsl windows

The example below will show this process using the CentOS container.

Find a Linux distribution container and export an instance as a tar file.You can find an example for Alpine in the "Mini Root Filesystem" section of the Alpine Linux downloads site. You can obtain a tar file in a variety of ways, two of which include: Obtain a tar file for the distributionįirst you'll need to obtain a tar file that contains all the Linux binaries for the distribution. This process can be applied to import any Linux distribution.
#Clion wsl how to
This article shows how to import the Linux distribution, CentOS, for use with WSL by obtaining its tar file using a Docker container. You can use any Linux distribution inside of the Windows Subsystem for Linux (WSL), even if it is not available in the Microsoft Store, by importing it with a tar file. Import any Linux distribution to use with WSL
