Tuesday, March 10, 2009

Setting up Firefox for Hamster

Hamster requires that your web browser have a separate configuration (proxy 127.0.0.1:1234 and possibly a homepage of http://hamster/). It will also screw up your cookies. Therefore, you need to run a separate instance of the browser.

The simplest way to do this is with "firefox -no-remote -P hamster" (works on Windows and Linux). The "-P" flag means to use the named profile. The "-no-remote" flag means to open a separate instance of Firefox - otherwise it will notice that you have an existence instance and simply add a window to it, using your existing profile.

However, Firefox uses the last opened profile by default. Thus, if you don't want Firefox to use the "hamster" profile, you have to reconfigure your normal Firefox link with the "firefox -P default" option to force it to always open the default profile.

There are also other annoyances with this method as well. I prefer a different option. I create a separate user account called "hamster". On Windows, I right-click on the icon and select "Run as" to run as Hamster. I also add the "-no-remote" flag as well, but "-P" is unnecessary, because it will use the default profile under the "hamster" account.

The Linux equivalent of "runas" is "sudo". To run Firefox under the hamster account, type:

sudo -H -u hamster firefox

You may have to edit the "/etc/sudoers" file. I add the following line so that I don't have to enter a password for the hamster account:

hamster ALL = NOPASSWD: /usr/bin/firefox

There is also the problem that the X Windows display only allows the current user. You need to allow processes running under a different account, such as by running the xhost command:

xhost +local:hamster

Thus, the ideal link for hamster would start the service (if it wasn't running), run xhost, then run sudo to launch Firefox. This assumes that the account for Hamster has already been created, and that Firefox under that account has been configured for a proxy with 127.0.0.1:1234 and a homepage of "http://hamster/".

3 comments:

X-Istence said...

s/chost/xhost/

Robert Graham said...

It's cause I used WinWord.exe to compose the post, so their spell checker encourages me to misspell Unix commands. I fixed it.

Anonymous said...

(first of all im using MSXP SP3)
I have heard that this programs really good, however:
1) i cannot find my adapter even typing the code "ipconfig -all"

2) every time i type in something into adapter, an error message comes up like something has crashed, when asking you to send of the problem to be sorted out. However i always press don't send.

Really stuck here, please email:
phil_iz_me(at)hotmail.co.uk
Much appreciated.