Install Google Chrome on Centos 7

If you have a Centos server and want to install Chrome browser which will display GUI on Windows laptop using X server then follow these steps:

  1. First download and install Mobax terminal software on your laptop from https://mobaxterm.mobatek.net/ . This will provide the X server needed to display the browser on windows.
  2. Enable Google YUM repository

    Create a file called /etc/yum.repos.d/google-chrome.repo and add the following lines of code to it.

    [google-chrome]
    name=google-chrome
    baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
    enabled=1
    gpgcheck=1
    gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
    
    
    3: Install Chrome Web Browser on Centos

    First, check whether the latest version available from the Google’s own repository using following yum command then install it.

    # yum info google-chrome-stable
    # yum install google-chrome-stable
    
    

    4: Starting Chrome Web Browser

    Export the DISPLAY variable to output the browser GUI to windows:On the top right of the Mobax terminal you will see an X-Server icon. Hover over it and it will show you the current DISPLAY ip address like 10.x.x.x:0.0 . Dont stop the X-Server.

$ export DISPLAY=10.x.x.x:0.0

Start browser with non-root user as root will not work.

   $ google-chrome

Welcome screen of Chrome web browser GUI will show on your laptop.

COMMON ERRORS:

If you get the error:

Error: Can’t open display: x.x.x.x:0.0

$ ssh -X -v userid@x.x.x.x

Warning: No xauth data; using fake authentication data for X11 forwarding.

debug1: Requesting X11 forwarding with authentication spoofing.

debug1: Sending environment.

debug1: Sending env LANG = en_US.UTF-8

X11 forwarding request failed on channel 0

To fix Update sshd_config and then

$ systemctl restart sshd as given in below blog:

https://www.cyberciti.biz/faq/how-to-fix-x11-forwarding-request-failed-on-channel-0/

Following setting were updated in /etc/ssh/sshd_config:

X11Forwarding yes

X11UseLocalhost no             [note: this parm is very important else x-forwarding won’t work]

Below command should work now:

# ssh -X -A -p 22 userid@x.x.x.x

# password:

Warning: No xauth data; using fake authentication data for X11 forwarding.

Now run chrome it should display browser:

$google-chrome


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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