You are not logged in.

#1 2011-03-05 12:04:49

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Unable to switch ttys

I am noticing this across several different Linux distros (checked to see if only Arch issue, but not) Before I installed X my ctrl alt F(some number) worked fine, but after I cannot change tty screens.

Same thing in Ubuntu, Gentoo, Funtoo only one that still works is opensuse 11.3 I tried 11.4 rc & does same thing.

Anyone else notice this?

A bug with kernel, or Xorg perhaps?

Any info will be greatly appreciated.

Thanks.

Offline

#2 2011-03-05 12:59:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to switch ttys

Any errors in the logs?
How do you start X, are you using any DE?

Offline

#3 2011-03-05 15:20:49

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

This is straight through initial login terminal.

I use a .xinitrc to startx, but this issue is present from tty1.

Any ideas?

Offline

#4 2011-03-05 16:09:55

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: Unable to switch ttys

Your problem description is  vague. What do you mean by 'I cannot change tty screens' ? does nothing happen when you ctrl+alt+f2 ? Do you get a black screen?What do you have in  '/etc/inittab'?  Switching tty's works fine for me btw.

Last edited by rwd (2011-03-05 16:14:11)

Offline

#5 2011-03-05 16:12:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to switch ttys

Is your keyboard working at all? No errors in the logs?

Last edited by karol (2011-03-05 16:13:11)

Offline

#6 2011-03-05 16:30:29

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

what log would I look at for tty errors?

As I said before this is not really an X related issue happens from terminal screens.

I have checked dmesg for info & I see nothing I have agetty listed running on tty, but nothing shows up upon trying to sitch tty screens.

Does it work for you?

Offline

#7 2011-03-05 16:35:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to switch ttys

If I'm at tty1 and press Alt-F2 I go to tty2 - works as usual.

[karol@black ~]$ ps -C agetty
  PID TTY          TIME CMD
 2700 tty2     00:00:00 agetty
 2701 tty3     00:00:00 agetty

+ mingetty for tty1 - all tunning OK.

Offline

#8 2011-03-05 16:54:04

vladthedog
Member
Registered: 2010-12-03
Posts: 45

Re: Unable to switch ttys

Do you have a keyboard that tries to use the F keys for other things as well (i.e. one of the microsoft web browsing keyboards or something)?  I had a microsoft keyboard that I would always screw up on boot when trying to hit F8 (or whatever to get into bios) because i would first have to turn on the "function" set.  Sounds like its probably not this, but I threw away that keyboard because of this one thing.

Offline

#9 2011-03-05 16:57:18

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: Unable to switch ttys

It's hard to help you if you don't answer  questions.  I think I'm done here.

Offline

#10 2011-03-05 18:01:16

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unable to switch ttys

See https://bbs.archlinux.org/viewtopic.php?pid=883597 for pointers - and, if you are asking the community for assistance, please show them the courtesy of answering the questions they ask...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2011-03-06 02:07:25

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

I would like to appoligize to all that attempted to assist with my issue, for my late response, but I just woke up. I work 12 hr overnight shifts & went to bed at 12, but I am up for the long haul tonight (up til 12 tomorrow & on)

As far as the ps -C agetty command goes I get an output of tty2 - tty6.

As far as the style of keyboard goes not sure if that is related as I stated OpenSuse 11.3 works completely fine with changing tty screens, and so did Arch, Gentoo, Funtoo, Kubuntu prior to me installing X, but issue stems from tty screens not X (probably related, but unsure.)

After my initial Arch install (which is my 10th time or so just coming back from a stent of using Funtoo & FreeBSD 8.2.

I am noticing a change since kernel version 2.6.37 .36 version I had no problem with X & tty (again I think X install is negating the tty switching no Idea)

My keyboard is a Microsoft Natural Wireless Ergonomic 7000, and worked fine with all Linux distros listed above prior to kernel version 2.6.37.

I built my own kernels through Gentoo/ Funtoo & I was trying to remember the selection I needed to make to get back functionality of tty switching I think something under Devices Drivers> Input Devices?

This is not the first time I had this issue I have been researching for over a month.

On a side note: There is something totally different about this kernel version as since .37 my nvidia hdmi on-board sound device is no longer recognized by alsaconf (I use OSS4 no biggie just saying) regardless of what options chosen during kernel compilation. (I know off track, but just stating kernel variations that I have noticed)

Is there a way to see stdout from keystroke command for the attempted tty switch?

For the question from rwd :I will post my /etc/inittab once I am on the linux box using my work PC right now.

Thanks for the assistance so far.

Offline

#12 2011-03-06 02:09:17

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

Ok not so much Kubuntu never really worked If I remember correctly not a big fan of the lag from Plymouth & Nouveau.

Last edited by arch1_user (2011-03-06 02:09:36)

Offline

#13 2011-03-06 02:14:02

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

# /etc/inittab
#

#  Runlevels:
#    0    Halt
#    1(S)       Single-user
#    2    Not used
#    3    Multi-user
#    4    Not used
#    5    X11
#    6    Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
# Boot to X11
#id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux

# Serial Virtual Console for KVM and others VMs
#s0:2345:respawn:/sbin/agetty -8 9600 ttyS0 linux

# Hypervisor Virtual Console for Xen and KVM
#h0:2345:respawn:/sbin/agetty -8 38400 hvc0 linux


ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1

# End of file

Offline

#14 2011-03-06 02:37:09

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Unable to switch ttys

Can you change ttys with chvt? For example, from tty1:

 $ chvt 2 

Offline

#15 2011-03-06 02:48:19

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

Yes, chvt 2 works fine! Nice, but is the keystroke shortcut associated with ctrl alt Fkey that command, and if not how can I make it be?

Any ideas?

Offline

#16 2011-03-06 04:09:26

codeRage
Member
Registered: 2011-02-20
Posts: 29

Re: Unable to switch ttys

arch1_user wrote:

Yes, chvt 2 works fine! Nice, but is the keystroke shortcut associated with ctrl alt Fkey that command, and if not how can I make it be?

Any ideas?

You are running a graphical desktop right? Open up a terminal and type xev. Click somewhere in the box. Press CTRL ALT F7. Do you see the following?

KeyPress event, serial 41, synthetic NO, window 0x1600001,
    root 0x76, subw 0x0, time 7015671, (404,165), root:(1015,261),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 41, synthetic NO, window 0x1600001,
    root 0x76, subw 0x0, time 7017565, (404,165), root:(1015,261),
    state 0x4, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x1600001,
    root 0x76, subw 0x0, time 7022936, (404,165), root:(1015,261),
    state 0xc, keycode 73 (keysym 0x1008fe07, XF86_Switch_VT_7), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Specifically you are looking for [(keysym 0x1008fe07, XF86_Switch_VT_7).
Is it there? If it's not, you're SOL. Just kidding! big_smile Looks like you can associate the keycode with the keysymbol using xmodmap.

https://help.ubuntu.com/community/MultimediaKeys

Hope this helps.

P.S. How did you screw up multimedia keys in the first place? big_smile

Last edited by codeRage (2011-03-06 04:12:03)

Offline

#17 2011-03-06 04:23:20

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unable to switch ttys

codeRage wrote:

You are running a graphical desktop right?

arch1_user wrote:

As I said before this is not really an X related issue happens from terminal screens.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#18 2011-03-06 04:54:14

codeRage
Member
Registered: 2011-02-20
Posts: 29

Re: Unable to switch ttys

jasonwryan wrote:
codeRage wrote:

You are running a graphical desktop right?

arch1_user wrote:

As I said before this is not really an X related issue happens from terminal screens.

Okay, rape me with semantics more plz
In that case you should take a look at dumpkeys / loadkeys

keycode  58 = Caps_Lock       
keycode  59 = F1               F13              Console_13       F25             
        alt     keycode  59 = Console_1       
        control alt     keycode  59 = Console_1       

Or put in other words, you need a file 'mykeymap' which contains lines like

control alt keycode 59 = Console_1

which you can then load into your kernel via

loadkeys mykeymap

Interestingly this method only seems to work from the terminal screens, not from X.

Edit: Here's some additional resources for updating your keyboard configuration in X:

1. http://cweiske.de/howto/xmodmap/allinone.html#maps
2. http://www.manicai.net/comp/swap-caps-ctrl.html

Just for the hell of it I decided to change left control and caps lock keys... I couldn't get it to work reassigning the keycodes similar to the loadkeys method above but the second link worked flawlessly. You might have to play around with it.

Last edited by codeRage (2011-03-06 06:47:06)

Offline

#19 2011-03-06 05:13:13

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

I have not tried to set up the multimedia keys for my keyboard.

I will try all that has been suggested and update shortly.

Thanks again for all of the suggestions.

Offline

#20 2011-03-06 10:00:13

arch1_user
Member
Registered: 2010-03-10
Posts: 17

Re: Unable to switch ttys

Ok.

I totally do not get:

KeyRelease event, serial 41, synthetic NO, window 0x1600001,
    root 0x76, subw 0x0, time 7022936, (404,165), root:(1015,261),
    state 0xc, keycode 73 (keysym 0x1008fe07, XF86_Switch_VT_7), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

when I tested, I see if I press F7 it shows F7, same for CTRL, but not seeing F86_Switch_VT_7.


I do not see the following either:

keycode  58 = Caps_Lock       
keycode  59 = F1               F13              Console_13       F25             
        alt     keycode  59 = Console_1       
        control alt     keycode  59 = Console_1   


I added it to us.map.gz, but still nothing.

I am going to try to use a different keyboard that is wired to see if it is my keyboard that is causing issue or if it the mapping.

Offline

#21 2011-03-06 20:03:03

codeRage
Member
Registered: 2011-02-20
Posts: 29

Re: Unable to switch ttys

arch1_user wrote:

I do not see the following either:

keycode  58 = Caps_Lock       
keycode  59 = F1               F13              Console_13       F25             
        alt     keycode  59 = Console_1       
        control alt     keycode  59 = Console_1   

I added it to us.map.gz, but still nothing.
I am going to try to use a different keyboard that is wired to see if it is my keyboard that is causing issue or if it the mapping.

Hmmmm does your system have Caps_Lock mapped to a different keycode?
These are merely the settings on my computer.... you will want to substitute your own keycodes.

Create a file (I called mine .keyboard, and put in my home directory) with the following:

alt keycode 59 = Console_1                  ! Keycode 59 = F1
control alt  keycode 59 = Console_1    
alt keycode 60 = Console_2                  ! Keycode 60 = F2
control alt  keycode 60 = Console_2

Taking care that keycode 59 is F1, keycode 60 is F2, and so on.

Then, to run the changes on startup put a line like this into your /etc/rc.local:

loadkeys /path/to/keyboard/file

Ain't no reason to edit your system keyboard settings (us.map.gz) smile

----------------------------------------------------------------------------------------------

And I was finally able to get a semi-decent keyboard config in X, see below.:

! Swap Caps_Lock and Control_L 
! Plus a bogus hack to make CTRL ALT F1 switch to tty2 instead of tty1
!
remove Lock = Caps_Lock
remove Control = Control_L
keycode 37 = Caps_Lock NoSymbol Caps_Lock NoSymbol
keycode 66 = Control_L NoSymbol Control_L NoSymbol
keycode 67 = F1 XF86_Switch_VT_2 F1 XF86_Switch_VT_2
add Lock = Caps_Lock
add Control = Control_L

As before load with xmodmap from .xinitrc. But the actual keycodes may be different I guess.

xmodmap $HOME/.Xmodmap

Last edited by codeRage (2011-03-06 22:42:19)

Offline

Board footer

Powered by FluxBB