-
Notifications
You must be signed in to change notification settings - Fork 854
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
windows11 wsl2,The WSL_PAC_URL configuration does not take effect #11998
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Closed similar issues:
|
/question I hope developers take a closer look at what I submitted above, thank you |
Diagnostic information
|
/emailed-logs The email has been sent with the subject line windows11 wsl2, The WSL_PAC_URL configuration does not take effect #11998 Please note that check, thank you. |
Diagnostic information
|
hello. thanks for reporting the issue Linux does not support PAC URLs by default, so WSL configures the WSL_PAC_URL env variable so that it can be manually consumed by Linux apps that support using PAC URLs my understanding is that curl does not support PAC URLs let us know if you have any questions |
@CatalinFetoiu
The idea could be to add a virtual network card that intercepts traffic to the PAC server. |
I can also confirm this issue. My functional WPAD is at 192.168.1.6 on my network however the /etc/enviroment settings in the distribution are not being added it seems. I had to manually add them to get access to apt update for example. |
I created a script that you can run once logged in I could not get the environment variables to load when running this from root so you have to run it sudo -E ./autoproy.sh
You must have a wpad (autoproxy server on network ) running and your Windows 11 getting your settings correctly also your WSL must show the proxy info when you run after that you can simply adapt the /etc/environment have a copy of the old one with no proxy for when your on a network without a proxy and $HTTP_PROXY shows nothing and another for your proxy you use Example: proxy on
and one without proxy off
I also attempted to just add the $HTTP_PROXY variable into /etc/environment again it will not use it with export it wants a string. Just an idea and more info on the actutal problem, /etc/environment is not adding any autoproxy info everything else does in WSL. My basic script just replaces the /etc/enviroment with a proxy copy as needed. again it must be run with the -E to keep the user enironment's auto proxy settings for the if else conditional checks so to run the script I created the file edited it with chmod and crown and run it like this when I need it.
crude but a temp fix. I wanted to use an @reboot crontab with it again that requires the user environment and sudo to do the copy over. Any other ideas for a longterm automatic fix? |
What I would like to do is just use the output from echo $HTTP_PROXY that is auto populated with WSL and just place it into /etc/environment like this better /etc/environment
but it wont recognize the system variable that is already generated with auto proxy enabled and populated by way of wpad on the host Windows 11 machine for some reason. |
@JonathanDLee24 thanks for reaching out - can you please elaborate on how /etc/environment is used in your scenario? as you pointed, if the autoProxy WSL setting is enabled, WSL automatically populates env variables such as $HTTP_PROXY with the http proxy information from Windows, but we do not populate /etc/environment |
JonathanDLee24
commented
Jan 25, 2025
via email
•
edited by microsoft-github-policy-service
bot
Loading
edited by microsoft-github-policy-service
bot
/etc/environment is used with apt update and apt upgrade, without setting this it will not work, that also goes with raspberrian os.
…________________________________
|
/etc/environment not only is used with apt get update, apt get upgrade, but apt install. The export http_proxy=ip:port and https_proxy=ip:port must be included in the /etc/environment or the system will not update or install packages inside the Linux instance. I normally manually set them however for this labtop it travels to and from the University and home, to have to manually configure it on and off each time is time consuming on top of time restrictions for class obligations. With it set to auto and it working inside Windows 11, I assumed this would also auto populate. Leading to your right it reflects the items loaded, just not the etc/environment for some reason. Sent from my iPhoneOn Jan 24, 2025, at 19:05, Cătălin Emil Fetoiu ***@***.***> wrote:
@JonathanDLee24 thanks for reaching out - can you please elaborate on how /etc/environment is used in your scenario? as you pointed, if the autoProxy WSL setting is enabled, WSL automatically populates env variables such as $HTTP_PROXY with the http proxy information from Windows, but we do not populate /etc/environment
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@JonathanDLee24 thanks for following up and for the additional context to help our tracking (since this is a different issue than the WSL_PAC_URL originally reported here), could you please open a separate issue and tag me there? thanks! |
Sorry this all resolves around the auto proxy configuration URL so I will not be opening another ticket. This is not a change of scope. This is related to the same problem. Auto proxy should automatically configure those environment variables and it is not doing that. |
Windows Version
Microsoft Windows [版本 10.0.22635.4145]
WSL Version
2.3.17.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-2
Distro Version
Ubuntu 23.10
Other Software
Repro Steps
1、windows .wslconfig
![image](https://private-user-images.githubusercontent.com/11555324/365024109-532a2d6c-b91e-4ed4-b5d0-36846e84341c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzM2MTcsIm5iZiI6MTczOTkzMzMxNywicGF0aCI6Ii8xMTU1NTMyNC8zNjUwMjQxMDktNTMyYTJkNmMtYjkxZS00ZWQ0LWI1ZDAtMzY4NDZlODQzNDFjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxNTc4ZDNhNjBkZjFlZjI2YTkzZDY2MTJmZGQ3NWZlYmQzODRhZmFlNTUwODE3YzVlNjczNGMzNGFkODFkNGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.o_j02jOdKNMvoLMKO8JJtr4MZFYbWtuQXDlrc1r8oLQ)
2、The wsl is started and the WSL_PAC_URL environment variable is found
![image](https://private-user-images.githubusercontent.com/11555324/365024237-b5600ad2-292c-4a29-ac9b-4a82dfc2b8bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzM2MTcsIm5iZiI6MTczOTkzMzMxNywicGF0aCI6Ii8xMTU1NTMyNC8zNjUwMjQyMzctYjU2MDBhZDItMjkyYy00YTI5LWFjOWItNGE4MmRmYzJiOGJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4ZTRkNzAwMTk1NWVjMWQyY2EwZTYzNTE4MDY0OTQ1ODYxM2UyODE1ZGMzNzJiYWM4ZGVlMzgwN2Q1NWE2Y2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.f_C-CA49q0jQGXXmZGJbkg4GvauppsQxzXskRg_xd8o)
3、HTTP_PROXY and HTTPS_PROXY are not set
![image](https://private-user-images.githubusercontent.com/11555324/365024381-8d4abefc-e5d6-450b-93d5-3a5b7b9b5c9c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzM2MTcsIm5iZiI6MTczOTkzMzMxNywicGF0aCI6Ii8xMTU1NTMyNC8zNjUwMjQzODEtOGQ0YWJlZmMtZTVkNi00NTBiLTkzZDUtM2E1YjdiOWI1YzljLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0MWRiNzg0MjY0MjkyNTBlYjBmYjNlN2MyZDcwNDc1OWNlOGNlYWQ5ZGNjYzYwNzVmYWJjZWU1NTY3NjU1OTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hVVoVi0MvGZIlkG_7sWm9RSyGOnTol8Dyga2iRlB3HY)
4、Proxy service is available
![image](https://private-user-images.githubusercontent.com/11555324/365024675-8411e06d-e671-47cc-839d-1ae5b587a283.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzM2MTcsIm5iZiI6MTczOTkzMzMxNywicGF0aCI6Ii8xMTU1NTMyNC8zNjUwMjQ2NzUtODQxMWUwNmQtZTY3MS00N2NjLTgzOWQtMWFlNWI1ODdhMjgzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU0ODZjMTRjNGQ1YTE1YmRiN2E1NTQ1NWZjMWI5MTM1OTQ5MGQxNGZjYzE5NzEzYTU2Mzk2NGNiY2JlNGQ3OWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9-zFdTZlPWKtqUqYpOBszsppUnp2JPx8C4P85R2Mn5I)
5、WSL_PAC_URL is invalid
![image](https://private-user-images.githubusercontent.com/11555324/365024790-707d7261-e687-4781-af6d-133e1e6518c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzM2MTcsIm5iZiI6MTczOTkzMzMxNywicGF0aCI6Ii8xMTU1NTMyNC8zNjUwMjQ3OTAtNzA3ZDcyNjEtZTY4Ny00NzgxLWFmNmQtMTMzZTFlNjUxOGM5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjMTU0OTM4YjFiZTNhYzc3MjgyNTI2ZWFhZDFhODBiYzQyMjJmMWMzN2FjZDVjOTk2YmQ3YWRmZGU2MzY2YjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Pn6egfqz84X5U4KC_xzajbALbgbvG8_s7T57OEw0FTE)
Expected Behavior
For the reason of Chinese GFW, WSL2 needs to automatically implement PAC implementation proxy according to WSL_PAC_URL.
Windows uses ShadowsocksR, which is set to allow Intranet access, and step 4 above proves to be valid.
Actual Behavior
WSL_PAC_URL is invalid
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: