Laurent Hinoul

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - John F. Woods

How to enable proxy on Linux in VirtualBox

At my work, I installed Linux Ubuntu on VirtualBox but when I run the virtual machine, I could not get on the internet. After some time, I finally got it working and I would like to share my solution with you.

First of all, you have to question yourself: could the proxy be the problem or my VirtualBox settings? In my case, it was the proxy. If your not behind a proxy, I’m sorry but this tutorial is not for you 🙁 If you do, you are a lucky guy 😀 let us start!

Luckily, we don’t need to change VirtualBox settings. I just use NAT as network adapter. So all the configuration will be done in Ubuntu.

First, startup you Ubuntu VirtualBox, then press Ctrl + Alt + T and the terminal will open. Enter the following commands:

At the bottom of that file, add the following lines:

After you did that, press Ctrl + O, Enter, Ctrl + X. Next, we do the same in another file.

At the bottom of that file, add the following lines:

After you did that, press Ctrl + O, Enter, Ctrl + X again. Finally, we need to manipulate the last file:

Add the following lines:

Again, press Ctrl + O, Enter, Ctrl + X and your done! :D. Now reboot and enjoy internet.

NOTE! add the https settings, you need to add a http url and not the https url

2 comments for “How to enable proxy on Linux in VirtualBox

  1. Nik
    14/07/2017 at 07:32

    Thank you so much! You helped me to revive internet in my linux terminal.

  2. qay
    20/07/2017 at 15:06

    Good, I was aware of /etc/apt/apt.conf but not of 2 others and this stuck me for hours.
    It seems a reboot is necessary, not sure.
    IMPORTANT: Finish each line by a “/” (http://myproxy:8080/“)

Leave a Reply

%d bloggers like this: