Boot to command line

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
druid001
Level 1
Level 1
Posts: 4
Joined: Fri Nov 19, 2010 6:13 pm

Boot to command line

Postby druid001 » Thu Nov 09, 2017 4:50 pm

Not exactly a noobie, but can't find a legitimate answer for this: How do I boot to the command line. I have Mint 18.2 Cinnamon. I have tried everything I've found on line, editing grub.cfg and grub bootloader. I would like to boot to command line, and have the option of running startx if I need to. Is it even POSSIBLE to do this? Some people on line suggested changing to a distro that came with a command line installation, but I really like Mint. I do not have a UEFI system.

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 4:58 pm

Yeap ... disable whichever display-manger you have installed, reboot ... wham, at least that'd get you into cli am not 100% positive atm as to whether it'd be as simple as startx at that point. Probably work anyway in starting the default session. It's always easily reversible ie "sudo systemctl enable mdm" and whatnot.

Could be a bit more too it. Google stuff like "startx without display manager" +xinitrc type files and related. Have done it just don't remember the details. Always found having a display manager too convenient to bother going without one. Doesn't take up all that much by way of system resources. Also note am sure there's probably 404 other easy ways to do this, it's gnu/Linux for chrissakes ! :P

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 5:12 pm

Went ahead and did/un-did it, ... Nope it'll be slightly more complex than simple "startx" and you'll need to google up, mentioned stuff like .xinitrc and/or .xsession. Also mentioned to me it's a pita. Setting up such to do simple stuff like even auto-login your user and etc isn't overly hard but don't want to deal with it. There are literally TONS of information in detail outlining how to do this. You need to google up a quality tute on it.

Also note, it's obviously YOUR OS ... if you break it badly in this project YOU get to keep all the pieces. Though I'll (and surely others) will try to help out if you do end up in borkage-ville.

Ended up having to do a "sudo dpkg-reconfigure lightdm" in my case am obviously using lightdm as DM, to get the sucker working properly again after disabling it. Can actually see several additional approaches to doing whatever in regards to this. No shortage of info, often a shortage of search efforts. :P

Have you tried this ?
Yes you can. As described here (ubuntuhandbook.org - Boot into text console ubuntu) you need to edit /etc/default/grub to have the next boot end up in text mode. In summary you will set these parameters:

GRUB_CMDLINE_LINUX="text"
GRUB_TERMINAL=console


Again easy/fast to reverse if you run into issues. Just be ready to edit that file with a cli text-editor like nano or whichever. Put it back the way it was before you changed it and "sudo update-grub" ... done. Source of that was supposed to be relevant to ubuntu v 16.04 so absolutely should apply to Linux Mint.

Also just a head up, was curious so ran "cat /etc/default/grub" to look the contents of the file over and it's got this line which may be of concern or not. Tend to doubt it but the line in my OS's file says ...

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 5:36 pm

Also hi Druid ... am not trying to be snarky or in any way insulting etc. Am sure you've done some searching and that's great. Only nowadays I tend to like to try and point someone in a good direction that I think's relevant to their situation and what's involved and hope they take it from there. Gone are the dys of painfully detailed posts, supported by time taken to google up quality supplemental info and link to it etc.

Am too lazy and life's too short. Plus am a firm believer in encouraging people to be self sufficient. The ole give a person a fish vs teaching them to fish thingy. :D Anyway ... have every confidence you'll get it done and learn plenty of useful stuff in the process.

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 6:19 pm

*READ WHOLE POST*

Ah one more, remembered this and simple google search to track it down. HOAS is touched by the very gnu/Nix gawds themselves, mucho, mucho, mas muey respect for him and his MASSIVE mad nix and tech skills. Mentioned in another thread was no slouch myself learning about as much gnu/Linux as I could and yet there'd been people come along years after me and quickly surpassed me. Honestly he's the only one but did leave me in the dust. :P

Have joked with him about how he finds time or does he even sleep. How can someone be so many places, posting top quality info everywhere by the 1,000's of posts !!! Still find the time to eat/sleep ... breathe etc. Arch forum, Debian forum, MANY others, BSD forum on and on !!!! I personally think the guys a cyborg by this point. No need to sleep/eat nor breathe just do techie type stuff 24/7 !!!! :D


Anyway here's a tute by him on relevant subject matter. Gives you some good quality info and factors involved in what you're wanting to do. Though Debian ... yes MUCH of what applies to Debian still totally valid on ubuntu and based (Linux Mint.) and/or vice-versa, not everything necessarily but MUCH and can be readily adapted with some search and common sense.

PS, Oops was so busy droning about Hoas, forgot to mention. As have said all over the forum already. This may be a venture best conducted in a vm = virtual-machine or on a testing partition with a throw-away LM OS you don't mind having breakage in. NOT your daily driver folks. Learn in vm ... assure you now know what you're doing, apply to main-stay OS's if you so desire.


Not that any of this should be much hassle to rollback or fix. Just with LM being a newuser-centric niche focused distro and a great one. Still feel better adding that type of stuff. Plus besides overall think it's a good method for any skill level nixer. Who has virtualization capability on their hardware.

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 7:50 pm

