Linux mint booting to console

Linux Mint Forums

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

LM v19.2 How to Boot to a Command Line

Post by mik007san » Mon Oct 14, 2019 11:53 am

I haven’t found anything useful regarding booting to a command line environment login instead of a GUI login interface. I have tried several suggestions found while searching the web for, «LinuxMint» and «boot to command line environment»; however, these suggestions are relative to older versions of Linux Mint and DO NOT work in version 19.2! These include modifying the /etc/default/grub file following with «update-grub», and modifying the grub line at boot.

There should be a simple way to boot to a command line environment similar to the RHEL/CentOS ‘inittab’ modifications. Any viable suggestions are appreciated. TIA. -Mike

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

Re: LM v19.2 How to Boot to a Comman Line

Post by zcot » Tue Oct 15, 2019 9:35 am

Without getting any more advanced, you can simply use the ctrl + alt + F1 (to F6) key combo at the normal graphical login screen. There are 6 TTY’s ready to use there, and tty7 is the graphical desktop session, under the F7 key. You can readily switch between any of them at any time, even from the authenticated desktop session, so you can go back and forth with any as you see fit.

JOPETA Level 17
Posts: 7771 Joined: Thu Nov 20, 2014 6:10 am Location: En un lugar de cuyo nombre no quiero acordarme

Re: LM v19.2 How to Boot to a Comman Line

Post by JOPETA » Tue Oct 15, 2019 12:05 pm

You can try only for one session, editing the default GRUB menu entry (the one that is selected by default) pressing E or TAB key and in the kernel line delete quite splash and write systemd.unit=multi-user.target in that place. Press F10 to boot.

After login in a text session, whenever you want a to get into a GUI session write startx (do not use sudo) . If you want to go back in text mode again just logout from the GUI session. Also you can open another text session with Alt+Ctrl+F2 or F1 and switch between then in the same way (Alt+Ctrl+F1/Alt+Ctrl+F2).

As it is said here, If you want to boot in such text session by default you will need to sudo systemctl set-default multi-user.target . To undo (start in a graphical session by default again) sudo systemctl set-default graphical.target .

Re: LM v19.2 How to Boot to a Command Line

Post by mik007san » Sun Nov 17, 2019 11:01 am

Читайте также:  Linux скрыть вывод команды

Here are bash scripts, which will allow one to switch between persistant GUI and CLI interfaces with no worries:

To create a boot to command line

#!/bin/bash # SetCLIBoot.sh: Creates a command line boot clear echo -e "\nThis script reboots your system!\n\n" read -r -p "Continue? [y/N] " ans1 ans1=$ # Set input to lower case if [ "$ans1" != "y" ] && [ "$ans1" != "yes" ] then echo -e "\nExiting\n" exit 1 fi sudo systemctl set-default multi-user.target sudo reboot exit 0 

To create a boot to GUI

#!/bin/bash # SetGUIBoot.sh: Creates a GUI boot clear echo -e "\nThis script reboots your system!\n\n" read -r -p "Continue? [y/N] " ans1 ans1=$ # Set input to lower case if [ "$ans1" != "y" ] && [ "$ans1" != "yes" ] then echo -e "\nExiting\n" exit 1 fi sudo systemctl set-default graphical.target sudo reboot exit 0

Источник

How To Boot To Console (Text) Mode Using Debian / Ubuntu, Fedora, Arch Linux / Manjaro And More

The instructions in this article should work with any Linux distribution that uses systemd (for the permanent mode below) and GNU GRUB (for the temporary mode), but I personally only tried this with Debian, Ubuntu, Manjaro and Fedora.

boot Linux in console mode (text mode)

Booting in console mode (text mode / tty) allows you to login to your system from the command line (as a regular user or as the root user if it’s enabled), without using a graphical user interface. This is useful in case your system fails to boot when using the graphical mode, or maybe you have a computer running Linux for which you don’t regularly use the GUI and ssh into it, so you’d like to save some system resources by booting in text mode. But regardless of the reason, this article shows you how to boot to console / text / tty on Linux.

Case A. Temporary booting to console mode (text mode)

Using these instructions, your computer will boot to console only for the current boot. After restarting the computer it will boot normally, so these changes are temporary.

1. To temporarily boot to console mode (tty), start your computer and immediately after the BIOS / UEFI splash screen, press and hold the Shift (BIOS), or press the Esc (UEFI) key repeatedly, to access the GRUB menu.

2. Once you see the GNU GRUB screen, with the first entry from the menu selected, press the e key. This allows you to edit the kernel parameters before booting.

Look for the line that begins with linux (use the Up / Down / Left / Right arrow keys to navigate); vmlinuz should also be on the same line. At the end of this line (you can place the cursor using the arrow keys at the beginning of the line, then press the End key to move the cursor to the end of that line) add a space followed by the number 3 . Don’t change anything else.

This 3 represents the multi-user.target systemd target which is mapped to the old, now obsolete runlevel 2, 3 and 4 (used to start and stop groups of services). For example the old runlevel 5 is mapped to the systemd graphical.target and using this starts. you’ve guessed it, the graphical (GUI) target. For more on systemd targets see this page.

Example #1. This is how the line beginning with «linux» looks like for Ubuntu 18.04 LTS (it doesn’t have to be identical for you, it’s just so you get an idea):

linux /boot/vmlinuz-4.18.0-15-generic root=UUID=1438eb20-da3d-4880-bb3a-414e+++0a929 ro quiet splash $vt_handoff

And this is how the line beginning with «linux» looks after adding the 3 at the end:

linux /boot/vmlinuz-4.18.0-15-generic root=UUID=1438eb20-da3d-4880-bb3a-414e+++0a929 ro quiet splash $vt_handoff 3

Example #2. This is how the line beginning with «linux» looks for Fedora 31 (it’s not identical for you, it’s just so you get an idea):

linux ($root)/vmlinuz-5.3.13-300.fc31.x86_64 root=/dev/mapper/fedora_localhost--live-root ro resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet

And this is how it looks after adding the 3 at the end of the line:

linux ($root)/vmlinuz-5.3.13-300.fc31.x86_64 root=/dev/mapper/fedora_localhost--live-root ro resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet 3

3. After doing this, press Ctrl + x or F10 to boot to console (text) mode.

Читайте также:  Transfer folder in linux

To reboot your system while in console mode, use the reboot command ( sudo reboot ).

It’s worth noting that Debian and Ubuntu based Linux distributions (including Linux Mint, Elementary OS, Pop!_OS, Zorin OS, etc.) come with a recovery mode built into the GNU GRUB menu. So in case you use Debian / Ubuntu or some Linux distribution based on it, get to the GNU GRUB menu as explained above, then select Advanced options , and from the new list that comes up select the first entry that ends with (recovery mode) . Select this entry and hit the Enter key, and you’ll get to a menu that, among others, allows you to drop to root shell prompt — when selected, your system continues to boot to the command line and not a graphical user interface, allowing you to login using your root password. This allows access to the filesystem in read-only mode; for read-write use mount -o remount,rw / . Use this for example to reset a lost user / administrator password on Ubuntu, Linux Mint, Elementary OS, etc.

Case B. Permanently booting to text mode (console mode)

Getting your Linux system to always boot to console (text / tty) mode is as easy as running a single command:

sudo systemctl set-default multi-user.target

This command sets text mode as the default systemd target (runlevel as it used to be called before systemd). After running this command, reboot your system and it will automatically boot to console / text mode every time.

Don’t know the current systemd target used on your system? Use this command, which will show the currently set target:

Extra tip: using this, your Linux computer will boot to tty1 (text-only virtual console). You can switch to a different virtual console by using Ctrl + Alt + F2 for tty2, Ctrl + Alt + F3 for tty3, and so on until tty7.

In case you want to undo this change and get your Linux system to boot to the default graphical mode, use:

sudo systemctl set-default graphical.target

After using this command, reboot ( sudo reboot ) and your system should start in graphical mode, as it was by default.

Источник

Linux mint booting to console

I thought I would write a brief tutorial on this since it was difficult to figure out on forums and other intermediate users may be interested.

For those of you who would like your Mint system to boot directly into console mode, it is quick and easy to do and easy to un-do as well. This was difficult for me to figure out as Mint seems to operate somewhat differently than other Linux versions in terms of making this change. This was written for Mint 10 64 bit. Not sure how it may vary from other versions.

Читайте также:  Аналог onenote for linux

Edit your /boot/grub/grub.cfg file and add the word «text» after the words «quiet splash» under the section that starts with ### BEGIN /etc/grub.d/10_linux ###. Be sure to use sudo to edit the file (don’t use the » marks).

1. Make a copy of the file in case «something goes bad»: cd /boot/grub > sudo cp grub.cfg grub.cfg.bakup.

2. Open the grub.cfg file (I prefer pico but use your editor of choice): sudo pico grub.cfg.

3. Use the arrow key to scroll down until you see ### BEGIN /etc/grub.d/10_linux ###.

4. Continue down a few lines more and find the line that resembles linux /boot/vmlinuz-2.6. ending in vga=792 quiet splash

5. Add the word «text» after «quiet splash» (no quotation marks)

6. Save the file: in pico use cntrl>x, y to replace and enter to save.

7. Reboot. Use terminal to get used to it: sudo shutdown -r now

8. Login using your normal login name and password.

If you want to return to automatically booting into GUI mode, simply redo the above steps only removing the word «text».

To start GUI mode from console mode, simply type startx

To end GUI mode and return to console, simply logout using the Mint Menu.

You lose the ability to «switch users» in GUI mode. Instead you need to logout to console, type exit and then login again using the different user’s name and password.

If people find this post useful, I can write another with some of the cool programs I run from terminal and the tools I use to get many of my «home computer» needs done without GUI.

Источник

How to boot into terminal on Linux Mint XFCE?

I have a Linux Mint XFCE system running on a lenovo z70. I’ve been trying to boot into the terminal on startup (but still allow me to start the graphical interface with startx if need be). Changing these settings here did nothing: http://ask.xmodulo.com/boot-into-command-line-ubuntu-debian.html and the directions here: https://community.linuxmint.com/tutorial/view/460 also do not work as there is no «quiet splash» line. I dont know if these are errors or what.

You didn’t specified version on your LinuxMint. If it latest 18.x version, it use systemd , you need to use: systemd.unit=multi-user.target in place of text

1 Answer 1

Linux Mint beginning with version 18 using different init system that calls systemd , so to be able to boot into console, one need to use:
systemd.unit=multi-user.target
Simply adding text to GRUB wouldn’t work on such systems.

There a few methods you can use to boot into console by default:

Method 1:

Comment line GRUB_CMDLINE_LINUX_DEFAULT=»» and add GRUB_CMDLINE_LINUX=»text»

#GRUB_CMDLINE_LINUX_DEFAULT="" GRUB_CMDLINE_LINUX="text" 

then apply changes by running: sudo update-grub

Now, tell operation system what systemd target to use on boot:
To boot by default in terminal, run:
sudo systemctl set-default multi-user.target

Next reboot will go to console without loading desktop.

To revert changes above (re-enable boot to GUI desktop by default) you need to run:
sudo systemctl set-default graphical.target

Method 2:

To disable login to GUI desktop, you need to disable MDM (Desktop Manager) service:
sudo systemctl disable lightmdm

To revert changes, run:
sudo systemctl enable lightmdm

If you want to start GUI Desktop on demand without changing previous preference, you can run: sudo systemctl start lightmdm

Источник

Оцените статью
Adblock
detector