How to Run Chrome as Root User in Ubuntu

How to Run Chrome as Root User in Ubuntu

 

Google chrome is a browser made by Google. It’s a fast, modern browser for everyone. Google Chrome is available on Ubuntu/Linux, Microsoft’s Windows and Apple’s Mac OS X. So it is really very popular web browser.

On Ubuntu root users by default can’t run Google Chrome. We will fix this issue in this tutorial.

This is a step-by-step tutorial on how to run Google Chrome web browser as root user on Ubuntu. To follow this tutorial, you need to have the following requirements:

  • A computer with Ubuntu operating system installed.
  • Google Chrome web browser must be installed.
  • Must be able to login to as Desktop Environment as root.
  • Basic knowledge of Ubuntu terminal. With basic I mean, how to open a terminal on Ubuntu and how to execute commands. 

Step 1: If you try to run Google Chrome as root user, you will see the following error as shown in the screenshot,

ok

What this error message means is that, you can’t run Google Chrome as root user because you don’t have a place to store Google Chrome profile data for root user. If we can add a profile location for Google Chrome, then we can run it as root user.

Step 2: To fix that, open the Google Chrome configuration file using the following command,

“gedit /opt/google/chrome/google-chrome”

Once the file is opened, scroll down and find the line as marked on the screenshot below,

marked-on-the-screenshot-below

Now change

exec -a “$0” “$HERE/chrome”  “$@”

to

exec -a “$0” “$HERE/chrome”  “$@” –user-data-dir=”$HOME”

now-change

Now save the file and close it.

Step 3: Go to the Unity dash and search “Google”. The Google chrome launcher will show up, click on it.

google

Google Chrome browser will start.

google-chrome-browser-will-start

That’s how you run Google Chrome as root user in Ubuntu operating system.