Results 1 to 9 of 9

Thread: direct boot to command line interface possible?

  1. #1
    Join Date
    Sep 2009
    Location
    CATALONIA
    Beans
    136
    Distro
    Ubuntu 12.04 Precise Pangolin

    direct boot to command line interface possible?

    Hello Community,

    My computer has a Windows XP / Ubuntu 9.10 dual boot. I use mainly Ubuntu and increasingly in command line interface as my linux shell experience develops. I find it simpler and above all much faster than working in the GUI.

    Question: Is there a way of booting directly to command line interface (shell prompt) without having to load the full Ubuntu session? This would be a great way of saving time for certain tasks that can be executed in CLI.

    Thanks

  2. #2
    Join Date
    Oct 2006
    Location
    Tucson, AZ
    Beans
    1,420
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: direct boot to command line interface possible?

    If you remove GDM ("sudo apt-get remove gdm"), the system will boot to a console login.

    If you need X for something, then "startx" in the console will bring it up.

    I seem to recall that it's possible to deactivate GDM without actually uninstalling it, but I don't recall the command (hopefully someone else will wander by and provide it).

    Lloyd B.
    Don't tell me to get a life.
    I had one once.
    It sucked.

  3. #3
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: direct boot to command line interface possible?

    You have several options:

    1. rename the Upstart job:
      Code:
      sudo mv /etc/init/{gdm.conf,gdm.conf.noexec}
      NOTE: if you reinstall/upgrade gdm the file is recreated.


    2. edit the file and comment out the start on entry:
      Code:
      # gdm - GNOME Display Manager
      #
      # The display manager service manages the X servers running on the
      # system, providing login and auto-login services
      
      description     "GNOME Display Manager"
      author          "William Jon McCann <mccann@jhu.edu>"
      
      #start on (filesystem
      #          and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
      #               or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
      #               or stopped udevtrigger))
      stop on runlevel [016]
      ...
      to start gdm run:
      Code:
      sudo initctl gdm start

    3. edit the file and add a new event to the start on entry. i.e. start it on runlevel 3:

      Code:
      # gdm - GNOME Display Manager
      #
      # The display manager service manages the X servers running on the
      # system, providing login and auto-login services
      
      description     "GNOME Display Manager"
      author          "William Jon McCann <mccann@jhu.edu>"
      
      start on (runlevel 3 
                and filesystem
                and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
                     or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
                     or stopped udevtrigger))
      stop on runlevel [016]

      to start gdm run:
      Code:
      sudo initctl gdm start
      or
      Code:
      sudo initctl emit runlevel 3
      NOTE: You can boot in runlevel 3 by appending the linux line in GRUB with 3

      Code:
      linux /boot/vmlinuz<-version> root=UUID=<uuid> ro quiet splash 3

    4. comment out /usr/sbin/gdm in the /etc/X11/default-display-manager file:
      Code:
      #/usr/sbin/gdm

  4. #4
    Join Date
    Dec 2007
    Location
    United States
    Beans
    2,900
    Distro
    Ubuntu

    Re: direct boot to command line interface possible?

    Why not simply:

    Code:
    sudo mv /etc/init/gdm.conf /etc/init/gdm.save
    Then reboot? I have not tried it, but it should work. I will give it a try in a VM and report back.

    EDIT: This works as expected in a 9.10 test virtual machine and can be easily undone with:

    sudo mv /etc/init/gdm.save /etc/init/gdm.conf

    By way of clarification: gdm is started in Ubuntu via the new "upstart" tool which stores config files in /etc/init. Each file ending with .conf is run, those ending in something else are not. If you do the change, you can always get X to start with "startx".
    Last edited by blueridgedog; December 24th, 2009 at 10:13 PM.

  5. #5
    Join Date
    Jun 2009
    Location
    0000:0400
    Beans
    Hidden!

    Re: direct boot to command line interface possible?

    Append 'text' to the kernel options in Grub.

    Also, consider a lighter distro if you're not going to be using a GUI.

  6. #6
    Join Date
    Feb 2008
    Beans
    16

    Re: direct boot to command line interface possible?

    The no edit version- boot into recovery mode, you can drop to cli right from there (last 2 entries in the menu, with or without networking)

  7. #7
    Join Date
    Oct 2006
    Location
    Tucson, AZ
    Beans
    1,420
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: direct boot to command line interface possible?

    Quote Originally Posted by ticthak@AOL.com View Post
    The no edit version- boot into recovery mode, you can drop to cli right from there (last 2 entries in the menu, with or without networking)
    This is a BAD idea for normal use. Recovery mode does drop you immediately to a CLI, but it has you logged in as root, where the slightest mistake can have disastrous consequences.

    Lloyd B.
    Don't tell me to get a life.
    I had one once.
    It sucked.

  8. #8
    Join Date
    Dec 2007
    Location
    United States
    Beans
    2,900
    Distro
    Ubuntu

    Re: direct boot to command line interface possible?

    Quote Originally Posted by lloyd_b View Post
    it has you logged in as root
    Also, many services are not started, which will/may be needed.

  9. #9
    Join Date
    Sep 2009
    Location
    CATALONIA
    Beans
    136
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: direct boot to command line interface possible?

    Hi Guys,

    Thanks for your replies. I have chosen Sisco331's solution :

    sudo mv /etc/init/{gdm.conf,gdm.conf.noexec}
    for the direct to CLI boot and simply use "startx" command to go to the GUI.

    Then back to CLI with "sudo shutdown -P now" to shut down.

    Problem solved.

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
  •