Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo apt update Fails in WSL2 #6748

Closed
adamgranthendry opened this issue Apr 3, 2021 · 6 comments
Closed

sudo apt update Fails in WSL2 #6748

adamgranthendry opened this issue Apr 3, 2021 · 6 comments

Comments

@adamgranthendry
Copy link

Environment

Windows build number: 10.0.18363.1440
Your Distribution version: 19.04
Whether the issue is on WSL 2 and/or WSL 1: Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020

Steps to reproduce

  1. I am on a corporate computer and am not permitted to upgrade Windows 10 beyond Version 1909 (OS Build 18363.1440). I am also not permitted to use the Windows Insiders Build.
  2. Our company uses the Juniper PulseSecure VPN (Version 9.1.7 (2525))
  3. I have installed WSL 2 and Ubuntu 18.04-LTS on my machine.
  4. I attempt to run the following

sudo apt update

which yields a Connection failed error for

http://archive.ubuntu.com/ubuntu bionic InRelease

  1. I have attempted writing /etc/resolv.conf as
nameserver **.**.***.***
search corporate.proxy.address.com

where the *s are number placeholders (I have entered the appropriate IP and url's corresponding to my company's DNS/proxy). The appropriate nameservers were determined by running the following in PowerShell:

Get-DnsClientServerAddress -AddressFamily ipv4 | Select-Object -ExpandProperty ServerAddresses

I have also set /etc/wsl.conf to

[network]
generateResolvConf = false
  1. Per Github cloning error in wsl2 (driver MTU) #4253, I have tried setting the MTU equal to that of our VPN interface (1500) as follows:

sudo ifconfig eth0 mtu 1500

  1. Per Updates don't work on WSL2 #5061, I have tried running the following in PowerShell:

New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow

  1. Per No network connection in any distribution under WSL 2 #5336, I have tried this in Command Prompt as Admin:
wsl --shutdown
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

and then restarted my PC.

  1. Per Updates don't work on WSL2 #5061, I have tried creating a proxy.conf in /etc/apt/apt.conf.d with the following lines:
Acquire {
     HTTP::proxy "http://corporate.proxy.address.com:port";
     HTTPS::proxy "http://corporate.proxy.address.com:port";
}
  1. I have tried running the WSL2-Net-Fix.ps1 script from this gist

  2. I can successfully run ping 8.8.8.8 and ping archive.ubuntu.com

  3. Get-NetAdapter in PowerShell shows vEthernet (WSL) is up.

  4. I have disabled and re-enabled each of the Hyper-V Virtual Switch Extension Adapter's in Device Manager.

  5. Per this gist, I have tried running the following in PowerShell:

PS> Get-NetIPInterface -InterfaceAlias "vEthernet (WSL)" | Set-NetIPInterface -InterfaceMetric 1 
PS> Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect"} | Set-NetIPInterface -InterfaceMetric 6000

Nothing has worked so far.

WSL logs:

Expected behavior

sudo apt update works as expected (updates apt)

Actual behavior

sudo apt update fails

Requests:

  1. Has this issue been fixed?
  2. If it has, can the solution be backported to those using the same Versions of Windows 10 (non-Insider's Edition)?
@adamgranthendry
Copy link
Author

As an additional item,

  1. What is the minimal build of Windows 10 where this issue does not surface for WSL 2?

@therealkenc
Copy link
Collaborator

PulseSecure landing zone is /dupe #5068

@ghost
Copy link

ghost commented Apr 5, 2021

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@adamgranthendry
Copy link
Author

@therealkenc and @msftdata Please also note, our company uses Blue Coat Unified Agent and CrowdStrike. This issue is still occuring for me when I am explicitly off Pulse Secure. I just wanted to update my issue to include that info.

@j0nimost
Copy link

Setting the version worked for me wsl --set-version Ubuntu-20.04 1

@xbmlz
Copy link

xbmlz commented Jul 5, 2024

if you use vpn proxy, ni needed rm -rf /etc/apt/apt.conf.d/proxy.conf

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants