Linux – How to change the default TTY after boot

consolelinuxstartupttyx-server

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?

Best Answer

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

Related Question