![]() ![]() 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). You must have Docker Desktop for Windows installed with the WSL 2 engine enabled and integration checked See the Docker Desktop license agreement for updates on the terms of use.You must have WSL enabled with a Linux distribution installed running WSL 2. ![]() In this example, we'll use Docker inside of a WSL distribution to obtain the tar file for CentOS. The example below will show this process using the CentOS container.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |