auto start WM on second VT

auto start WM on second VT

am 08.04.2005 15:24:33 von James Miller

After all those complex problems with sound, let me ask for some help on
something that should be much easier to resolve. It should just be a
matter of automating something I currently do manually. This refers to the
same Debian unstable system I discussed in the sound card thread.

I've become attached to some console programs and had been running them in
a sort of console window manager called "twin" on a second VT. Works
nicely (if you can get the right vga mode to work with your video card)
but there are some inconveniences--for example if you need to run some X
app when you try opening an email attachment or something. The combination
of those two problems led me to consider instead running a lightweight,
console-like WM on that second VT. I decided on ion3, since I've had some
experience with that.

I discovered through some web searching that setting this up to work
"manually" was very easy under Debian. It was easy because Debian
apparently does not use an .xinitrc file found in the user's home dir when
starting up Xwindows on display :0 (hope I've said that at least somewhat
correctly). However if you create an .xinitrc file in your home directory
that points to a valid WM binary on your system, then start Xwindows on
display :1 in a second VT, it will use that .xinitrc file and get the WM
running on the second display. This can be either a second copy of the
same WM or a different WM altogether. One can alternate between the two by
use of the ctrl-alt-F7 and ctrl-alt-F8 keys. An example of the command
line way of doing this is to press ctrl-alt-F2 to get to the second VT and
a (login, then) command prompt. From the prompt, simply issue startx --
:1.

Works fine. The question I'm currently trying to resolve however, is
getting the WM to start up automatically in the second VT. This should
happen either after I log into the system (using xdm), or, short of that,
automatically. I gather it can be done by editing inittab, though I'm not
sure of the exact syntax. I suppose it might also be accomplished by
editing/creating some xdm config file. A third way might involve tweaking
startx. And this is what I'd like to ask advice on.

Finally, my question. Can anyone offer suggestions on ways of getting the
second WM running on display :1 automatically? E.g., after I log in to
xdm? Hope this will be as easy as it seems.

Thanks, James
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: auto start WM on second VT

am 08.04.2005 19:47:12 von Ray Olszewski

At 08:24 AM 4/8/2005 -0500, James Miller wrote:
>After all those complex problems with sound, let me ask for some help on
>something that should be much easier to resolve. It should just be a
>matter of automating something I currently do manually. This refers to the
>same Debian unstable system I discussed in the sound card thread.
>
>I've become attached to some console programs and had been running them in
>a sort of console window manager called "twin" on a second VT. Works
>nicely (if you can get the right vga mode to work with your video card)
>but there are some inconveniences--for example if you need to run some X
>app when you try opening an email attachment or something. The combination
>of those two problems led me to consider instead running a lightweight,
>console-like WM on that second VT. I decided on ion3, since I've had some
>experience with that.
>
>I discovered through some web searching that setting this up to work
>"manually" was very easy under Debian. It was easy because Debian
>apparently does not use an .xinitrc file found in the user's home dir when
>starting up Xwindows on display :0 (hope I've said that at least somewhat
>correctly). However if you create an .xinitrc file in your home directory
>that points to a valid WM binary on your system, then start Xwindows on
>display :1 in a second VT, it will use that .xinitrc file and get the WM
>running on the second display. This can be either a second copy of the
>same WM or a different WM altogether. One can alternate between the two by
>use of the ctrl-alt-F7 and ctrl-alt-F8 keys. An example of the command
>line way of doing this is to press ctrl-alt-F2 to get to the second VT and
>a (login, then) command prompt. From the prompt, simply issue startx -- :1.
>
>Works fine. The question I'm currently trying to resolve however, is
>getting the WM to start up automatically in the second VT. This should
>happen either after I log into the system (using xdm), or, short of that,
>automatically. I gather it can be done by editing inittab, though I'm not
>sure of the exact syntax. I suppose it might also be accomplished by
>editing/creating some xdm config file. A third way might involve tweaking
>startx. And this is what I'd like to ask advice on.
>
>Finally, my question. Can anyone offer suggestions on ways of getting the
>second WM running on display :1 automatically? E.g., after I log in to
>xdm? Hope this will be as easy as it seems.


First, let's clear up a bit of terminology.

In your setup (stock Debian, no matter if Woody, Sarge, or Sid for this
purpose), you have consoles running on VTs 1 to 6. You have xdm, then X
itself after login, running on VT7 (as DISPLAY 0 - DISPLAY is an env
variable that applies only to X sessions, not CLI consoles).

When you do a "startx" from VT2, it actually starts X (as DISPLAY 1) on the
first available VT, which is 8, not 2. (If you switch back to VT2 after you
run startx, you'll still see a console that presents that command, followed
by its output to STDOUT and STDERR, and that you can kill the X session
from with a CTRL-C.)

This is the standard way to start X from a console. If you want the console
available, not tied up, detach the job ("startx &").

There are two basic ways to start X sessions (including a login manager
like xdm or gdm) as part of init:

1. Via an entry in /etc/inittab . I think most mainline distros still do it
this way (I know Slackwere did, using a different runlevel for X-based
inits), but Debian does not.

2. Via an init file. This is how Debian does it, via /etc/init.d/xdm, plus
a symlink fro /etc/rc2.d/ to it.

Debian's approach makes it hard to start 2 X (or xdm) sessions as part of
init, because the script is designed around the xdm session it starts being
unique. To stay with this aproach, you'd need to write a custom script, or
perhaps add some lines to an rclocal script if you've made one (it's not
part of standard Debian).

You *might* be better served by switching to (what I think of as) the
Slackware approach, adding lines to /etc/inittab for consoles 7 and 8 that
run xdm (or actual X logins), and removing the xdm script symlink from your
default runlevel directory. If you want to take this approach, any
Slackware user here should be able to give you a sample of what the inittab
entry should look like ... I *think* is is just --

7:23:respawn:/usr/bin/X11/xdm

-- but I can't be certain because I don't have a working system here that
uses this method of starting xdm, so I'm drawing on a memory that is years old.

PS - Did you give up on the sound card, or get it working? Or are you still
in the process of trying?


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: auto start WM on second VT

am 09.04.2005 03:27:17 von James Miller

On Fri, 8 Apr 2005, Ray Olszewski wrote:

> First, let's clear up a bit of terminology.

Thanks for those clarifications. They clarify both how the terminology is
used as well as what the computer is doing--much needed gap-filling
information for someone like me.

> You *might* be better served by switching to (what I think of as) the
> Slackware approach, adding lines to /etc/inittab for consoles 7 and 8 that
> run xdm (or actual X logins), and removing the xdm script symlink from your
> default runlevel directory. If you want to take this approach, any Slackware
> user here should be able to give you a sample of what the inittab entry
> should look like ... I *think* is is just --
>
> 7:23:respawn:/usr/bin/X11/xdm
>
> -- but I can't be certain because I don't have a working system here that
> uses this method of starting xdm, so I'm drawing on a memory that is years
> old.

I picked around a bit further in /etc/X11/xdm and /usr/X11R6 trying to
figure out how all this works. It's rather mind-boggling trying to puzzle
out how all the relevant files relate to one another, not to mention how
each is supposed to work on its own. Your slackwarish suggestion seems
worth trying. My problem with it the way it stands, though, is that it
invokes xdm, which doesn't give me any sort of menu for chosing between
WM's. It's just a bare login window. If I log into it, I'll get another
Gnome session (my main WM on this machine) rather than the ion3 session I
want. I'll attempt now to puzzle out if there's a way to add other WM's to
some sort of menu, starting with the man page.

> PS - Did you give up on the sound card, or get it working? Or are you still
> in the process of trying?

I've pretty much given up since it managed to completely stump me as well
as the experts via me. It seems to me that, were I finally to succeed with
this card, it would be by defeating the BIOS's settings somehow. And that
would be a lesson likely applicable only to this particular computer/mobo.
That doesn't seem to justify further effort. Before going out and buying a
PCI card though, I do want to try out a real SoundBlaster (16) someone is
sending me. Since these are more clearly Linux-compatible, if it also will
not work, I can rest more fully assured that the BIOS is the source of my
problems with the Soundman card. Thanks for your help on that.

James
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: auto start WM on second VT

am 09.04.2005 04:00:52 von Ray Olszewski

At 08:27 PM 4/8/2005 -0500, James Miller wrote:
[...]
>I picked around a bit further in /etc/X11/xdm and /usr/X11R6 trying to
>figure out how all this works. It's rather mind-boggling trying to puzzle
>out how all the relevant files relate to one another, not to mention how
>each is supposed to work on its own. Your slackwarish suggestion seems
>worth trying. My problem with it the way it stands, though, is that it
>invokes xdm, which doesn't give me any sort of menu for chosing between
>WM's. It's just a bare login window. If I log into it, I'll get another
>Gnome session (my main WM on this machine) rather than the ion3 session I
>want. I'll attempt now to puzzle out if there's a way to add other WM's to
>some sort of menu, starting with the man page.


No menus? This is a Debian system, right? The Debian package manager ...
the package installation scripts, to be more exact ... should be adding
menu choices to the standard X right-click floating menu without your
needing to do anything, working ... as the Marketing Department would say
.... just like magic. (Always remembering that any sufficiently advanced
magic is indistinguishable from technology.)

A standard Debian menu of this sort includes a WindowManagers section that
lets you select among the available WMs.

All this is done by an app whose mane I'm not sure of (maybe "menu"), from
the Debian package "menu". "apt-cache show menu" to see what I'm talking
about, and install it if you haven;t already done so ... it will make your
use of X much more convenient ... at least after you do the login via xdm.

Or, you might approach this by creating a dedicated userid to run this
special WM setup, and use its .xsession file to set things up. Then just
log into that userid in the second xdm, and you're set to go.

