WhitewaterFoundry / Fedora-Remix-for-WSL

Fedora Remix for Windows Subsystem for Linux.
Other
697 stars 51 forks source link

Can not upgrade.sh or use dnf on Fedora Remix for WSL #149

Open BazTheLinuxGuy opened 2 years ago

BazTheLinuxGuy commented 2 years ago

I have just installed Fedora Remix for WSL on both Windows 11 and Windows 10 (different machines), and I can't use $ upgrade.sh or # dnf... What happens is that no bytes are exchanged, and the ssl timeout of 5 minutes is reached, over and over (when running upgrade.sh, it appears to be an endless loop. It's as if no communication is taking place.

I seem to have network connectivity, I can ping remote sites like www.google.com and "tracert" to remote sites. The resolver seems to be working, and in the larger vista of Windows 11 or 10, communication seems to work just fine. I can brose websites, etc... everything looks normal.

But in Fedora Remix for WSL (2), all of that goes away. Other than ping and "tracert," there seems to be no communication.

To Reproduce Steps to reproduce the behavior: This is what I did:

  1. Buy a new computer with a 10 gen. Intel i7 processor, 16 GB RAM, 1 TB disk, all the usual basic items in a modern computer. With Windows 11 installed. Everything seems to function as you might expect. "Normal".

  2. Install Fedora Remix for WSL. I was advised to do $ upgrade.sh first thing, so that's what I did and that's where my problems started...and are still stuck there.

Expected behavior Typical dnf upgrade actions, with the assistance of working curl and maybe wget.

Screenshots Any screen output just showed "0"'s for all connectivity stats, and in upgrade.sh, I got into an apparently endless loop in which I go the message "ssl timeout" every 5 minutes.

Additional context This is my first attempt to use WSL. I remember trying out Debian on Windows 10, but all I managed was a bash shell, with no package capability and no X Server. I have installed an X Server on Windows 11, but can not use dnf to retrieve any "X" Gui programs, for reasons described above.

Basic Troubleshooting Checklist

[x] I have searched Google for the error message. [x] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. [ ] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. [ ] I have searched the WLinux issues page: https://github.com/WhitewaterFoundry/WLinux/issues. [ ] I have reset WLinux: Settings->Apps->Apps & features->WLinux->Advanced Options->Reset. [x] I have disabled and re-enabled WSL in Windows Features. [x] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted? The same thing on several iterations, and searched on DuckDuckGo for websites that deal with Fedora Remix for WSL issues, including the one recommended by Microsoft, https://www.whitewaterfoundry.com/fedora-remix-for-wsl

Find: Settings->Apps->Apps & features->WLinux->Advanced Options->Version. (Not found in Windows 11)

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here: OS Name: Microsoft Windows 11 Home OS Version: 10.0.22593 N/A Build 22593 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free BIOS Version: AMI F.40, 7/29/2021

image

BazTheLinuxGuy commented 2 years ago

When I said that I had searched for websites to deal with my problem, they all seemed to be closed or out-of-date.

BazTheLinuxGuy commented 2 years ago

I did not mean to close the above issue!

crramirez commented 2 years ago

Hello @BazTheLinuxGuy,

Usually, WSL2 doesn't play very well with VPNs, check if it is your case.

Regards, Carlos

gtirloni commented 2 years ago

In case it's related to VPN, I discovered that OpenVPN works pretty well if I open the tunnel inside WSL. Connecting from the outside (Windows) did not work for me.

BazTheLinuxGuy commented 2 years ago

Thanks!

On Mon, May 16, 2022, 07:32 Giovanni Tirloni @.***> wrote:

In case it's related to VPN, I discovered that OpenVPN works pretty well if I open the tunnel inside WSL. Connecting from the outside (Windows) did not work for me.

— Reply to this email directly, view it on GitHub https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL/issues/149#issuecomment-1127614542, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHCESFXSCNTKCKKCG2XPDULVKI54LANCNFSM5S2KZ75A . You are receiving this because you were mentioned.Message ID: @.***>

FilBot3 commented 1 year ago

What I had to do in WSLv2 for Ubuntu to get it to work with my VPN was to change the contents of /etc/resolv.conf. I had to comment out

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [nettwork]
# generateResolvConf = false

Then I had to add to my /etc/resolv.conf:

search sub.corp.com corp.com
nameserver xxx.xxx.xxx.xxx
nameserver 8.8.8.8
nameserver 8.8.4.4

However, in Fedora Remix for WSL, when I comment that same line out, restart WSL with:

wsl --shutdown

I attempt to write to /etc/resolv.conf or even touch it, and I get:

$ sudo touch /etc/resolv.conf
touch: cannot touch '/etc/resolv.conf': No such file or directory

but I can ls the file. When I vi it, there's no contents, and I cannot write to it.

HOWEVER,

When I make these same chagnes to the /etc/resolv.conf and not restart, the name resolution works on VPN. However, when I restart WSL or the machine, I lose those changes because /etc/resolv.conf is generated again.

gtirloni commented 1 year ago

/etc/resolv.conf is managed automatically by NetworkManager nowadays. You can tell NM to not update that file but that might break other things. Ideally, you should configure your DNS in NM.

filbotblue commented 1 year ago

/etc/resolv.conf is managed automatically by NetworkManager nowadays. You can tell NM to not update that file but that might break other things. Ideally, you should configure your DNS in NM.

How does one do that? When I do what I described in Ubuntu, it works, but Fedora breaks.

filbotblue commented 1 year ago

Ah, I modified the /etc/wsl.conf:

[automount]
enabled = true
options = "metadata,uid=1000,gid=1000,umask=22,fmask=11,case=off"
mountFsTab = true

[network]
generateHosts = true
-- generateResolvConf = true
++ generateResolvConf = false
[user]
default=user01

Then stop WSL.

wsl --shutdown

Then I restarted the WSL Instance with Windows Terminal and deleted the defunct /etc/resolv.conf file.

sudo rm -f /etc/resolv.conf

You can restart the WSL instance if you want, but you can just create the new /etc/resolv.conf and proceed from there.