LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Mystery of the disappearing virtual terminals (https://www.linuxquestions.org/questions/slackware-14/mystery-of-the-disappearing-virtual-terminals-382070/)

adityavpratap 11-11-2005 05:44 AM

Mystery of the disappearing virtual terminals
 
Hello,
I am having a strange problem. I am using Slackware 10.1. My desktop is XFCE. Everything is working fine except that I am unable to access the virtual desktops. When I press ctrl+alt+[F1 ... F7] nothing happens. Any idea what could be wrong?

Nobber 11-11-2005 06:07 AM

If you use an X display manager, VTs 1-5 are missing by default, but VT6 is there. Are you sure Ctrl-Alt-F6 doesn't give you a virtual terminal?

adityavpratap 11-11-2005 06:33 AM

Quote:

Are you sure Ctrl-Alt-F6 doesn't give you a virtual terminal?
Actually, it used to drop me to a virtual terminal. But it no longer does that. I don't know when exactly it stopped but today when I tried to go to a virtual terminal, I was unable to do so.

piete 11-11-2005 12:54 PM

A friend of mine had this problem a lot when he got set up - we found the problem related to xorg.conf keyboard setup! If you have the wrong keyboard map, your F-keys might not be responding in quite the correct way. We changed the layout and voila, fixx0red.

- Piete.

Oholiab 11-11-2005 01:43 PM

I'm having a similar problem... None of mine will show after I start X, but they work before. I'm using runlevel 3, so in theory they should all show. I've tried all of them.

Woodsman 11-11-2005 03:26 PM

I use Slackware 10.1 and KDE 3.3.2. I don't know if the following explanation will help you:

Unless specifically instructed, X assigns the first vt number in sequence with the number of existing tty consoles. If 3 tty consoles are enabled in /etc/inittab, then X assigns the next virtual terminal to vt4. Most people never reduce the six tty consoles that most distros provide in /etc/inittab. Typically, then, the next available virtual terminal is vt7. But even if inittab is modified for fewer than 6 tty consoles, the subsequent Ctrl-Alt-Fn keyboard shortcut assignment corresponds with the assigned vt number. For most people the vt keyboard assignments will be Ctrl-Alt-F7 through F12 because 6 ttys are enabled.

On my box, however, for an example, I have disabled tty 4 through 6. This is a single user box and I have no need for more than 3 ttys. Thus, by default X assigns the keyboard shortcuts as Ctrl-Alt-F4, F5, and F6.

But one can circumvent this automatic assignment. In the startx script or, if using XDM or KDM, modify the Xservers file (XDM: /etc/X11/xinit; KDM: /opt/kde/share/config/kdm) to forcibly assign the vt terminal to the associated DISPLAY number. For example, in my Xservers file:

:0 local@tty1 /usr/X11R6/bin/X :0 vt7 -ac -nolisten tcp
:1 local@tty2 reserve /usr/X11R6/bin/X :1 vt8 -ac -nolisten tcp


Notice the forced assignment of the vt number, despite me using only three ttys. My script entries override the usual assignment to vt4 through vt 6 (with only three ttys enabled). I reassign the vt number to help me maintain consistency with all of those conventional 6 tty boxes.

In startx (/usr/X11R6/bin):

xinit $client $clientargs -- $server :$DISPLAY vt$VT $serverargs 2>/dev/null

And further up in the script I added some code to use a vt number that corresponds to the way I configured the Xservers file. (I simply add 7 to the DISPLAY number.)

This explanation probably does not explain why your particular keyboard shortcuts are failing, but at least explains how the vt number is derived by X.

Quote:

If you use an X display manager, VTs 1-5 are missing by default, but VT6 is there.
This is only because of the way PV cripples /etc/inittab by default. For most people coming from a conventional desktop environment, Slackware is not user-friendly out of the box. Here is how PV packages /etc/inittab:

c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:1235:respawn:/sbin/agetty 38400 tty3 linux
c4:1235:respawn:/sbin/agetty 38400 tty4 linux
c5:1235:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux


Those sequential numbers represent run-levels. That is, those numbers represent the run-levels in which the tty is enabled and available. Notice that in run-level 4 PV disables tty1 through tty5. Only tty6 is available in run-level 4. This is why vt1 through vt 5 seem to be missing---they are! :)

Edit /etc/inittab to remedy what you described. Here is that section from my inittab:

c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235: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


Notice I disabled three ttys, but also notice how I edited the run-level numbers from the defaults packaged by PV. Those numbers represent which run-levels the tty will be available. Typically I boot into run-level 4 with the KDM login manager. Thus, with my inittab, in run-level 4, tty1 and tty2 are not available for use (the 4 is missing from the number sequence). I can toggle to tty1 and see where the rc.4 script proceeded into run-level 4, but the tty is unavailable for use (no cursor, no command line). I can toggle to tty2, but I will see only a blank screen. When I toggle to tty3 I will see the familiar console login screen. Notice the c3 line: in run-level 4 tty3 is available for use.

What happens when I decide to boot into run-level 3? Notice that each of the enabled ttys are available in run-level 3 (the number 3 is included in the number sequence). Thus, I can toggle to all three ttys (Alt-Fn) and see a conventional login screen at each tty.

Can I enable tty1 and tty2 for use despite booting into run-level 4? Sure, just add that run-level number to the sequence. If I did this, then when my box boots in run-level 4, I'll be taken to the KDM login manager. But if I toggle to tty1 (Ctrl-Alt-F1), I then would see a cursor and login prompt. I merely prefer to disable the ttys from which I also am using X. I do this out of personal preference only.