Pointless update: Nope I was wrong, in my case disabling lightdm, then logging in and simply using "startx" did launch my default session no problem. Had thought of mentioning using the full path with startx ie: "startx /usr/bin/openbox" to launch the session you want. So went ahead and re-disabled lightdm to check it out for fun.

Ran the command, terminal tells me, nopers ... no such command hmmmm. "apt-cache search startx" ... returns a package I was missing called "xinit" one tiny package, went ahead and installed it and ran the full path again with startx. Did in fact startx but it was a plain jane session missing all my tweaks etc and config files settings from my /home/username. Ok ... well concluded needed to go ahead and config and define some stuff in .xsession, .xinitrc or etc.

Thought ok ... that's cool, "sudo dpkg-reconfigure lightdm" again, reboot ahhhhh back into the nice and convenient realm of using a display manager. Then for whatever reason said, hmmmm, why not go ahead and see what disabling lightdm again and running just flatout startx does ( thinking it would in fact do the following and it did.) It launched my default session with all config's. Though still if you want to have multiple desktops/windows managers, you'll need to rely on a .xinitrc file or whatever. Would make it mucho less hassle.

Going to play around with this for awhile longer before flipping the light switch back on in lightdm. :D Anyway all the answers you could possibly need are bound to be present in the how-to by Hoas. With a bit of fiddling or whatever. I just stumbled my way through it and since I've went through this much trouble already. Will check boot-time, RAM stats, check around for any errors and/or functionality problems.

Everything checks out in the postive, probably go ahead and setup the proper files in proper locations and setup autologin + auto startx w/o using display manager for awhile.

User avatar
Flemur
Level 13
Level 13
Posts: 4553
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Boot to command line

Postby Flemur » Thu Nov 09, 2017 8:03 pm

druid001 wrote:Not exactly a noobie, but can't find a legitimate answer for this: How do I boot to the command line.

From /boot/grub/grub.cfg...

This is an entry for a normal boot:

Code: Select all

menuentry 'Mint 18    sda1  4.4.0-83 ' {
  root=(hd0,1)
  linux      /boot/vmlinuz-4.4.0-83-generic root=/dev/sda1 ro
  initrd  /boot/initrd.img-4.4.0-83-generic
}


This entry boots to a console with no graphics:

Code: Select all

menuentry 'Mint 18    sda1  4.4.0-83 SINGLE ' {
  root=(hd0,1)
  linux      /boot/vmlinuz-4.4.0-83-generic root=/dev/sda1 ro single
  initrd  /boot/initrd.img-4.4.0-83-generic
}

IOW, stick "single" on the end of the 'linux' statement.

IIRC you should have some option like this already when grub installs itself.

Edit: I create grub.cfg by hand...if you don't have any eufi or whatever stuff going on, try copying that 'single' part into your grub.cfg (making the obvious changes) and see if it works. Also pretty sure there's a way to enter those params from the "grub>" prompt...?
Mint 18.2 Xfce/fluxbox/pulse-less - Xubuntu 16.10/fluxbox/pulse-less
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 8:15 pm

^Flemur certainly knows what he's doing and definitely won't have any problem setting up something that works for him. Though in this we disagree are many better ways to go about this, some listed in this book of post after post I put up. You are not supposed to edit that file and it'll get overwritten every time you "sudo update-grub" as well as every time your system does it for you. ie: Install a new kernel etc.

I say again ... it's gnu/Linux for chrissakes. So many ways to do whatever, to whichever persons tastes. Approved way(s) to go about xyz, hacks aplenty which might very well all work just fine ( from white-gray-2-pitchblack) Those at that end are dirty hacks and ill advised to use even though they may work for xyz-nixer. In this case think you/Flemur is getting into the black spectrum of system hacking. No matter though. Harmless overall but irritating to have to fix when grub gets updated and many better ways to go about it. :)

lmintnewb2

Re: Boot to command line

Postby lmintnewb2 » Thu Nov 09, 2017 10:01 pm

Ok going to add some stuff to this, why not ? Come this far, it's not off-topic either as it's closely related and OP might wish to explore some of it at some point in future. Also hey just 2 cents Druid but think it's admirable for people to do this type of thing. If only for the learning experience. That being trying the whole "live in command line" thing for awhile ... even just occasionally.

It's a shocker and personally see the beauty of a both and a real need for both GUI/CLI. Sometimes one is just so much easier or powerful for doing something, than the other etc. So I have nothing against gooey(gui) stuff. Same time like trying to be fairly fluent in both as well.

This is mostly related to stuff such as autologin, auto startx w/o DM or auto running various other stuff. Used to be able to use the rc.local file to run stuff at system's startup ie: "startx", haven't dorked with it in awhile and hadn't dorked much with it prior to systemd coming onto the scenes so not sure of it's current state of usefulness. Also there's such things as setting up an @boot crontab ... to run xyz command(s) or script(s) too.

Not going into detail as not all that informed on all and everything involved myself. Fortunately however, Google knows everything if you but ask it the right questions. :D See this type of stuff and NOTE: I AM NOT endorsing that, looks about right to me but haven't as yet really fiddled with it or even looked it over closely. It just seems to summarize what I was trying to get at in all the droning type above.

PS, the answer to which ye seek Druid is within this thread though. So have at it folks (safely) and happy Minting !


Return to “Newbie Questions”