How to change the default TTY after boot?

18,515

I've found the answer. It's simple, you just have to add chvt 4 to /etc/rc.local file, and that's it.

Share:
18,515

Related videos on Youtube

VinoPravin
Author by

VinoPravin

I'm a Debian user who wants to know all about the linux world. If there's a problem with some software or hardware under this operating system, I can fix it, of course I need some time to do that. I don't know many things, but sooner or later I always develop an OpenSource solution and make things work whether they like it or not.

Updated on September 18, 2022

Comments

  • VinoPravin
    VinoPravin almost 2 years

    Normally when system starts you have all output printed on the TTY1, and that's ok, but I start X-server via startx and achieve this by the following lines in the ~/.profile file :

    if [[ $(tty) = /dev/tty4 ]]; then
        exec startx &> ~/.xsession-errors
    fi
    

    So, as you can see I use TTY4 to start X-server, and I want to switch to that console automatically after the boot is done. Is there a way to do this?

  • Admin
    Admin over 10 years
    Could you tell me what the line does?
  • Admin
    Admin over 10 years
    On Virtual Terminal #4... When in runlevel 2, 3, 4 or 5... If the program running here (/bin/login) terminates, restart it (every time it terminates)... Run the program /bin/login on Virtual Terminal #4, stdin is VT #4, stdout is VT #4, stderr is hooked to stdout. (not sure about -f username... try man login)