Results 1 to 5 of 5

Thread: Boot without gui into different runlevel

  1. #1
    Join Date
    May 2009
    Beans
    13

    Boot without gui into different runlevel

    Hi

    I have installed 10.04 LTS server and after that x-window-system-core, gnome-core and gdm. Now it boots to a gui in runlevel 2.

    1. How can I set the default runlevel to 3?

    and

    2. boot into runlevel 3 without a gui?

  2. #2
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Boot without gui into different runlevel

    So you want GDM to start for runlevels 2,4, and 5? I think this would work.

    /etc/init/gdm.conf
    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 started dbus
              and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
                   or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
                   or stopped udevtrigger)
              and runlevel [245] )
    stop on runlevel [016]
    I believe the correct place to change the default runlevel for 10.04 is /etc/init/rc-sysinit.conf

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

    Re: Boot without gui into different runlevel

    Quote Originally Posted by .09. View Post
    Hi

    I have installed 10.04 LTS server and after that x-window-system-core, gnome-core and gdm. Now it boots to a gui in runlevel 2.

    1. How can I set the default runlevel to 3?

    and

    2. boot into runlevel 3 without a gui?
    Run levels are still emulated, but are kinda deprecated...

    In order to boot without starting the display manager use the text kernel parameter.

    Edit /etc/default/grub and add the text option to the GRUB_CMDLINE_LINUX_DEFAULT variable:
    Code:
    ...
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"
    ...
    Remove the quiet option to make the boot process verbose.

    Removing the splash option to disable the splash screen.

    i.e.
    Code:
    ...
    GRUB_CMDLINE_LINUX_DEFAULT="text"
    ...

    Then run:
    Code:
    sudo update-grub
    to generate a new grub.cfg file.

    Or you could create a new text mode grub entry, but that's a little bit trickier.
    1. backup the /etc/grub.d/10_linux file:
      Code:
      sudo cp /etc/grub.d/10_linux{,-backup}
      sudo chmod -x /etc/grub.d/10_linux-backup
    2. open it for editing:
      Code:
      gksu gedit /etc/grub.d/10_linux
    3. scroll down to the linux_entry function (line ~64), and edit it to look like this:
      Code:
      ...
      linux_entry ()
      {
        os="$1"
        version="$2"
        recovery="$3"
        args="$4"
      
        if [ "${recovery}" = "text" ]; then
          title="$(gettext_quoted "%s, with Linux %s (text mode)")"
        elif ${recovery} ; then
          title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
        else
          title="$(gettext_quoted "%s, with Linux %s")"
        fi
        printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
        cat << EOF
      ...
    4. scroll down to the end of file and call the function with the text parameter:
      Code:
      ...
        linux_entry "${OS}" "${version}" "text" \
            "text ${GRUB_CMDLINE_LINUX}"
      
      
        linux_entry "${OS}" "${version}" false \
            "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
            quiet
      
        if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
          linux_entry "${OS}" "${version}" true \
              "single ${GRUB_CMDLINE_LINUX}"
        fi
      
        list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
      done
    5. generate a new grub.cfg file:
      Code:
      sudo update-grub
    6. check out the /boot/grub/grub.cfg file and see if the new menu entry is generated.


    If something went wrong, restore the original settings:
    Code:
    sudo mv /etc/grub.d/10_linux{-backup,}
    sudo chmod +x /etc/grub.d/10_linux
    Code:
    sudo update-grub
    Last edited by sisco311; April 22nd, 2011 at 12:00 PM.

  4. #4
    Join Date
    May 2009
    Beans
    13

    Re: Boot without gui into different runlevel

    I used the text option in grub and it worked, thanks

  5. #5
    Join Date
    Dec 2009
    Beans
    4

    Re: Boot without gui into different runlevel

    Thanks I found this thread still useful today, I used the long solution, and at step iii. I had to chang line 96 to read like:
    Code:
    if [ "${recovery}" != "text" -a ! ${recovery} ] ; then
    this in Ubuntu 12, don't know if this script changed from 10 to 12.

    At step iv. instead I placed the "text" mode as second option.

    regards

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
  •