Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Change default tty from tty7 (GUI) to tty2

  1. #1
    Join Date
    May 2008
    Location
    Edmonton, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Change default tty from tty7 (GUI) to tty2

    Anyone know how to change the default tty? I've made some changes to /etc/init/tty2.conf to make tty2 run a script at boot, but the script is interactive and I need tty2 to show on boot instead of the regular tty7 (GUI).
    On other distros, I was able to at least simulate this by adding "/bin/chvt 2" to rc.local, but in Ubuntu, this seems to work for a second and then immediately switches back to tty7. What controls which tty is the default one? Or is this hard coded somewhere?

  2. #2
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Change default tty from tty7 (GUI) to tty2

    As I understand it, you want to be tty2 started at boot time instead of tty7. Am I correct?

    I think that's controlled by the parameter vt.handoff in the /etc/grub.d/10_linux file, but I'm not 100% sure, so it's probably for the best that you either research on that or wait for a better answer here in the forum from someone more knowledgeable than me.
    Please mark your thread as solved if you get a satisfactory response.
    Linux user #556334 | Ubuntu user #35168

  3. #3
    Join Date
    May 2008
    Location
    Edmonton, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Change default tty from tty7 (GUI) to tty2

    Quote Originally Posted by slickymaster View Post
    As I understand it, you want to be tty2 started at boot time instead of tty7. Am I correct?

    I think that's controlled by the parameter vt.handoff in the /etc/grub.d/10_linux file, but I'm not 100% sure, so it's probably for the best that you either research on that or wait for a better answer here in the forum from someone more knowledgeable than me.
    Thanks. I'll look into that.
    I've been trying to find an answer to my question through google for the past 3 days with no luck, so I thought I'd ask if anyone knew.

  4. #4
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    7,836
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Change default tty from tty7 (GUI) to tty2

    It might be a permissions problem with the script that you are using:

    Code:
    cat /etc/securetty
    man securetty
    Why can't this script run after logging in? You could put a line in .bash_login to run a terminal with your script.

    Because of the handoff from root booting to user login, this might be difficult to do without breaking something.

    A less elegant way of doing it is to change runlevels, start with runlevel 1, run your script and at the end of your script, change to runlevel 2. But again, I would expect breakage.

    Code:
    man runlevel
    tgalati4@Mint14-Extensa /etc/init.d $ apropos runlevel
    runlevel (7) - event signalling change of system runlevel
    runlevel (8) - output previous and current runlevel
    startpar (8) - start runlevel scripts in parallel
    telinit (8) - change system runlevel

    Tell us what your script does, there may be a better way to perform the task than changing runlevels or running in tty2.
    Last edited by tgalati4; May 10th, 2013 at 05:35 PM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  5. #5
    Join Date
    May 2008
    Location
    Edmonton, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Change default tty from tty7 (GUI) to tty2

    Quote Originally Posted by tgalati4 View Post
    It might be a permissions problem with the script that you are using:

    Code:
    cat /etc/securetty
    man securetty
    Why can't this script run after logging in? You could put a line in .bash_login to run a terminal with your script.

    Because of the handoff from root booting to user login, this might be difficult to do without breaking something.

    A less elegant way of doing it is to change runlevels, start with runlevel 1, run your script and at the end of your script, change to runlevel 2. But again, I would expect breakage.

    Code:
    man runlevel
    tgalati4@Mint14-Extensa /etc/init.d $ apropos runlevel
    runlevel (7) - event signalling change of system runlevel
    runlevel (8) - output previous and current runlevel
    startpar (8) - start runlevel scripts in parallel
    telinit (8) - change system runlevel

    Tell us what your script does, there may be a better way to perform the task than changing runlevels or running in tty2.
    Getting the script to run is not a problem - it's already running at boot on tty2. I can manually switch to tty2 with Ctrl+Alt+F2 and see its progress, as well as answer its questions. The problem is switching to tty2 automatically.

    What the script does is this:

    When an nvidia driver is installed manually (downloaded from the nvidia website rather than installed from the repos), a kernel update will often kill the GUI after a reboot. To fix this, a reinstallation of the nvidia driver is required. While this only takes a few minutes, I'm trying to automate the process so that every time there is a kernel update, the system automatically reinstalls the nvidia driver. The script is already successful at temporarily changing tty2 to start the installation of the nvidia driver instead of showing a login screen. All I need now is a way to automatically switch to tty2 at boot. This is easily done on Mint with the "/bin/chvt 2" line in rc.local as stated above, but does not work on Ubuntu.

  6. #6
    Join Date
    May 2008
    Location
    Edmonton, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Change default tty from tty7 (GUI) to tty2

    Quote Originally Posted by slickymaster View Post
    I think that's controlled by the parameter vt.handoff in the /etc/grub.d/10_linux file
    Sounded promising but doesn't look like it made a difference. Any other ideas?

  7. #7
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    7,836
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Change default tty from tty7 (GUI) to tty2

    What desktop environment are you running on Mint versus Ubuntu?
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  8. #8
    Join Date
    May 2008
    Location
    Edmonton, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Change default tty from tty7 (GUI) to tty2

    Quote Originally Posted by tgalati4 View Post
    What desktop environment are you running on Mint versus Ubuntu?
    Mate on Mint
    Unity on Ubuntu

  9. #9
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Change default tty from tty7 (GUI) to tty2

    Quote Originally Posted by terminator14 View Post
    Sounded promising but doesn't look like it made a difference. Any other ideas?
    Sorry, but to be honest nothing else comes to mind.

    But did you tried to change the value of vt.handoff in
    Code:
    /etc/grub.d/10_linux
    from 7 to some lower number? And after it, did you updated grub and rebooted?
    Please mark your thread as solved if you get a satisfactory response.
    Linux user #556334 | Ubuntu user #35168

  10. #10
    Join Date
    May 2008
    Location
    Edmonton, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Change default tty from tty7 (GUI) to tty2

    Quote Originally Posted by slickymaster View Post
    Sorry, but to be honest nothing else comes to mind.

    But did you tried to change the value of vt.handoff in
    Code:
    /etc/grub.d/10_linux
    from 7 to some lower number? And after it, did you updated grub and rebooted?
    Yup - changed number from 7 to 2, ran update-grub2, and reboot. Nothin.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •