Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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).
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.
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.
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.
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?
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.
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 &
[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]#
[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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.