how to install centos on wsl windows 10

preview_player
Показать описание
WSL (Windows Subsystem for Linux), comes with a handful of linux distributions you can use, but Centos is not one of them. In this video I'll show you how to import Centos as a distro on WSL and make it your default. You don't need to install virtualbox. Docker is used to create and import the container into wsl. You'll have Centos 8 running on wsl in minutes!

UPDATE: If you have WSL2 installed you can't run the docker commands from Powershell. Either run them from command prompt or run them from a linux (Ubuntu), distro within WSL2.
Рекомендации по теме
Комментарии
Автор

If you're doing this on the newly released WSL 2 with Docker Desktop, make sure to run the commands specified in the video inside a simple "Command Prompt" app (which uses cmd.exe), NOT in a "Windows PowerShell" app (which use powershell.exe), or else when you get to the last step that imports the tar as a WSL distribution you will get an error like this:
> wsl --import Centos8 .\CentOSImage .\centos.tar
Unspecified error
BTW, the commands from the video are:
docker pull centos:latest
docker create -i centos bash
docker export [container_id] > centos.tar
wsl --import Centos8 .\CentOSImage\ centos.tar
wsl -d Centos8

fanemanelistu
Автор

Worked in WSL2... Thank you so much!!!

leosahayarajan
Автор

How can you launch it from the windows key menu? If you have multiple distributions installed under wsl.

kerbization
Автор

Can you tell about X11 and graphics support ?

vinaybhaskarchandratre
Автор

This is not working on new publicly released WSL2 with Docker Desktop Stable 2.3.0.2.
wsl --import Centos8 .\CentosImage\ centos.tar
quits with the following : Unspecified error

dataupdater
Автор

Thank you. Do these steps work for redhat?

salemzridette
Автор

how to switch if you dont want to make it default

SaraswotiKhadka