Synopsis: Mageia rescue technique: switch to non graphical login. |
Contents
- 1 Introduction
- 2 Benefits
- 3 Steps
- 4 Step 2: login
- 5 Step 3: (optional) set default run level
- 6 Step 4: (optional) Display the currently set default run level
- 7 Step 5: Test graphics from "multi-user" (non-graphical login)
- 8 Other tips
Introduction
This wiki page documents a Mageia rescue technique of switching to boot to multi-user (run level 3, non-graphical login). This has been tested on Mageia 8 and 9.
Benefits
It sometimes happens that a systems update will not install the graphics driver that your system needs. It may be that you have been attempting some changes with the graphics driver and got into a situation where you just get a blank screen instead of the GUI login screen.
Or you simply cannot login on the normal Graphical User Interface (GUI) login.
This rescue technique lets you change the system so that it boots up into "run level 3" which is multi-user but not graphical login.
This allows you to login and debug the issue and rescue any data if you need to.
Steps
Step 1: Boot your system.
Boot your system.
In the Mageia Boot menu, press e to edit the kernel command line entry. Move the cursor to the line that starts with:
linux /vmlinuz-
Move the cursor right to the end of the kernel command line parameters (for example: "splash"). Append the following parameter by typing:
systemd.unit=multi-user.target
Note: separate this from existing parameters with a <SPACE> character.
Step 1b: if you have encrypted disk partitions
Note that with encrypted disk partitions we normally expect to be prompted for the encryption during the boot process.
If you have encrypted partitions and do not see a prompt for the disk encryption key(s) then you may need to press the F1 key to see the prompt. If you see some asterisks * then you can press the <backspace> key to remove them and then enter the disk encryption key.
Alternatively, another kernel command line parameter can be added:
nomodeset
This should result in the normal graphical prompt for the disk encryption key.
Continue and complete the boot process by typing: <ctrl>-x
The boot process should continue and show you a non-graphical login prompt.
Step 2: login
Example:
Mageia release 9 (Official) for x86_64 Kernel 6.5.13-desktop-6.mga9 on a 12-processor x86_64 / tty1 z600-mageia89 login:
Step 3: (optional) set default run level
After login, if you wish to keep multi-user (level3, non-graphical) for next reboot then use the command:
/bin/sudo systemctl set-default multi-user.target
Step 4: (optional) Display the currently set default run level
systemctl get-default
Example:
[user@localhost ~]$ systemctl get-default graphical.target
Note that graphical.target is the correct run level if you want to have a graphical login (eg: the "normal" case with run level 5 and graphical login).
Step 5: Test graphics from "multi-user" (non-graphical login)
To test to see if graphics are working:
[user@localhost ~]$ startx; exit
NB: this will start a default desktop environment (DE) such as plasma. Note, we have "; exit" so that when the desktop environment is exited we don't leave a logged in unsecured shell and a new login prompt will be shown.
If you need to start MATE, do:
[user@localhost ~]$ f=~/.xinitrc; mv -f ${f} ${f}- # backup old version [user@localhost ~]$ echo "/usr/bin/mate-session" > ${f}
Then start X-Windows with:
[user@localhost ~]$ startx; exit
Other tips
Enable inbound ssh
If you are unable to get any functional graphics working then you will have to do debugging etc from the non-graphical login shell. However, it is also possible to enable inbound ssh connections which will enable you to ssh from a second computer onto the system being rescued and run graphical display commands remotely.
First, make a note of the IP address using, for example, /sbin/ifconfig:
[mpb@wiki-mga8 ~]$ /sbin/ifconfig enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.18 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::223:8bff:fee2:6327 prefixlen 64 scopeid 0x20<link> ether 00:23:8b:e2:63:27 txqueuelen 1000 (Ethernet) RX packets 9774 bytes 5658812 (5.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 7667 bytes 5273693 (5.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 27 bytes 4480 (4.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 27 bytes 4480 (4.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlp3s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 26:ea:a7:cb:4c:52 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
In this example, ifconfig shows three network interfaces: ethernet (enp2s0), loopback (lo), and wireless (wlp3s0]. So, here the IP of interest is the ethernet: 192.168.101.18.
If needed: install openssh server
In case openssh server is not installed, install with:
/bin/sudo urpmi openssh-server
Enable inbound TCP port 22 connections
For ssh to work, we need to run drakfirewall and allow inbound ssh (normally TCP port 22).
Start the openssh server subsystem
/bin/sudo systemctl start sshd.service && systemctl status sshd.service
Alternative way to specify run level 3
In Step-1 (above) where you specify "systemd.unit=multi-user.target" it should also be possible simply to specify "3". This may save time and be less prone to error.
Alternative way to test start desktop environment (DE)
In Step-5 (above), it has been suggested to use a specific start script for your prerferred DE. So, if you have MATE installed, the start command is: /usr/bin/startmate.
If you have several DEs installed, you can list available start scripts with: "/usr/bin/start*".
Note also: if the DE fails with a "Server already active for display 0" error messaage,
then append " -- :1" (without the quotes) to the end of the startx command.
This could be useful if the display manager (dm) (sddm, gdm, xdm, etc.) is failing to display but X-Windows is otherwise working.
Research Mageia bug reports
Maybe the issue you are seeing has already been reported to the Mageia bug system ( https://bugs.mageia.org/ )?
It is worth searching to see if anyone else has found solutions or work-arounds.
One example is the ~/.Xauthority file having the wrong owner:group settings preventing login. See comment 1 in bug 20835 link: https://bugs.mageia.org/show_bug.cgi?id=20835#c1
Collect data for bug report
If you have found and are reporting a bug (via: https://bugs.mageia.org/ ) there are some useful data that will assist identifying and fixing any bug:
- Which Mageia release (9 is current at time of writing this)
- kernel version - uname -r
- /var/log/Xorg.0.log - log of what happened when trying to start X Windows (graphical) system
- Graphics card details: lspcidrake -v | grep Card