DEV Community

Discussion on: Install Fedora 37 or earlier on Windows Subsystem for Linux (WSL)

 
bowmanjd profile image
Jonathan Bowman

@timfw , I have made some changes to the article as you suggested, giving a bit more detail about upgrading to WSL version 2 and also detailing multiple options for rootfs download. I don't think this resolves the issue you are identifying, unless perhaps a newer rootfs fixes it?

Thread Thread
 
timfw profile image
TimFW

I used the fedora 32 x64 you linked to here
this is the file name it downloaded Fedora-Container-Base-32-20201205.0.x86_64.tar.xz I used7zip to decompress it to a tar.

Something weird though. The first time I downloaded it the file ended with the .tar.xz. But now since I originally decompressed it everytime I download it comes as just .tar not .tar.xz in the download directory. I assume its because of 7zip already decompressing it to just a .tar. I hate programs deciding for me how to help grrr...

I insured wsl 2 was the default.

I renamed the decompressed .tar to fedora-32-rootfs.tar
I then created the folder mkdir C:\users\username\wsl\fedora

Next imported the .tar to \wsl\fedora with "wsl --import c:\user\username\download\unzip\fedora-32-rootfs.tar c:\user\username\wsl\fedora\"

I checked and confirmed it was installed in that directory.

Next ran "wsl -d fedora" and after a pause it just returns me to the next line standard prompt in PS. I tried running both as user and admin.

I run "wsl -l -running" and it shows fedora default is running.

I check inside ~\wsl\fedora in Win Explorer and it now shows a ext4 virtual drive

But thats it.

Now I went thru the Win Store and downloaded Ubuntu 18.04 LTS and thru whatever auto .msi it installs it with I get an immediate bash window .Windows installs the ubuntu1804.exe in C:\Users\Username\AppData\Local\Microsoft\WindowsApps directory

It also installed a entire user directory set for Ubuntu in C:\Users\Lenovo\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc

Thread Thread
 
timfw profile image
TimFW • Edited

after a reboot

in PS going to ~\wsl\fedora here is the output of a dir cmd

These are c&p of the text in PS:


PS C:\Users\Lenovo\wsl\fedora> dir
Directory: C:\Users\Lenovo\wsl\fedora
Mode LastWriteTime Length Name


-a---- 12/7/2020 12:00 AM 246415360 ext4.vhdx
PS C:\Users\Lenovo\wsl\fedora>


Then a check to confirm no running distributions followed by the "wsl -d fedora" cmd and as you can see it just returns a standard PS Windows prompt.

These are c&p of the text in PS:

PS C:\Users\Lenovo> wsl -l --running
There are no running distributions.
PS C:\Users\Lenovo> wsl -d fedora
PS C:\Users\Lenovo>
PS C:\Users\Lenovo> wsl -l --running
Windows Subsystem for Linux Distributions:
fedora (Default)

PS C:\Users\Lenovo>

No bash window opened nothing

But if I wait about a minute and then rerun the wsl -l --running I get this


PS C:\Users\Lenovo> wsl -d fedora
PS C:\Users\Lenovo> wsl -l --running
Windows Subsystem for Linux Distributions:
fedora (Default)

PS C:\Users\Lenovo>

The Ubuntu thru the store works fine. In fact I just git gcc compiled and produced a binary for CryFS encryption program which is a updated and secured version EncFS.

I just do not get why Fedora installed manually does not work?? It even shows it as a virtually mounted drive.

Thread Thread
 
timfw profile image
TimFW • Edited

Finally SUCCESS!!!!

I took your recommendation about it maybe an issue with the roofs downloaded. I downloaded the one form the docker link you provided.

I terminated and then unregistered the current not working fedora 32 from December 5,your link in here:

"Find the right "xz" file for your platform (likely x86_64). Such as this one for the December 5, 2020 build of Fedora 33. Or, if you were still wanting Fedora 32, this Fedora 32 build from December 5 should work."

Not sure if you updated that when you edited the article. The one from that link prior to it may be bad as its what did not work.

I followed the docker github link to github.com/fedora-cloud/docker-bre...
and it produced a successful install finally.
PS C:\Users\Lenovo>wsl -t fedora
PS C:\Users\Lenovo>wsl --unregister fedora
PS C:\Users\Lenovo>
PS C:\Users\Lenovo> wsl --import fedora c:\Users\Lenovo\wsl\fedora c:\Users\Lenovo\Downloads\fedora-33-rootfs.tar

PS C:\Users\Lenovo> wsl -l
Windows Subsystem for Linux Distributions:

Ubuntu-18.04 (Default)

fedora

PS C:\Users\Lenovo> wsl --set-default fedora
PS C:\Users\Lenovo> wsl -l --running
There are no running distributions.

PS C:\Users\Lenovo> wsl -l --verbose
NAME STATE VERSION

  • fedora Stopped 2

Ubuntu-18.04 Stopped 2

PS C:\Users\Lenovo> wsl -d fedora

[root@Lenovo-THINK Lenovo]#

Yes finally a bash prompt.

Thank you very much Jonathan for a well written set of instructions and improving it. Maybe check that current linked fedora 32 download I mentioned and see if it creates a working rootfs. If it works maybe something got corrupted during my download is all I can think of. I did download it twice though and tried both copies but anything is possible I guess. But no matter I have positive results now thanks to your suggestions.

BTW I am using this to see if Qubes OS Ver 4.0 series can be compiled and binary produced using the Windows linux subsystem. It works 100% on a real Fedora 32+ install with all necessary programs loaded. Want to see if it works here as its a rather complex tool and script system for the build environment.

Again thank you!

Cheers,

Tim

Thread Thread
 
bowmanjd profile image
Jonathan Bowman

Excellent! I am glad it is working for you now. I hope your Qubes OS task goes well.