Monday, March 05, 2012

Running Chromium as Root on BT5R2

Well, sort of.

You can't do it.  They (the omnipotent and wise developers of chromium) won't let you.  If you try to run it as root, you'll get this...

You can run it su'd as a regular user while logged in as root, but it takes a little X-Fu to get it done right.  First, create your user with the "adduser" command.  Then, give him access to the X display with the "xhost" command.

Here, our user is called "bob":

xhost +SI:localuser:bob

Now start a terminal session and "su bob".  Then run...

chromium-browser --user-data-dir=/home/bob

...and you're in.

This is not unique to Chromium,  The Tor Browser Bundle for Linux will also not let you run as root, which is a bitch and a half.  This trick will work with Tor as well, but it will bitch about the user's profile.  So far I haven't found (or looked for) an equivalent "user-data-dir" switch.

Chromium isn't in BT5R2 by default, so you need to install it with...

apt-get install chromium-browser

Neither is the Tor Browser Bundle, but I'm sure you can figure out how to install that.  It's as simple as downloading & extracting it.

So anyway, BT5R2 is the best version yet, but as usual I have my complaints.  I won't bore you with them now.

Give me another week.

1 comment:

  1. You can add a shortcut like this:

    su -c "chromium-browser %U --user-data-dir=/home/bob" bob