How to Configure Proxy Settings in Linux

How to Configure Proxy Settings in Linux


Here are two different ways to configure Linux to recognize a proxy server or proxy configuration file.

Export Command for Proxy Environment Variables

Personal kneeling in stone tunnel, photo credit jondoe via flickr

photo credit: jondoe

Use the following commands to configure your proxy for http and ftp traffic on the command line
export http_proxy=http://: export ftp_proxy=http://:

If your proxy requires login/authentication, you can use the format:
export http_proxy=http://username:password@::

To have this applied every time you log in, place these lines in your .bashrc in your home (~) directory.
export http_proxy=http://:
export ftp_proxy=http://:

Network Proxy Settings

For GNOME, go to Computer->Desktop Preferences->Network Proxy
For KDE desktop manager, you can get to the network proxy settings under System Settings > Network Settings > Proxy

In the setting, you can configure either by your proxy server and port, by the network, or a file via a URL/file location (e.g. http://myproxyserver:port/proxyfile.pac) .

These settings work with most other applications (e.g. other browsers like Chrome, OS commands).

Program/Application Level

Some applications and commands need to be configured individually. Below are some common examples.

Firefox

You can manually set up the Firefox proxy in Options menu. Go to Options > Advanced > Settings.

Fedora – Yum Package Manager

yum proxy settings can be found in the file system at
/etc/yum.conf

Add a line to the file with the following information:
proxy=http://:
The next time you run yum, it will pick up that proxy.

For Ubuntu

Here is a similar how to article on configuring proxy settings in Ubuntu covering Synaptic Package Manager, Gnome, apt-get, and Firefox.

Advertisements
Installing VirtualBox guest additions on Fedora

Installing VirtualBox guest additions on Fedora


Happy Holidays!

This celebration season post covers installation of the VirtualBox guest additions on Fedora while using yum to update the kernel sources.

The steps were tested in Fedora 13 (GNOME), Fedora 14 (GNOME), and Fedora 15 (XFCE and KDE). A common problem in installing the guest additions on a new copy of Fedora is the guest additions install will complain about missing kernel sources. These steps show how to update the kernel sources to fix this problem and allow a successful install of the guest additions.

OS Set Up and Installation of Guest Additions

1) First update the kernel by typing following command.

yum -y update kernel 

The latest kernel will be downloaded and updated.

2) Type following command after the kernel update.

yum -y install kernel-devel kernel-headers dkms gcc gcc-c++ 

After that, restart the Fedora virtual machine (VM).

3) Go to devices in VirtualBox console and select Install Guest additions.

This action will mount the VirtualBox guest additions and it will be visible on your desktop if it mounted successfully. Alternatively, you can find it in the file system (e.g. /media/VBox Additions CD).

4) Open a console terminal. Change directory to the Vboxadditions CD and run the following command.

sudo sh VBoxLinuxAdditions.run 

Note: To run sudo you must be part of the /etc/sudoers file – e.g.

# User privilege specification
yourusername    ALL=(ALL) ALL

or part of a Unix/Linux administration group.

5) It is possible after running the VirtualBox additions that you still need to install the current kernel-devel (files used for building kernel modules) in yum. In which case, the VBox additions install will tell you what to install (see an example below). After installing the kernel-devel, try running the VirtualBox additions installation again (sudo sh VBoxLinuxAdditions).

Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were 
not found. 
If the following module compilation fails then 
this could be the reason.
The missing package can be probably be installed with
yum install kernel-devel-2.6.32-100.28.5.el6.x86_64

Check the installation log to verify everything works.

Shared Folders

If you’re using shared folders, check the VirtualBox documentation on using them. Usually the thing you have to do after setting up your host to share folders with the Fedora guest is to add the Linux user you are using to the vboxsf user group.

for example, use the command:

usermod -a -G vboxsf your_user_name

After adding your account to the vboxsf group, logout and then login again. You should be able to access the shared folders in the /media/ folder.

Add a user to a group

Usermod is a command to change a user’s account settings.To add a user to a group, use the following:
$ usermod -a -G newGroup username
Make sure to use the -a option so the user is added to newGroup while continuing to be a member of other groups. Otherwise the user is removed from all groups and only added to newGroup.