Avoiding the xdm step may be possible ... an initab line will run any
program you like ... but offhand I can't tell you how to start an X session
directly. (But try running, say, "top" instead of getty, and you'll see
what I mean for simpler apps.) Your main problem will be assigning an
effective userid to this session (I'm supposing you don't want it running
as root, the way apps started by inittab lines normally run). Becsuewe of
the security problems here,people don't seem to write about this option, so
it may be tricky in ways that are not obvious at first glance.




-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: auto start WM on second VT

am 09.04.2005 04:38:11 von James Miller

On Fri, 8 Apr 2005, Ray Olszewski wrote:

> No menus? This is a Debian system, right? The Debian package manager ... the
> package installation scripts, to be more exact ... should be adding menu
> choices to the standard X right-click floating menu without your needing to
> do anything, working ... as the Marketing Department would say ... just like
> magic. (Always remembering that any sufficiently advanced magic is
> indistinguishable from technology.)
>
> A standard Debian menu of this sort includes a WindowManagers section that
> lets you select among the available WMs.

Yep, standard Debian unstable, installed starting with a netinst CD. The
menu program is installed, and menus are getting updated. Despite this, I
see no WindowManagers section anywhere: maybe the packagers for Gnome
thought no one would ever want to use any other WM after trying Gnome :) ?
Don't see that anywhere--not among the Gnome menu items, nor under the
"Debian" section.

> Or, you might approach this by creating a dedicated userid to run this
> special WM setup, and use its .xsession file to set things up. Then just log
> into that userid in the second xdm, and you're set to go.

I don't see any .xsession file in my user's directory either. In fact, I
created my own .xinitrc file so I could get ion3 on logging in in a
console and running startx -- :1. I couldn't find anything like the file
you mention or .xinitrc when I originally started setting this all up.
There's an .xsession-errors, but no .xsession--neither in my user's, nor
in root's directories. Either Debian has begun doing something different
in this regard or I'm just dense and am not understanding you here or am
overlooking something obvious.

> Avoiding the xdm step may be possible ... an initab line will run any program
> you like ... but offhand I can't tell you how to start an X session directly.
> (But try running, say, "top" instead of getty, and you'll see what I mean for
> simpler apps.) Your main problem will be assigning an effective userid to
> this session (I'm supposing you don't want it running as root, the way apps
> started by inittab lines normally run). Becsuewe of the security problems
> here,people don't seem to write about this option, so it may be tricky in
> ways that are not obvious at first glance.

I knew adding something like 7:23:respawn /usr/X11R6/bin/xinit must be too
easy. It would only work if I made an .xinitrc file in root's home dir.
And I'd be running the session as root then, as you indicated. Which I'd
rather not do.

Maybe I'll just need to break down and install gdm or some other menu'd
session manager. I thought there should be a way to get xdm to give me a
menu of WM's, but looking over the manpage I've become sceptical. The
author says:

LIMITATIONS
One thing that xdm isn't very good at doing is coexisting with other
window systems. To use multiple window systems on the same hardware,
you'll probably be more interested in xinit.

James
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: auto start WM on second VT

am 09.04.2005 05:22:44 von Ray Olszewski

At 09:38 PM 4/8/2005 -0500, James Miller wrote:
[...]
>>A standard Debian menu of this sort includes a WindowManagers section
>>that lets you select among the available WMs.
>
>Yep, standard Debian unstable, installed starting with a netinst CD. The
>menu program is installed, and menus are getting updated. Despite this, I
>see no WindowManagers section anywhere: maybe the packagers for Gnome
>thought no one would ever want to use any other WM after trying Gnome :) ?
>Don't see that anywhere--not among the Gnome menu items, nor under the
>"Debian" section.

Hmmmph! Now I really wish I could see what you're seeing. I don't run
Gnome, but I''ve always had the WindowManagers choice in any WM I did run
.... mainly blackbox and KDE. In Gnome, it would probably be the
next-to-last item in the Debian section. It's where the choice to exit from
X is.


>>Or, you might approach this by creating a dedicated userid to run this
>>special WM setup, and use its .xsession file to set things up. Then just
>>log into that userid in the second xdm, and you're set to go.
>
>I don't see any .xsession file in my user's directory either. In fact, I
>created my own .xinitrc file so I could get ion3 on logging in in a
>console and running startx -- :1. I couldn't find anything like the file
>you mention or .xinitrc when I originally started setting this all up.

I may have misled you here; sorry. None of my X-using users has either of
these files by default either. They are the ones you create if you want
user-spefici customizations, not stock items created from a template the
way that, for example, .bash_profile and .bashrc are.
[...]


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: auto start WM on second VT

am 09.04.2005 05:51:56 von heisspf

Forgot the & after the 2

Hi,

I have never used xdm, gdm or kdm. In fact I hate them. If I want to start X I
type startx. If I want to start X of another WM in another VT I type in the
terminal for example:

startx /usr/bin/gnome-session -- :2& or

startx /opt/kde/bin/startkde -- :2& or whatever WM.

Now you can put this in a small sript may be call it WM2 and start it from a
terminal. That's not automatic as such but I know in Fedora and KDE such
scripts can be started automatically after the WM or desktop is up and running.

Regards
--
Peter



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs