1

I am living in a hostel where we get access to internet through LAN ports by connecting to a proxy server. I am running Kali Linux in Oracle VirtualBox and that's where I need internet access.

Here is what is did:

  1. I have changed my network settings in VirtualBox to Bridged Adapter
  2. I checked that the Bridged adapter was working by setting up a proxy connection in Firefox's network setting within the VM (Firefox > Settings > Network Settings > Settings). It was working and I could connect to the internet.
  3. I then reset the network settings because I wanted the proxy setting to be system wide, not just limited to Firefox.
  4. I then tried to set up a proxy connection in Kali Linux by editing the "bash.bashrc" file in "/etc". I basically appended the following to the end of the file "bash.bashrc" in "/etc". The IP address here is obviously an example.

export http_proxy="http://999.99.999.99:8080"

export https_proxy="https://999.99.999.99:8080"

This failed to work, and I cannot connect to internet in the VM.

Can anyone tell me what should I do to set up a system wide proxy?

5
  • Define "Failed to work". Don't just include a link; link rot is a significant problem. Tell us exactly what you did, what you hoped the outcome would be, and what didn't happen. Commented Nov 14, 2022 at 8:22
  • I can think of three or four reasons why what you may have done didn't have the desired outcome, but they all depend on what exactly you did and didn't do. Commented Nov 14, 2022 at 8:22
  • @Shadur I have edited the question a bit. I hope this makes it clearer. Commented Nov 14, 2022 at 11:54
  • Only somewhat. Define "Failed to connect to the internet". I'm assuming you mean that your web browser still isn't showing you the sites you want, but how did you start your web browser? Commented Nov 14, 2022 at 12:34
  • @Shadur I don't understand. Firefox comes pre-installed in Kali Linux and it allows to set up proxy settings just for it, which I used to check if the Bridged Adapter was working. It was working and I could connect to internet through the browser, but I want to access internet through terminal too. So I reset the Firefox proxy settings and am trying to set up a system wide proxy. Commented Nov 14, 2022 at 12:58

1 Answer 1

1

After some clarifications I think I see what's going on.

Changes in /etc/bash.bashrc are not automagically loaded until the next time you log in, and even then they're only loaded for that particular login session.

If you've got a graphical shell going, and then use an editor or a terminal to alter /etc/bash.bashrc to add those proxy variables, they won't be visible to your shell until the next time you launch the entire shell. So you'll need to log out completely and log back in.

You should then also be able to verify whether they were loaded by opening a terminal window and typing echo $http_proxy

10
  • "echo $http_proxy" shows the proxy IP, but I still cannot connect to internet. Commented Nov 14, 2022 at 13:15
  • Please, please for my sanity's sake stop conflating "use my web browser" and "connect to the internet". Have you logged out of your entire desktop session and logged back in? Possibly even rebooted your system? Commented Nov 14, 2022 at 13:29
  • Yes, I did all of those. Commented Nov 14, 2022 at 13:35
  • Test your setup by using - for instance - wget http://www.google.com/ and see if it gets a response. If it does, at least your environment variables are recognized and the problem lies with firefox not honoring them. Commented Nov 14, 2022 at 13:37
  • I think it connected. It says : " Connecting to 172.16.199.40:8080... connected. Proxy request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html" and then 'index.html' saved. Commented Nov 14, 2022 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .