-
Notifications
You must be signed in to change notification settings - Fork 797
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
Running behind corporate proxy #1570
Comments
@barryb20 - Thanks for your post and feedback. For future posts, please use the format in contributing.md. Regarding this post, what browser proxy settings are you looking to extend to the bash shell, during installation? |
Yes, facing the same problem and unable to set the proxy on the shell and henceforth unable to use apt commands. Also apt.conf file is missing. It would be great if we could extend the system proxy or from a browser (ex: Chrome, Firefox or IE) to the bash shell. |
@sunilmut The proxy configuration for the APT process to access the Ubuntu servers during initial setup. The linuxsubsystem is downloaded from the Store, extracted then hangs as the APT process is attempting to do something in the background. @agrocks23 I did the steps below once I was in the BASH shell, Ihad to end task on APT post the initial file extraction pre the user configuration. Acquire::http::Proxy "http://yourproxyaddress:proxyport"; |
@agrocks23 yeah it confused me too mate, you need to create it as a new file, Try sudo nano apt.conf or if your really brave sudo vi apt.conf (it was so long since I used vi I had to Google the quit cmd lol I had it right but the wrong way round) If no authentication required: Acquire::http::Proxy "http://yourproxyaddress:proxyport"; Authentication required: http_proxy=http://username:password@yourproxyaddress:proxyport then save the file one you put your proxy settings in it. Be warned however if your proxy needs authentication you will need to place your username and the password for said authentication in the apt.conf file and it is plain text. Barry |
what's work for me : |
@eliohann thanks, but unfortunately that doesn't resolve my initial configuration hang issue prior to the configuration of the username and password. |
Thanks @barryb20. I have opened a bug on this. |
I had this issue too, and it was worse than just not being able to run behind the proxy, but that I couldn't even install the distribution at all. I only happened to try this again while at home and found that it did work at that time. I wouldn't have been able to follow the suggestion on changing the |
@klauern Yeah I created a document for our Devs to let them know there is no issue on a none corporate (dirty) Internet connection, and to end the APT task when in the office. It could be that your office proxy is blocking the Microsoft Store / Updates where it is pulling the shell down from. Check if either are blocked. |
Hi everyone,
Thanks! |
Hello @JasonLinMS 1. do
|
@klauern Thanks, for the failure to run the installer, do you know if the installer tarball is failing to download? Or if the tarball is downloaded and extracted, but the next step (running apt) fails to run. It should be easy to tell based on the messages in bash.exe during installation. |
Look at @barryb20 response above |
@JasonLinMS - I don't believe the installer tarball is failing to download, but what I see is the following:
I think it's more that APT attempts to do some post-install configuration before you can get anywhere, and that is hanging up. |
Thanks everyone for the comments.
Let us know if there are any further issues with installation in Insider build 14986+. |
Thanks @JasonLinMS we will download and test. |
Setting proxy environment variables in /etc/environment doesn't work for me. They do not get picked up from what I see when running |
@luchsamapparat -- regarding getting a login shell, see #816 |
Thanks, that works when using ~/.profile |
I had problems to connect also. Moreover our corporate proxy uses the white list of allowed urls where I need to collect what this Ubuntu wants. And the latest solution to above listed was to set IPv4 only:
add this string into:
|
Using the Ubuntu distro, this was my solution to get around my work proxy, as gleaned from various comments here and help on some Q&A sites like Ask Ubuntu:
I then entered the following text (use your own proxy/port number). This did not work until including the semicolon.
Then CTRL X to end the editing, Y to save, and ENTER to close out nano. I could then run If you're going to be using other tools/CLIs that use the internet, you'll probably need to do this too:
Then add the following two lines. If you don't have a special https-specific proxy, just re-use the http proxy.
Then exit your current terminal/console session and start a new one, and many apps checking for those env-vars will start using them ad-hoc. |
It would be nice if we could use WSL behind a NTLM proxy without tools like CNTLM, any chance of that ever happening? |
I just set up WSL using powershell only with this: |
I was running into a similar issue behind a corporate proxy. I have CNTLM running on my machine and setup APT to route through it (adding Acquire::http:: to the apt.conf file). However I would get 404s trying to do apt installs and it was saying it couldn't find my CNTLM proxy (the IP[127.0.0.1:3128 404] error). I set the http_proxy environment variables and was able to verify wget and curl worked as expected and could retrieve files from archive.ubuntu.com . After much digging I came across this thread and the solution above from diev (ForceIPV4) fixed it. |
I will provide my solution that works for me. Acquire::http::Proxy "http://user:password@server_addr:port"; After that add another setting in ~/.wgetrc file After that try to install the visual studio code plugin for remote wsl. |
Is there a way or any plan from Microsoft to not enter username and password into clear text files on WSL to use proxy with authentication (like it works on Windows)? It is extremely insecure and usually violates corporate security policies. So, it is not just dangerous, but can cost someone’s job. |
How do I check my proxy server and port on WSL2? Or do I need to create a proxy server with squid or something? |
Thanks, work like a charm ✨ |
You can also use:
|
Hi ! Please try the AutoProxy setting that we've added in WSL. Those should greatly improve compatibility with VPN's. If the issue still remains, please reopen this issue. |
Hi,
It would appear IE's proxy settings are not made available to the BASH shell, is this by design?
This causes the APT process post the initial extraction of the subsystem to hang and thus the apt process must be killed to allow you to configure the username etc.
So what does this mean for the environment if anything?
As it is not in place there is no way to populate the apt.conf file with proxy information and the file does not exist even post configuring the user etc.
FYI : adding the configuration post user configuration an populating the proxy information apt work as desired, but the original issue obviously is still present.
Win 10.0.14393
Barry
The text was updated successfully, but these errors were encountered: