OK, this is what I'm trying to achieve:
Have a separate menu option in GRUB, so that I can select it and boot straight into the command line – that is: without a desktop manager, but leaving the existing menu item (to boot Ubuntu as usual) intact.
I've looked into /etc/default/grub
but there seems nothing to do there. And also /boot/grub/grub.cfg
which is auto-generated, so I don't think it would be a good idea to edit it directly.
How should I go about it? Any idea?
Update: The existing answer (suggesting that this question was a duplicate) was obsolete. For the correct solution, please see the accepted answer below, which works beautifully. (at least for 16.04+ as it seems)
Best Answer
One
Open the file
/boot/grub/grub.cfg
and find the section that boots your "regular" Ubuntu.For me this is:
Copy that section to a new file, say
textmode.txt
.Two
Go to
/etc/grub.d
and create (or edit) the file40_custom
.Copy the following "header" to the file:
Add the menuentry from
textmode.txt
to the file but change some values (see below):The values that must be changed are:
'Ubuntu'
to'Ubuntu (text mode)'
(or whatever you like to appear in the menu)linux
line: change it tolinux /vmlinuz root=UUID=... systemd.unit=multi-user.target ro
. Make sure the UUID stays the same.initrd
line: change it to/initrd.img
Make sure you have symlinks in your
/
directory from/vmlinuz
and/initrd.img
to the current versions. This is the default, anyway.Three
Run
The difference between this approach and this answer to a very similar question is that in recent versions of Ubuntu the line
needs to be replaced with
I'm not sure what recent actually means but I guess it's 16.04 when systemd was introduced.