LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2007, 04:56 PM   #1
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Rep: Reputation: 15
Remote X session for GDM but not at console?


I've searched the how-tos but didnt find anything that appeared to be of the same nature. Is there a way to be at runlevel 3, then when someone attempts to Xwin have the Xserver automatically launch for a GUI?

We're trying to accomplish the following

We have a squid proxy server running RHEL 4 that we'd like 99% of the time to run in text only mode. On the off chance we want to administer it, my boss doesn't want to go in and switch to RL 5....but would rather simply automatically trigger the session to open and close when you Xwin to it without having the graphical console loaded all the time.

Can this be done, and if so can someone point me in the right direction? Thank you.
 
Old 01-29-2007, 05:59 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Seems like I just read something like about 2 weeks ago but it eludes me. One thought is a not a full X server running but something crude in design. Check LBX (Low Bandwidth X).

edit:
This is what I was thinking of. http://www.xfree86.org/4.0.1/Xvfb.1.html
Also something called x0rfbserver.
edit:

Brian

Last edited by Brian1; 01-29-2007 at 06:04 PM.
 
Old 01-29-2007, 06:02 PM   #3
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
If you are remotely administering the system, you don't need to run the X-server. Presumably your remote system has an X server, and that's all that is needed to run X applications remotely.

I think you are confused about how X works. You only need the X server where the application windows will display.

For example, you have a server (at runlevel 3, multi-user text mode). From a remote system (which is running X), you can:

- ssh to the server (with the -X or -Y option to forward X traffic),
- start an X application, for example, system-config-users

The window for system-config-users will appear on the remote system.

At the local console of the server, you can perform any configuration that you want, using text-mode. No X is required for administration. If you want X locally, just log in as root and run the command "startx". This will temporarily start the X server. When you end the session, it will exit.

Last edited by macemoneta; 01-29-2007 at 06:06 PM.
 
Old 01-29-2007, 06:13 PM   #4
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Original Poster
Rep: Reputation: 15
I guess I am confused then. I'm fine with text based administration but he wants the GUI to run when he runs Xwin to connect to the proxy "machine". We also want the console itself to stay in runlevel 3.

Connecting, running a command, then running the xwin session was not acceptable to him. Is this even technically possible?

Disclaimer: I haven't fully read Brian1's response yet URL yet.
 
Old 01-29-2007, 06:33 PM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Just to clarify, when you are talking about 'xwin', you are referring to the Windows Xwin32 application? If so, then that is the X server, running on the Windows machine (you don't need any change on the server side). He must connect to a destination machine to run an application. The X server can't know where he wants to go. What if you have 20 servers (or 20,000) - how would the X server know what session to start?

If you want to automate connection and running some application, have your boss use a Linux machine. You can create an icon for him/her using a command like:

ssh -X user@host somecommand

That will connect to 'host' as 'user', and run the command 'somecommand' which will display on the local X server.

If Xwin32 has that functionality, you can set up something similar then. If not, use the free Cygwin utilities to accomplish it.
 
Old 02-05-2007, 12:05 PM   #6
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Original Poster
Rep: Reputation: 15
Well, heres the solution I've come up with. Reading and reading it appears that XDMCP will not work unless you ARE in runlevel 5, so I've set up key based authentication with puttygen and pageant and will send a remote login with the "init 5 " command when he launches a wrapper for xwin 32 before launching his session. Hopefully when he closes xwin I'll do the same, only init 3 when it closes.

Unless I'm just way off here and there is an easier solution out there?
 
Old 02-05-2007, 12:20 PM   #7
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Why are you using XDMCP?

To get a login screen? That seems unnecessary, since authentication has already occurred.

To get a remote desktop? There are easier ways to do that, and you don't need to run X on the server. Create a script on the server login containing:

Code:
#!/bin/bash
vncserver -geometry 1024x768 -depth 24 :4
vncviewer :4
vncserver -kill :4
If the above script is called 'gui', then login remotely with:

ssh -X user@host gui

A window with the remote desktop will appear. Again, there is no reason to run X on the server to use X remotely.
 
Old 02-05-2007, 12:26 PM   #8
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Original Poster
Rep: Reputation: 15
Okay maybe I should back up.

Our goal is to provide a GUI to a windows workstation without having the GUI always consuming resources on the server console.

Our distro is RHEL 4, in the nearly default configuration (with SQUID and webmin installed are the only changes)

Our current tool in the past for getting remote 'sessions' loaded was through the program Xwin32.


In which way would it be easiest to provide this experience?

Last edited by gallwapa; 02-05-2007 at 12:29 PM.
 
Old 02-05-2007, 12:36 PM   #9
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You need to be more precise. If you want a GUI which displays a desktop for a remote Linux system (on any X capable platform), then #7 is the most secure, lowest resource, easiest to create implementation. An end user can do this themselves, no administrator support required.

If you want something else, please try to describe it.
 
Old 02-05-2007, 12:44 PM   #10
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Original Poster
Rep: Reputation: 15
Where do I place the "gui" script? the users home directory?
 
Old 02-05-2007, 12:58 PM   #11
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You can place it anywhere that you normally keep locally created executables. For example, an end-user may have a ~/bin directory, or if you want to make it available system-wide, you may put it in /usr/local/bin/.

The first time you run the script, you'll be presented with a prompt to create a secondary password. It really doesn't matter much, because this is only executed after an authenticated login. The initial desktop you get will be very spartan. Close the window and you will find a ~/.vnc/xstartup file on the users's login. If you edit it you'll see:

Code:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Uncomment the two lines as instructed:

Code:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
The user will now see their regular desktop.
 
Old 02-05-2007, 01:08 PM   #12
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Original Poster
Rep: Reputation: 15
Okay,

Now I'm getting

Code:
[root@server root]# gui

New 'server:4 (root)' desktop is server:4

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bserver:4.log

/usr/local/bin/gui: line 3: vncviewer: command not found
Killing Xvnc process ID 24595
[root@server root]#
I take it because VNC viewer isn't installed?
 
Old 02-05-2007, 01:26 PM   #13
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Yes:

yum install vnc
 
Old 02-05-2007, 01:37 PM   #14
gallwapa
LQ Newbie
 
Registered: Oct 2005
Distribution: RHEL, SLE
Posts: 28

Original Poster
Rep: Reputation: 15
Code:
[root@server root]# yum install vnc
-bash: yum: command not found
[root@server root]#


I looked through the graphical "add / remove applications" and I didn't see it listed. Redhats version of that app has a long way to go to compete with YaST, imho, as far as the gui is concerned.

Can I use RPM?
 
Old 02-05-2007, 04:04 PM   #15
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
If you are not using yum, you can use the default package manager on RH, up2date:

up2date -i vnc

Take some time to familiarize yourself with the administration of the system. Redhat has a considerable amount of documentation online.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse 10.2 Remote Desktop Console Session JET-33 SUSE / openSUSE 2 03-14-2009 03:35 PM
Default session in gdm Komakino Linux - Software 3 09-04-2004 07:37 AM
gdm overwrites /etc/gdm/Session/fluxbox _flaab_ Mandriva 0 12-21-2003 10:58 AM
GDM Session in 2.4 arthurzap Linux - Software 0 10-01-2003 08:06 AM
add a session to Session of gdm freenet Linux - Software 0 08-07-2003 05:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:07 PM.

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