FocusedWolf

Arch: TTY boot from GRUB

Jul 19th, 2025 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. Boot to TTY from GRUB menu:
  2.  
  3. 1. Boot to the GRUB menu.
  4. 2. Highlight the Arch Linux boot entry.
  5. 3. Press e to edit the boot parameters.
  6. 4. Find the line that starts with "linux" and append to the end " systemd.unit=multi-user.target" or " 3" (relying on legacy compatibility mapping of runlevel 3).
  7. 5. Press F10 or Ctrl + X to boot with these options. NOTE: This is temporary, does not apply to future startups.
  8.  
  9. NOTE: systemd.unit=multi-user.target is text mode (like runlevel 3).
  10. systemd.unit=graphical.target is GUI mode (like runlevel 5).
  11. Appending 3 to the kernel parameters in GRUB is a legacy method from the SysV init system.
  12. It still works works in many systemd-based systems because systemd provides compatibility by mapping runlevels to targets.
  13.  
  14. Boot to SDDM from TTY:
  15.  
  16. $ sudo systemctl start sddm
  17.  
  18. NOTE: If SDDM fails to start check for issues: $ journalctl -xeu sddm
  19.  
  20. TIP: Set up an alias: $ echo "alias gui='sudo systemctl start sddm'" >> ~/.bashrc
  21.  
  22. Boot to KDE (skip SDDM) from TTY:
  23.  
  24. $ exec dbus-run-session startplasma-wayland
  25.  
  26. TIP: Set up an alias: $ echo "alias gui2='exec dbus-run-session startplasma-wayland'" >> ~/.bashrc
  27.  
  28. Adding a persistent TTY boot option to the GRUB menu:
  29.  
  30. NOTE: The new boot option will appear at the end of the list of options.
  31.  
  32. SOURCE: https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html
  33. For more detailed customisation of grub-mkconfig's output, you may edit the
  34. scripts in /etc/grub.d directly. /etc/grub.d/40_custom is particularly
  35. useful for adding entire custom menu entries; simply type the menu entries
  36. you want to add at the end of that file, making sure to leave at least the
  37. first two lines intact.
  38.  
  39. SOURCE: https://www.linux.org/threads/grub-menu-entry-to-boot-to-tty.44508/
  40. 1. Copy a working menuentry from /boot/grub/grub.cfg into /etc/grub.d/40_custom.
  41. 2. Change its name to [menuentry 'Arch Linux TTY'] or whatever.
  42. 3. Add "systemd.unit=multi-user.target" or "3" (relying on legacy compatibility mapping of runlevel 3) to the end of the "linux" line.
  43.  
  44. Example:
  45.  
  46. /etc/grub.d/40_custom
  47.  
  48. #!/bin/sh
  49. exec tail -n +3 $0
  50. # This file provides an easy way to add custom menu entries. Simply type the
  51. # menu entries you want to add after this comment. Be careful not to change
  52. # the 'exec tail' line above.
  53.  
  54. menuentry 'Arch Linux TTY' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6d3bcf47-8794-4335-b408-7385d219f284' {
  55. load_video
  56. set gfxpayload=keep
  57. insmod gzio
  58. insmod part_gpt
  59. insmod ext2
  60. search --no-floppy --fs-uuid --set=root 6d3bcf47-8794-4335-b408-7385d219f284
  61. echo 'Loading Linux linux ...'
  62. linux /boot/vmlinuz-linux root=UUID=6d3bcf47-8794-4335-b408-7385d219f284 rw loglevel=3 quiet nvidia_drm.modeset=1 nvidia_drm.fbdev=1 nvidia.NVreg_EnableGpuFirmware=0 nvidia-drm.gsp_disable=1 systemd.unit=multi-user.target
  63. echo 'Loading initial ramdisk ...' # ^-- Added to make this entry boot to TTY.
  64. initrd /boot/intel-ucode.img /boot/initramfs-linux.img
  65. }
  66.  
  67. 4. $ sudo grub-mkconfig -o /boot/grub/grub.cfg
Advertisement
Add Comment
Please, Sign In to add comment