How do I create: centos_rootfs.tar to use for wsl --import

General support questions
Post Reply
devlocalca
Posts: 10
Joined: 2019/06/28 05:58:41

How do I create: centos_rootfs.tar to use for wsl --import

Post by devlocalca » 2019/07/06 02:29:31

I want to run CentOS 7.1905 under Windows Subsystem for Linux ( WSL ).

Nothing I have downloaded so far will work with

Code: Select all

wsl --import
I want to be able to create my own 'rootfs.tar' of CentOS 7.1905 to use with the import command, if anyone can please help.

Downloading this file:

Code: Select all

wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1905.raw.tar.gz
Does not work with this command, in a Windows .bat file (no error is given when running the .bat file, but when running, I can't run the distribution, no error is given when trying to run the distribution):

Code: Select all

rem wsl.exe --import <DistributionName> <InstallLocation> <FileName>
wsl --import centos_7.6.1905 c:\wsl\centos\7.6.1905 g:\downloads\centos\CentOS-7-x86_64-GenericCloud-1905.raw.tar
When I do that, and try to run:

Code: Select all

wsl.exe --distribution centos_7.6.1905
Nothing happens, and in the <InstallLocation>, the .raw files is put there, and not expanded.

Running:

Code: Select all

wsl --list --all
will show the distribution was successfully created, but it does not open a terminal window, or bash shell when I run, as I would expect.

Ultimately, going forward, I want to be able to roll my own 'rootfs.tar', on any given CentOS release to be able to run under WSL, if anyone has done this.

thank you!

Post Reply