![peerblock linux centos peerblock linux centos](https://i.ytimg.com/vi/b2uz4MMcibQ/maxresdefault.jpg)
PEERBLOCK LINUX CENTOS INSTALL
yum update -y & yum install passwd sudo -yĮcho -e "\ndefault=$myUsername" > /etc/wsl.conf Users in the wheel group are automatically granted sudo privileges and can perform tasks requiring elevated permission. The command adduser -G wheel $myUsername adds the user myUsername to the wheel group. You will want to add the username to the sudoers file so that enables the user to use sudo. In this example, the username will be 'caloewen'.
PEERBLOCK LINUX CENTOS 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
![peerblock linux centos peerblock linux centos](https://i.ytimg.com/vi/rP-pU3mB1ZY/maxresdefault.jpg)
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.
![peerblock linux centos peerblock linux centos](https://i.ytimg.com/vi/PF0inFB5xec/hqdefault.jpg)
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. 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.
PEERBLOCK LINUX CENTOS 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.