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, you have to question yourself: could the proxy be the problem or my VirtualBox settings? In my case, it was the proxy. If you’re 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 your 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 you’re done! :D. Now reboot and enjoy internet.

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

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: