4

I want my Ubuntu box to boot directly into a tty login screen and after it does that I want it to automatically run startx how would I go about doing this?

5
  • I don't mean to be nosy, but why do this? If you want to end up in a graphic environment by default, why not use a display manager? Aug 17, 2010 at 21:15
  • to deter thiefs
    – Whatnotery
    Aug 18, 2010 at 0:46
  • I doubt that thieves will be interested in the contents of your computer, and if they are i'm sure the can find out hot boot from a live-cd. If you fear for you data's security encrypt you disk. Aug 18, 2010 at 7:57
  • its not my data I'm worried about its the physical computer if it boots into a text based environment they'll assume its broken and not take it (or so I'm hoping)
    – Whatnotery
    Aug 20, 2010 at 4:07
  • I doubt a thief will even touch the power button Dec 17, 2010 at 21:36

3 Answers 3

8

What txwikinger said, but then to make it automatically run startx when you login, edit ~/.bash_profile -- that file is only executed on login shells, not in normal terminal emulators that you open on your desktop.

EDIT: ~/.profile if you don't use bash

4

You can disable the automatic start of the X-server by disabling the start on lines in gdm.conf and/or kdm.conf. This way upstart will not automatically start the X-server.

After logging in into the tty, you can just start the appropriate login session via sudo start gdm or sudo start kdm. Or if you rather want the traditional x, you could run startx, if it is configured such that you can do the things you want to do from that.

3

Turns out from the grub boot menu you can press e over any entry to edit its configuration. If you do this over the ubuntu entry there is a line that starts with the word linux and ends with something like ttyhandoff=7. Changing this to ttyhandoff=1 does what you would expect.

Apparently you could also append text to the end of this line.