7

I want to make sure when my pc starts up, it boots into tty1, instead of tty7. And also, in case I need it, I should also be able to switch to the graphical desktop using ctrl +alt+f7 in case I need it. How do I do that?

twodee
  • 232
  • 2
  • 3
  • 11
  • I'd just press CTRL+ALT+1 when it starts up. Interested to see the answers here. – earthmeLon Sep 15 '16 at 04:43
  • I want it to boot to the tty1 automatically. @earthmeLon – twodee Sep 15 '16 at 04:47
  • Remove your Display manager. Then to boot inti gui do `startx` from ttyX. But for that you need a `.xinitrc` file in your `$HOME`. – Raphael Sep 15 '16 at 05:39
  • @Raphael far too radical. – Rinzwind Sep 15 '16 at 07:18
  • 4
    Possible duplicate of [How can I set my Ubuntu 12.04 LTS to boot to console without GUI?](http://askubuntu.com/questions/174312/how-can-i-set-my-ubuntu-12-04-lts-to-boot-to-console-without-gui) and possible duplicate of [How to boot to Ubuntu desktop from the console](http://askubuntu.com/questions/805536/how-to-boot-to-ubuntu-desktop-from-the-console) – karel Sep 15 '16 at 08:12

1 Answers1

11

Find GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub (with a sudo nano /etc/default/grub and change it to ...

GRUB_CMDLINE_LINUX_DEFAULT="text"

and update grub with ...

sudo update-grub

Tell systemd to not load the desktop with ...

sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target

And the initial boot will end up on a tty. By default it will be tty1. You can still go to the desktop by using the command startx on commandline.

I should also be able to switch to the graphical desktop using ctrl +alt+f7 in case I need it.

You will need to issue the sudo systemctl start lightdm command before using control+alt+f7. Probably impossible to get around that: if a desktop is loaded during boot it will take precedence.

Rinzwind
  • 293,910
  • 41
  • 570
  • 710
  • It seems like with `startx` all I find is my desktop background with an 'X' as my pointer. No launcher, no icons. @Rinzwind – twodee Sep 15 '16 at 12:01
  • do any of these work: http://askubuntu.com/questions/320042/why-does-startx-usr-bin-unity-not-load-my-desktop-settings ? – Rinzwind Sep 15 '16 at 12:26
  • I am not using `startx`, but instead figured out I needed to start the lightdm. So I did this- `systemctl sudo start lightdm` and works fine now. – twodee Sep 15 '16 at 18:03
  • check! added it. – Rinzwind Sep 15 '16 at 18:04
  • 1
    I did a minimal install of ubuntu server 16.04.2 and for some reason it had `GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"` as the default. Changed that to `text` as suggested and updated grub and now I'm booting to `tty1`. Thanks. – Jens Bodal May 04 '17 at 20:43