LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-22-2015, 12:56 PM   #1
Manashb18
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Rep: Reputation: Disabled
How can we execute Firefox on Centos through SSH?


As we know Centos has no display and to execute a GUI Application like Firefox display is required. Therefore I have installed Xbfb to configure a virtual display and execute Firefox headless. Also put a shell script in /etc/init.d/ to start the Xvfb at Server start. But when I try to run Firefox getting following error message- Cannot open display localhost:10.0. Any idea?
 
Old 11-22-2015, 01:42 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
As we know Centos has no display and to execute a GUI Application like Firefox display is required
yes and no

xorg and a desktop manager ( default is gnome2 ) can be installed and used


what software are you using to remote log in and from what OS

putty is a common program to use

but running firefox ON your local system would be much easier

Last edited by John VV; 11-22-2015 at 01:43 PM.
 
Old 11-22-2015, 11:22 PM   #3
Manashb18
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Xorg and GNOME are installed.
Software used for login - Putty (X11 forwarding enable) and from Ubuntu OS.
Why do i need to execute Firefox remotely- In order to execute the selenium scripts.
 
Old 11-22-2015, 11:40 PM   #4
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 751

Rep: Reputation: 156Reputation: 156
try

Quote:
ssh -X user@10.1.2.33 firefox -no-remote
This works from Fedora to Centos.

Another method is to wrap quotes around the command. Both seem to work

Quote:
ssh -X user@10.1.2.33 "firefox -no-remote"
 
Old 11-23-2015, 10:16 AM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by Manashb18 View Post
As we know Centos has no display and to execute a GUI Application like Firefox display is required. Therefore I have installed Xbfb to configure a virtual display and execute Firefox headless.
That is completely unnecessary. Shut off the virtual frame buffer, don't mess with your DISPLAY environment variable, open a terminal on your Ubuntu machine, ssh into the CentOS machine with "ssh -X", then run whatever GUI applications you want.

The CentOS machine does not need a display to do this (but it does of course need firefox and all of its dependencies to be installed), YOUR MACHINE and YOUR X SERVER are the display for the X applications you launch.
 
Old 11-25-2015, 12:24 AM   #6
Manashb18
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanx Timl, ssh -X user@10.1.2.33 firefox it is working fine. Even -no-remote is not required.
Agree with Suicidaleggroll, but suppose we need to execute GUI application on server through Jenkins. Then, is it possible without Xvfb.
 
Old 11-25-2015, 08:40 AM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
I have no experience with Jenkins, but it's exceedingly rare to find a GUI program that does not work with SSH X forwarding. The only time I've ever needed to use a virtual frame buffer was when I needed to launch a program with a GUI splash screen automatically on boot without anybody logging into the machine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with wrapper for ssh which execute ssh. jayantkp Linux - Newbie 4 05-28-2012 04:57 AM
Using 'say' to login SSH and execute command KavithaAshok Linux - Newbie 1 03-25-2010 08:06 PM
firefox cannot execute SPo2 Linux - General 5 01-15-2007 07:08 PM
how do i execute binary on ssh login? fobster Linux - General 5 05-26-2006 06:00 PM
Firefox failed to execute bachew Linux - Software 3 02-20-2005 09:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration