How do I prevent GRUB from using/starting any graphical UI?

23,948

Solution 1

You can enter single user mode by passing the parameter single or 1 to the kernel. Single user mode will give you a terminal with root privileges. It may also help to disable the splash screen and enable verbose mode by removing quiet and splash from the parameter list (if they exist, of course). To boot into single user mode, from the GRUB menu press e, then look for the line that looks like

linux   /boot/vmlinuz root=/dev/sda4 ro quiet splash

and add single to the end, removing quiet and splash if they exist so that it becomes

linux   /boot/vmlinuz root=/dev/sda4 ro single

or, alternatively

linux   /boot/vmlinuz root=/dev/sda4 ro 1

Solution 2

On Fedora 16 to boot in text mode:

ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

If you want X to be removed completely run:

yum -y groupremove "X Window System" "GNOME Desktop Environment" 
Share:
23,948

Related videos on Youtube

Blackbinary
Author by

Blackbinary

Updated on September 17, 2022

Comments

  • Blackbinary
    Blackbinary over 1 year

    I have a problem with an older Laptop (Fujitsu Siemens LifeBook S6010, to be precise) and an Ubuntu (10.10, Xubuntu desktop) installation (fresh install).

    During installation the graphics hardware was mis-detected and it now is completely impossible to boot the system into GUI. Any attempt to invoke graphics mode will freeze the machine.

    Therefore I'd like to boot the machine into text mode to see if I can fix the graphics issue — probably material for another question, if and when I get there.

    However, I was unsuccessful at telling GRUB (1.98) to not use any graphics, at all. I can get to the GRUB menu and edit one of the available boot configurations, but whatever I tried to express "text only", everything failed (i.e. machine still invokes graphics during boot and promptly becomes unusable).

    I have no easy other way to get into the machine (it cannot not boot from CD or USB, for example). So: What do I need to do to tell GRUB at the boot menu to stop it from using any fancy stuff and get me to a text console?

    • phunehehe
      phunehehe over 13 years
      "impossible to boot the system into GUI"? So are you able to boot into anything non-GUI? If there are problems with your frame buffer device, for example, booting into text mode could also fail. If that's the case then you will have to change the settings and recompile the kernel I'm afraid.
    • Blackbinary
      Blackbinary over 13 years
      @phunehehe: Booting the system into anything non-GUI is what I'm trying to do, but it keels over soon enough. The last line I see in diagnostic boot is firewire_core: created device fw0 ..., and then a colorful display appears indicating a failed graphics mode.
    • Blackbinary
      Blackbinary over 13 years
      @phunehehe: This bug report seems to be very close to the issue I'm experiencing.
    • Blackbinary
      Blackbinary over 13 years
      @Gilles: Sure, there is a UUID present. The machine is at my workplace, I don't have it right now. I think the issue may be that the system tries to boot into a hi-res text mode instead of the 80×25 characters VGA mode I was expecting.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 13 years
      @Tomalak: Sorry if my previous comment was unclear. I meant that if you're still having trouble, you should post the exact linux line in the Grub menu. But since the UUID is painful to copy and irrelevant here, you don't need to copy it, just show us the rest.
    • Blackbinary
      Blackbinary over 13 years
      @Gilles: It says linux /boot/vmlinuz-2.6.35-22-generic root=UUID=… ro single for the "recovery mode" boot entry. In the meantime I've found out that graphics for this specific laptop model seems to be a general problem.
  • Blackbinary
    Blackbinary over 13 years
    Does not work, unfortunately :-( a) If I press c I get into GRUB's command console, there is nothing to see there. But I can press e to edit the boot configs and CTRL+X to execute a modified config. Do GRUB versions behave that differently? b) In the "recovery mode" config, the linux line already says ro single, but that does not work out. Maybe GRUB tries to display a splash screen or something?
  • phunehehe
    phunehehe over 13 years
    Sorry I posted the wrong key, 'e' should be the correct one. Updated.
  • Blackbinary
    Blackbinary over 13 years
    That's okay, cheers. However: there no splash parameter anywhere. I also tried to add text (or textonly, as one Google hit suggested) as parameters but this gets ignored, the screen still freezes halfway through the boot.
  • phunehehe
    phunehehe over 13 years
    If it's not there then you don't need to remove it, see updated.
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    @Tomalak: Twro possible graphics mode inducers are splash and vga=xxx, you should remove these if they are present. Then adding single (or 1, which is synonymous) prevents the display manager (graphical login screen) from starting.
  • Blackbinary
    Blackbinary over 13 years
    According to the bug report I mentioned above, VGA out is available even when the laptop LCD is dead, so when I attach an external monitor I can work on the machine. I see a high-resolution text mode there, which I consider a graphic mode as well, as it is well beyond VGA text mode with 80 columns. I guess that's the reason for the LCD freeze. If I set acpi=no the LCD does work, but I'm not sure if switching off ACPI is the best way to solve this issue...
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    vga=xxx tells the kernel to switch VGA modes, which might be the source of the problem. You don't need it just to get VGA output using the default text mode. (Just remove it, don't replace it with novga or anything like that.)
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    If single-user mode isn't enough, a more radical approach is linux /boot/vmlinuz root=… ro init=/bin/bash. This drops you to a shell directly after the root partition is mounted, with no service at all. You'll probably want to mount -t proc proc /proc and mount -o remount,rw / before anything else.
  • Wok
    Wok about 11 years
    I come from here. You have saved my laptop.