LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-06-2011, 07:23 AM   #1
sakishrist
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Rep: Reputation: Disabled
Smile How can I change the vt on which GDM starts


Hello,

I would like to ask how to change the virtual terminal on which GDM starts.

Thanks in advance!
 
Old 08-06-2011, 07:40 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
AFAIK it starts on the numerically first unused one. /etc/inittab should have lines similar to
Code:
c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:12345:respawn:/sbin/agetty 38400 tty2 linux
c3:12345:respawn:/sbin/agetty 38400 tty3 linux
c4:12345:respawn:/sbin/agetty 38400 tty4 linux
c5:12345:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux
It doesn't have to be c<n> (labels), 12345 (run levels) or agetty (the executable that displays the login prompt -- but AFAIK they all have getty in their names). Choose the one you want (except c1) and remove the 12345 (or whatever) from the second field. IDK how to use c1 for the GUI login manager; if you remove the 12345 it is not used.
 
Old 08-06-2011, 07:48 AM   #3
sakishrist
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
I am sorry, I forgot to say that my OS is Ubuntu, so I don't think I have /etc/inittab.
 
Old 08-06-2011, 09:24 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Could you be more specific about your need to change the tty being used? There may be other ways of accomplishing your goal.

To address your specific question, look at the README files in /etc/init/ and /etc/init.d/, and the upstart scripts in the directories to which the symbolic links in /etc/init.d/ point. At some point in the initialization process, the X-server is started on a specific pseudo tty, and I suspect that you could change it if to created the appropriate .Xsession:<tty> file, and .Xclient file in you home directory.

Of course, you could just log in to the gdm of tty1 and do a startx -- :2 to start a new X-server on tty7. (But you would need to leave the "parent" session running on the default tty since killing it would kill the "child" server.

Oh, you would also need to add the tty options in the X-server configuration file. I use a file in /etc/X11/xorg.conf.d/ like this
Code:
$ cat /etc/X11/xorg.conf.d/01-allow_zap.conf 
Section "ServerFlags"
  Option    "DontZap" "off"
  Option    "DontVTSwitch" "off"
EndSection
to override the xorg defaults. See man xorg.conf for details. (At one time Ubuntu didn't automaticall install the manual files. If this is still tru, you may need to do an apt-get install man before you can read the manual pages.)
 
Old 08-06-2011, 01:11 PM   #5
sakishrist
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks for the reply.

You asked me to be more specific. I am afraid that I could not go any more specific than this, instead I could present the "bigger picture": I am trying to have a chroot-ed environment and I need it to start from the very beginning, the login screen.

I have succeeded in starting a gnome-session with either the root user or my user, but I could not start the login screen.

I have asked a number of questions regarding the "big picture" on various forums, but I did not get many replies (on some threads none.) So now I am trying to gather the information slowly, by asking individual questions.

So the bottom line is that I "think" I could solve my problem by learning how to start a (second) gdm on a tty other than the tty7. But, if you feel you could help me with my main goal, I will be very glad to hear any ideas

Regarding the case at hand, if I do startx -- :2 (from the host OS) I get a weird session where some things can not be started (like the panels and some programs, I guess that is because a session is already running and locks some things.) Apart from that, this is not exactly what I need. I would like to start from the (graphical) login screen.

Also, there is no folder /etc/X11/xorg.conf.d on my system.

Thanks in advance

Last edited by sakishrist; 08-06-2011 at 01:15 PM.
 
Old 08-06-2011, 02:26 PM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Wouldn't be more straight-forward to just pop whatever you want in the chroot environment into a bootable image and run it a virtual system?

Right now I'm posting this note from a virtual system running Fedora 17 (aka "Rawhide"). Since the system is extremely unstable (Fedora 16 isn't scheduled for Alpha release before September), having it in a virtual system lets me reboot it without rebooting the "real" system, and I can use the [b]guestfish]/b] program to access the virtual hard drives even when the system is not running - or even runable. (A few days ago, a selinux policy change prevented all logons, even "root". But I could edit the selinux settings from the host Fedora 15 system to fix the problem.)

The point I'm trying to make is the using a virtual system instead of a chroot may be an easier and more flexible solution to your problem.
 
Old 08-06-2011, 06:03 PM   #7
sakishrist
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks! By virtual system, do you mean something like using VirtualBox for instance? Wouldn't that be slower?

Anyway, apart from that, I believe you are right. It's just that the reason I want to do it the hard way is for education's sake. I have already learned a lot of interesting things about how the desktop is organized by doing this.

Thanks!
 
Old 08-07-2011, 10:56 AM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Well, Virtual Box is one way to do it.

I usually run Fedora, and the Red Hat "standard" (in quotes because there isn't actually any such thing) is to use qemu to emulate the hardware you want to use, and boot that hardware from the Virtual Manager. In my case, my hardware (an AMD "Athlon II" x4) supports vitalization (as does almost every CPU made in the last four or five years), so the virtual system runs as fast as the host system. (Actually, it runs a bit faster, since I've got enough memory - 16Gb - that the whole virtual system - including its disk drives - can fit into memory, while the "real" system has to use the real disk drives, which are quite a bit slower than RAM.)

But, since you're just trying to learn, you should read the information about the "upstart" system which Ubuntu uses to replace the older Unix System Release 5 "Init" booting method. (Fedora uses a slightly different replacement, with scripts written for dash, a Posix compliant bash variant.)

If you follow the links from /etc/init.d/ to (IIRC) /lib/system you will find the scripts which are run when the system is booted.

One thing to keep in mind when using chroot is that you need to re-run the parts of the scripts in your initial RAM file system image that define the entries in the root file system. Otherwise your chroot system may complain about missing entries.

Have you looked at the various scripts that are available for, for example, setting up restricted shells? I don't know if any of those scripts handle GUI setup, but they might be worth your time to investigate.
 
1 members found this post helpful.
Old 08-08-2011, 02:58 AM   #9
sakishrist
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Hello,

I really didn't know that with Hardware Virtualization the guest could run at the same speed. Thanks

Regarding your last question, I do not know what the restricted shells are so (most probably) I haven't looked at the scripts, but I will try to figure it out and have a look at them.

Thanks a lot!
 
Old 08-08-2011, 11:32 AM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Oops! I'm sorry, I shouldn't have said "restricted shell." That's just a shell that can only run a restricted set of commands. What I should have said was "chroot scripts." In fact, if you just search for those term in the LQ search box you'll find some threads addressing the question.

While this won't help you learn how to do it, you might like to do an apt-get install schroot to get an enhanced chroot command installed. (The source code for schroot is available, but it's not all bash scripting.)
 
  


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
Run a command when GDM starts exodist Linux - Software 1 02-18-2009 10:55 PM
X starts slowly after removing gdm Daravon Ubuntu 5 01-06-2009 11:43 PM
GDM only starts failsafe sessions danns Ubuntu 3 04-20-2006 04:05 PM
all the merged software starts, as i log in using gdm jogurt666 Linux - Distributions 0 05-20-2004 08:54 AM
How to change what programs kde starts up? MadCactus Linux - Software 5 07-28-2003 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:20 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