Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: HowTo: Boot into runlevel 3 (text-only; no X server)

  1. #11
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    momneedshelp, welcome to the forums.

    Let's see. You have installed Jaunty server edition.
    You have gdm and X installed, so I assume you have augmented the server with these X applications, and have probably also run
    Code:
    sudo apt-get ubuntu-desktop
    This way, when you log in as a normal user, you get a GNOME desktop, yes?

    If the above assumptions are true, then you have essentially installed the Jaunty desktop edition. (The desktop edition can run server applications just like the server edition).
    If you turn off or remove the monitor, you could call it a server

    When you wish to log in graphically, for your own purposes, or have a guest who wishes to log in, you could just turn on the monitor and have the gdm login window already there.

    Does this sound acceptable? If so, you do not have to mess with runlevels at all.

    If this is not what you want, please describe what your ideal solution looks like.
    Last edited by unutbu; August 23rd, 2009 at 08:28 PM.

  2. #12
    Join Date
    Feb 2005
    Beans
    425

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    Quote Originally Posted by momneedshelp View Post
    I'm sorry about raising this thread from the dead, but if I just add "text" behind the kernel, doesn't that mean I have to manually edit GRUB every time a new kernel arrives? And given that I have updates set on automatic installation, I will not even know immediately if a new kernel (booting into X and gdm) has arrived.
    You should edit the #kopt= line in /boot/grub/menu.lst, and then run update-grub. update-grub will add the #kopt parameters to the "kernel" lines, so this happen when you upgrade kernels as well.

    I use this PC as a server and guest PC, so it must boot into init 3 as text mode but allow me to start gdm.
    To be able to start gdm even if you have booted with "text", I suggest this modification of /etc/init.d/gdm (which I also will try to push into Karmic):
    Code:
    if grep -wqs text /proc/cmdline && [ "$2" != "force" ]; then
    You can then start gdm, even if "text" was used, with:
    sudo /etc/init.d/gdm start force
    Please use launchpad to search for/report bugs and problems: https://help.ubuntu.com/community/ReportingBugs

  3. #13
    Join Date
    Dec 2006
    Beans
    1,133
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    There are no dumb questions, just dumb answers.

  4. #14
    Join Date
    Aug 2009
    Beans
    2

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    Unutbu, tormod and lswb, thank you for replying. Sorry, forgot to specify that I'm using a manually stripped down Desktop Ubuntu which I'm using as a server as well (opensim), I assumed that would be clear as I had made a reference to an up and running GDM.

    As I was trying different approaches from the hints here in the last hours and some more searches on the web, I was getting deeper into the mess with not being able to boot up at all ?! and ended up just backing up with the LiveCD and reinstalling from scratch.

    In the end, that panel option at /System/Administration/Services/uncheck Graphical login manager did the job! I just unchecked after reinstall given I had nothing to lose (anymore) and it booted into the CLI without modifying anything in the GRUB. And when I want a Desktop, "sudo start gdm" then just launches Gnome, I have set it on automatic login, so I'm very happy. We have a score!

  5. #15
    Join Date
    Jul 2006
    Beans
    1

    Re: HowTo: Boot into runlevel 3 (text-only; no X server) Grub2

    With the new and fancy 9.10 distro, you can also setup in Grub2

    Edit the /etc/default/grub (sudo) file and locate the line
    GRUB_CMDLINE_LINUX="" location and add the word 'text' inside the quotes per suggestion above.
    be sure to run sudo update-grub before rebooting.

    you can then use your system in level3 . If you wish to run graphics you can simply run 'startx' - I installed xfce4 desktop and run 'startxfce4'

    Best...

  6. #16
    Join Date
    Dec 2007
    Beans
    1,046

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    Run-level 2, how to boot in text mode or using .xinitrc :

    The nuts-n-bolts method

    Using your favourite text editor create a file named autologinfred.c and type in this short C program:


    #include <unistd.h>
    int main() {
    execlp( "login", "login", "-f", "fred", 0);
    }


    The execlp system call invokes the command "login -f fred" and replaces the current processing context with this invocation. The man page for login describes the action of the -f argument. Compile this tiny C program using the GNU C-compiler:

    $ gcc -o autologinfred autologinfred.c

    Gain root privileges (using su) and copy the executable to a public directory:

    # cp autologinfred /usr/local/sbin/

    Now take a look at /etc/inittab. This is the configuration file is used by init, the very first process started when Linux initialises. You should observe lines similar to the following:

    1:2345:respawn:/sbin/mingetty tty1
    2:2345:respawn:/sbin/mingetty tty2
    3:2345:respawn:/sbin/mingetty tty3

    The exact contents of /etc/inittab differ from distribution to distribution. On Debian systems one sees:

    1:2345:respawn:/sbin/getty 38400 tty1
    2:23:respawn:/sbin/getty 38400 tty2
    3:23:respawn:/sbin/getty 38400 tty3

    Edit the line beginning with "1:2345" so that it reads as follows:

    1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologinfred 38400 tty1

    The above will cause the user fred to be logged in automatically on the first virtual console. On some GNU/Linux distributions (like RedHat) /sbin/agetty must be used instead. The -l <alternative login> argument to getty substitutes the default /sbin/login program with the one we compiled earlier. The -n tells getty to not prompt for a user ID.
    Initiating the desktop on login

    If we reboot, the init process will automatically login the user fred on the first virtual console and a command shell will by started. User fred must still type in the startx command to initiate the graphical desktop. Can we automate this too?

    If fred's login shell is /bin/bash, the first commands to be executed will always be listed in the file, ~fred/.bash_profile. We can add the startx command here but this causes problems, since the .bash_profile will be used in other situations such as when one is logging into a second virtual console or when opening an xterm. Instead we append the following lines:


    if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
    startx
    fi

  7. #17
    Join Date
    Dec 2006
    Beans
    1,133
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    Quote Originally Posted by frenchn00b View Post
    Run-level 2, how to boot in text mode or using .xinitrc :[/B]

    The nuts-n-bolts method
    ....
    Apparently you have never tried this on any recent ubuntu distributions.
    There are no dumb questions, just dumb answers.

  8. #18
    Join Date
    Nov 2008
    Location
    Western NC
    Beans
    6
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    Greetings all,

    I apologize if this question doesn't really belong here ... but it's directly about runlevel stuff.

    My question: From a command prompt in Ubuntu Server v9.10, how do you find out what runlevel you are running at?

    I've installed XAMPP for my class at school, and I want it to automatically start. I've found a thread (albeit quite outdated) that lists using the following command:

    egrep :initdefault: /etc/event.d/rc-default

    This gives me an error, "file not found" "directory not found"

    As it turns out, "/etc/event.d" as a directory, doesn't exist at all.

    So, anyone know how to find out what my default run level is? I need to know so I can put the start and stop commands to auto-load XAMPP at startup.

    Thanks a bunch for all your replies / help.

  9. #19
    Join Date
    Dec 2006
    Beans
    1,133
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    I run 9.04, not 9.10, but I think that the runlevel command must have been included with 9.10 for compatibility with programs that use sysv style initscripts.

    Try "runlevel" in a terminal and see what it returns, then "man runlevel" for the details. The normal output is 2 characters separated by a space, the first is the previous runlevel ('N' is returned if there has been no change since boot) and the 2nd is the current runlevel.
    There are no dumb questions, just dumb answers.

  10. #20
    Join Date
    Nov 2008
    Location
    Western NC
    Beans
    6
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HowTo: Boot into runlevel 3 (text-only; no X server)

    Thanks, that did the trick:

    N 2

    Runlevel 2 - which means I need to start my LAMPP services from the "/etc/rc2.d" directory.

    Worked flawlessly, thanks!

Page 2 of 3 FirstFirst 123 LastLast

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
  •