Of course, when I launch X, either from within run-level 3 or 4, I must remember to adjust my Alt-Fn shortcut keys with the Ctrl key when I am in X.

Now that I have written all of that, I just realized another possibility for your problem. Something that concurrently might seem incredibly simple and stupid. Are you using the Right Alt key when you try to toggle ttys and vts? If so, then the default keymap uses the Right Alt key as a special modifier key. Normally that key is mapped as the AltGr key. Try using the Left Alt key. If that works, you can create your own keymap such that the Right Alt key functions the same as the Left Alt key. I did this on my box. Bear in mind that if you do this you lose the special AltGr modifier abilities of the Right Alt key, which many people using more than one language depend upon heavily. I don't have that need so I modified the keymap. I load my revised keymap in my rc.keymap script.

I hope this helps.

tuxrules 11-22-2005 07:44 PM

Thanks Woodsman for that nice explanation. No matter what ctrl+alt+Fn* key combination I use, I am not getting those tty's. I've the /etc/inittab formatted correctly, atleast I think that way. Here's my /etc/inittab excerpt:
Code:

# These are the standard console login getties in multiuser mode:
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

I boot directly into run-level 4 with gdm and dropline-gnome.

Can anybody help me figure this out...

Thanks,
Tux,

Edit: Has that anything to do with dropline...I haven't posted on dropline's forum yet but I'll try it asap.

Woodsman 11-22-2005 08:22 PM

Try booting into run level 3 instead of your default run level 4. If you do not have a boot loader menu option to do this conveniently (hint), then manually edit the boot option when booting and add the kernel boot parameter init 3.

When you boot this way you will not be taken automatically into X. At this point do not start X just yet. Instead, see if you can toggle to the other ttys with Alt-Fn. Notice that unlike when in X, you do not need the Ctrl key. Also, if you are using the standard keymap, you have to use the Left Alt key and not the Right Alt key, which is mapped to Alt Gr.

If you cannot toggle to the other ttys here, then something more fundamental is awry. If you succeed at toggling, then from the console type startx. You then should have an X display. Now try the Ctrl-Alt-Fn switching. If you succeed, then perhaps the problem is related to the GDM (which I never have used) or possibly GNOME or Xfce. If you cannot, then the problem likely is not the GDM but related only to GNOME or Xfce.

I hope this helps.

zborgerd 11-24-2005 09:34 AM

Quote:

Originally posted by tuxrules
Thanks Woodsman for that nice explanation. No matter what ctrl+alt+Fn* key combination I use, I am not getting those tty's. I've the /etc/inittab formatted correctly, atleast I think that way. Here's my /etc/inittab excerpt:
Code:

# These are the standard console login getties in multiuser mode:
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

I boot directly into run-level 4 with gdm and dropline-gnome.

Can anybody help me figure this out...

Thanks,
Tux,

Edit: Has that anything to do with dropline...I haven't posted on dropline's forum yet but I'll try it asap.

These are only valid for runlevel 3 (multiuser mode), and not runlevel 4. The default runlevel 4 behavior on Slackware is to only enable tty6. You will need to do some modification to enable more of them... Otherwise, you may want to have your system boot into runlevel 3 instead.

tuxrules 11-29-2005 09:46 AM

Thanks zborgerd but can you explain in detail. I have never had this problem with dropline and slackware before. I've been using slackware since 10.0 and dropline since 2.6. This is the first time that I don't get terminals (in run-level 4) using ctrl+alt+Fn* keys.

Posted by Woodsman
Quote:

If you cannot toggle to the other ttys here, then something more fundamental is awry. If you succeed at toggling, then from the console type startx. You then should have an X display. Now try the Ctrl-Alt-Fn switching. If you succeed, then perhaps the problem is related to the GDM (which I never have used) or possibly GNOME or Xfce. If you cannot, then the problem likely is not the GDM but related only to GNOME or Xfce.
I've tried switching terminals from run-level 3 and they work fine. Only if i start with GDM that I'm unable to switch...is there something that GDM is doing to stop me from logging into other terminals.

Thanks,
Tux,

zborgerd 11-29-2005 10:16 AM

Runlevel 4 has never had any open terminals (at least, not for many years), aside from tty6. Do you get anything on CTL+ALT+F6?

tuxrules 11-29-2005 10:54 AM

I've actually tried using CTRL + ALT + F1 through F12 sometime back with no luck. I'll try that again and report back. I'm at work right now so can't access my machine but i'll post a reply in the evening.

Thanks for the reply
Tux,

tuxrules 11-30-2005 10:20 AM

Hi zborgerd,
I tried to do CTRL + ALT + F6 but it didn't give me any tty. Any ideas to getting tty's while using GDM (run-level 4)?

Thanks,
Tux

zborgerd 11-30-2005 12:40 PM

Quote:

Originally posted by tuxrules
Hi zborgerd,
I tried to do CTRL + ALT + F6 but it didn't give me any tty. Any ideas to getting tty's while using GDM (run-level 4)?

Thanks,
Tux

It really should be working, unless you have a broken inittab. You may want to restore it back to the default (by copying the file from the sysvinit-2.84-i486-56 package) and see if that helps.

tuxrules 11-30-2005 01:15 PM

okay...will try that later today. Thanks for your help :)

-Tux


All times are GMT -5. The time now is 10:04 PM.