2

I have a desktop version of #! installed on my laptop. I am quite new to Linux, but learning more everyday.

I would like to know if it is possible to choose on start-up to boot into the Desktop, as it is now by default, or start in a command line environment (with a graphical display enabled). That way if I need just to go through files quickly I could do so with the terminal commands, but I could also call a graphical program if needed (ie thunar).

I'm thinking I can avoid loading the desktop when I don't need it. Of course, I would like to keep the possibility of logging into the desktop.

  • not sure what you mean by desktop here. is it dual boot or you need to load Linux GUI. if you just trying to load Linux in GUI mode then execute startx – Raza Jun 13 '13 at 20:05
5

Take a look at this tutorial titled: Learn Linux, 101: Runlevels, shutdown, and reboot. You can change from runlevel 3 (non-GUI Desktop) to GUI Desktop (typically runlevel 5) with the following command:

$ telinit 5

You can see what runlevel you're currently in with the runlevel command:

$ runlevel
N 3

After running the above telinit command you should see this change from a 3 to a 5. Some distros use differing runlevels, not sure about crunchbang, so you might need to double check which runlevel exactly is appropriate for GUI Desktop mode.

You can change which runlevel is the default typically through this file: /etc/inittab:

$ sudo nano /etc/inittab

# change this line (5 = Desktop)
id:5:initdefault:

# to this (3 = console)
id:3:initdefault:

Additionally during bootup you can override your runlevel via Grub by appending a number at the end of the boot line. Putting a 1 there will tell the kernel to boot to runlevel 1 (single user mode). Putting a 3 there will boot to runlevel 3.

This is an example of the kernel line from the Grub menu:

title Fedora (2.6.35.14-106.fc14.x86_64)
    root (hd0,4)
    kernel /vmlinuz-2.6.35.14-106.fc14.x86_64 ro root=/dev/mapper/vg_grinchy-lv_root rd_LVM_LV=vg_grinchy/lv_root rd_LVM_LV=vg_grinchy/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
    initrd /initramfs-2.6.35.14-106.fc14.x86_64.img

Adding a number (1,2,3, or 5) at the end of the kernel line will force Grub to boot the kernel in that runlevel.

  • I thought the question was about boot loader configuration... – Hauke Laging Jun 13 '13 at 19:59
  • @HaukeLaging - That wasn't how I read it. – slm Jun 13 '13 at 20:01
  • "I would like to know if it is possible to choose on start-up" – Hauke Laging Jun 13 '13 at 20:14
  • See my updates...I was getting to adding the details 8-). – slm Jun 13 '13 at 20:15
  • According to the tag wiki, Crunchbang is Debian-based. Debian does not use runlevels to control whether you have X or not. See also wiki.debian.org/RunLevel – tripleee Jun 25 '13 at 5:24
-1

Example of Adding the number:

root (hd0,4)
kernel /vmlinuz-2.6.35.14-106.fc14.x86_64 ro root=/dev/mapper/vg_grinchy-lv_root rd_LVM_LV=vg_grinchy/lv_root rd_LVM_LV=vg_grinchy/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb **quiet 3**
initrd /initramfs-2.6.35.14-106.fc14.x86_64.img

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.