Recently (22/fev/2025) I experienced a problem where I was unable to Login to my main Ubuntu user, as the login process went into a loop
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
Note
Use this commando to view lsb_release -a
- Use the shortcut
ctrl + shift + f3
to open the terminal in login screen - Create a new user with command
sudo adduser <yournewusername>
sudo usermod -aG sudo <yournewusername>
- Try restart the graphic server with command
sudo systemctl restart gdm
orsudo systemctl restart lightdm
- Restart your system with command
reboot
- Look the login screen choose the your new user created and try access this account
Have success to access this new account? Probably your main account have problem to handle with xorg
server
This can happen due to several factors such as,
- problems with package updates, generating corrupted files
- incompatibility when changing versions between 20.04 to 22.04 or later
Before follow the solution try make logout from the newuser and try login with new account
if the problem still persists follow the topic below
My solution to solve this, was reinstall XOrg server in this user
- Use the shortcut
ctrl + shift + f3
to open the terminal in login screen - Try execute the commando
startx
Probably that you receive an error similar to this
/etc/X11/xinit/xserverrc: 3: exec: /usr/bin/X: not found
xinit: giving up
xinit: unable to connect to X server: Comection refused
xinit: server error
- Try install
xorg
sudo apt update
sudo apt install xorg
- Check if the X command really exists with command
ls -l /usr/bin/X
Important
Caution with case, the X must be in uppercase
- If the error persist, try reinstall with command
sudo apt install --reinstall xserver-xorg
- Check if the command
startx
work fine, should be show a message similar to this
X.Org X Server 1.21.1.4
& Protocol Version 11, Revision 0
Current Operating System: Linux hallex-costa 6.8.0-52-generic 153*22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-52-generic root=UUID=a5ecafBe-0ef7-43eb-a3a2-22f2110b9a9f ro
tsc=reliable clocksource=tsc quiet splash ut.handoff=?
xorg-server 2:21.1.4-2ubuntu1.7*22.04.12 (For technical support please see http://ww.ubuntu.com/support)
Current version of pixman: 0.40.0
Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.
Markers: (--) probed, (**) fron config file, (==) default setting, (+*) from command line, (11) notice, (II) informational, (WW) warning,
(EE) error, (NI) not implemented, (??) unknown.
" home/hallexcosta. local/share/xorg/Xorg.2. log"
(==) Using systen config directory
• lousshare/Xy Xog-conlog- Time: Sat Reb 22, 13-51:30 2025
waiting for X server to shut down
(Il) Server terminated successfully (0). Closing log file.n to X server lost
- If you have success, restart the system with command
reboot
and try make login again in the main user.