LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-24-2022, 11:57 PM   #1
kriukov
LQ Newbie
 
Registered: Nov 2022
Posts: 5

Rep: Reputation: 0
Xorg fails on login


I have a remote work computer where I can connect by ssh and by remote desktop (GUI). It has Ubuntu 18.04 (with XFCE which I installed later, after another person left it for me). Everything worked fine for years until about two months ago. The login manager (which was gdm3) simply stopped functioning. I installed lightdm and started it, and it worked. But when entering login and password, lightdm just returns the login screen and doesn't go to the user's GUI. I tried creating another user and log in its freshly created environment - no luck, the same problem. I tried to run startx in the remote terminal and send it into background, and the following appeared:

"xinit: Connection to X server lost"

(some googling and actions)

"dev/dri/card0 failed to set DRM interface: permission denied"

(some googling and actions)

"Xorg.wrap: only console users are allowed"

"xf86OpenConsole: Cannot open virtual console 2 (Permission denied)"

"AddScreen/ScreenInit failed for driver 0"

"xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)"

I changed the owner of /dev/tty2 to my username (where I ran startx from) - no result.

I completely reinstalled Xorg - no result.

So I cannot use the user's GUI - the graphical desktop is stuck at login (lightdm); when I stop lightdm and start gdm, it says it's running in low-mode graphics, and offers options which don't even work. I don't reboot because I don't want to risk losing its current network config and ssh access to it.

Could it be a hardware issue? Before there were strange things with the hard drive (sudden appearance of "read-only file system"), which don't seem to appear anymore, but if from what I posted it is very likely, then configuring software probably won't work.

Last edited by kriukov; 11-25-2022 at 12:07 AM.
 
Old 11-25-2022, 07:36 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,828
Blog Entries: 1

Rep: Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069
Quote:
Originally Posted by kriukov View Post
Everything worked fine for years until about two months ago.
One thing this can translate to is an absence of freespace on the / filesystem, leading to boot failing to mount the / filesystem rw. Check available freespace on /.
Code:
> sudo mount | grep " / "
/dev/sda17 on / type ext4 (rw,noatime,errors=remount-ro,data=ordered)
> sudo df -h | grep -B1 " /$"
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda17      7.7G  6.5G  817M  90% /
If little to none exists, try removing the largest files from /var/cache/apt/archives/ to create some freespace, then rebooting. If this allows mounting the / filesystem rw instead of ro, you can do some housecleaning, starting with sudo apt clean. If your normal user(s) can login, and /home/ is not a separate filesystem, they should be sure to start by emptying their trash folders. If snapshotting is enabled, remove obsolete old snapshots.
 
1 members found this post helpful.
Old 11-25-2022, 12:25 PM   #3
kriukov
LQ Newbie
 
Registered: Nov 2022
Posts: 5

Original Poster
Rep: Reputation: 0
The free space on / is 5% (92 Gb), so it's not a problem. Right now / is mounted as rw:

/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

Normal users can login, but only via terminal (via ssh). GUI fails to log in.

So it's not the disk space that's the problem - it must be something else.

Last edited by kriukov; 11-25-2022 at 12:27 PM.
 
Old 11-25-2022, 01:22 PM   #4
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,174

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
I think the free space on / is the problem. I recall that EXT filesystems will reserve %5 of / for root.
https://chiaforum.com/t/ext4-users-r...ed-blocks/1972
You can reduce that amount from the above link, or clear out some files to free up space.

Most GUIs will write files to /tmp and /var/tmp, which are most likely on / unless separate partitions were made for them.
 
Old 11-25-2022, 02:55 PM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,828
Blog Entries: 1

Rep: Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069
df only reports space available to users. stat provides more, e.g.:
Code:
# stat -f -c '%a blocks free and %f blocks free for root (%S bytes per block)' /
2112688 blocks free and 2347183 blocks free for root (4096 bytes per block)
# stat -f /
  File: "/"
    ID: 1244e4e563a3cce1 Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 4527575    Free: 2347183    Available: 2112688
Inodes: Total: 1155072    Free: 933630
Is /home a separate filesystem that is full to users?
 
Old 12-23-2023, 01:31 PM   #6
kriukov
LQ Newbie
 
Registered: Nov 2022
Posts: 5

Original Poster
Rep: Reputation: 0
Update on this: the computer is still in the same situation, I cannot reboot because of possible loss of ssh and remote desktop connection (it has manual network configuration).

The problem persists: cannot login from GUI. Login manager is lightdm. Tried the following (in addition to the things mentioned before):

- Purged and reinstalled xfce and xfce4-session.

- Restarted various services (could not restart dbus without reboot and I cannot reboot), some of them many times

- Deleted ~/.Xauthority and ~/.ICEauthority

- Checked permissions on /tmp

- Checked sessions in xauth and did DISPLAY=:0; export DISPLAY; xauth add $DISPLAY . <hex key from xauth list>

- Check free space (seems good)

- Created another user and tried to login as him.

- Copied /etc/xdg/xfce4/xinitrc to ~/.config/xfce4

Nothing helped so far.

One thing that changed: after copying xinitrc (the last attempt above), xfce gives the dialog: "Unable to load a failsafe session: Unable to determine a failsafe session name. Possible causes: xfconfd isn't running (D-Bus setup problem); environment variable $XDG_CONFIG_DIRS is set incorrectly (must include /etc), or xfce4-session is installed incorrectly." After answering the dialog, it takes me back to the login screen of lightdm.

Restarting xfconfd gives no result either. I also noticed that I (as a user) do not have permissions to execute/open /etc/xdg/xfce4, if that matters.

Don't know what else to try.
 
Old 12-23-2023, 07:22 PM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,828
Blog Entries: 1

Rep: Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069
Reinstalling software in linux generally doesn't change existing configuration. Software needs to be (apt) purged before installing again to get rid of configs that may be broken, and possibly the problem. If /etc/X11/xorg.conf exists, please try renaming it something else, then restarting your DM. Also, show here input/output from ls -gG /etc/X11/xorg.conf.d/, which could contain (a) thwarting .conf file(s).

Running in low-mode graphics suggests something got misconfigured, or required graphics firmware or driver disappeared, or linux-modules-extra didn't get installed on the kernel you are running. Does your currently running kernel have linux-image, linux-modules and linux-modules-extra comprising it/installed? What is output from cat /proc/cmdline from a normal boot attempt?

/var/log/ and/or ~/.local/share/xorg/ should contain Xorg.#.lo* file(s) that may have clues. Pastebinning them could be helpful.

I wonder if a significant LTS upgrade caused a GDM greeter/X move from tty7 or 8 to tty1 or 2, and that's where the problem started. All my Ubuntu's use either KDM or TDM, which still run on tty7, never GDM or LightDM, which upstream moved I know not when off of 7/8 to 1/2, at least in more recent distros.
 
Old 12-25-2023, 06:35 PM   #8
kriukov
LQ Newbie
 
Registered: Nov 2022
Posts: 5

Original Poster
Rep: Reputation: 0
Test
 
Old 12-25-2023, 06:37 PM   #9
kriukov
LQ Newbie
 
Registered: Nov 2022
Posts: 5

Original Poster
Rep: Reputation: 0
Neither /etc/X11/xorg.conf, nor /etc/X11/xorg.conf.d/ exist.

cat /proc/cmdline gives this:
BOOT_IMAGE=/boot/vmlinuz-4.15.0-72-generic root=UUID=c60af245-09c2-4b84-8aac-d55f929213ec ro

The most recent file is /var/log/Xorg.0.log (other files are of last year), here are its contents:

[Cannot post contents because the site takes me to "check if the connection is secure" page and after that gives a blank page. Attempted to attach the log file to this post.]

Also, I was surprised to find the files /.Xauthority and /.xsession-errors (yes, in the root folder); I renamed them just in case, which did not fix the issue.
Attached Files
File Type: txt Xorg.0.txt (16.9 KB, 14 views)

Last edited by kriukov; 12-25-2023 at 06:40 PM.
 
Old 12-26-2023, 12:09 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,610
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
When you have had a Debian-based system running for years, sometimes your root partition gets filled up with generations of downloaded packages. You can clear them with
Code:
sudo apt clean
.
 
Old 12-26-2023, 12:20 AM   #11
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,828
Blog Entries: 1

Rep: Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069Reputation: 2069
I picked the following PC to try to simulate your problem based upon things I saw in your log:
Code:
# inxi -MC
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B250M-C v: Rev X.0x
    serial: 171013077301155 UEFI: American Megatrends v: 1608 date: 10/21/2019
CPU:
  Info: quad core model: Intel Core i5-7500T bits: 64 type: MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 800 min/max: 800/3300 cores: 1: 800 2: 800 3: 800 4: 800
# inxi -GSaz --vs --zl --hostname
inxi 3.3.31-00 (2023-11-02)
System:
  Host: ab250 Kernel: 4.15.0-213-generic arch: x86_64 bits: 64 compiler: gcc
    v: 7.5.0 clocksource: tsc available: hpet,acpi_pm
    parameters: BOOT_IMAGE=/vmlinuz ro root=LABEL=<filter> noresume
    ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off
    pci=noaer
  Desktop: Trinity v: R14.1.1 tk: Qt v: 3.5.0 info: kicker wm: Twin v: 3.0
    vt: 7 dm: 1: TDM 2: XDM Distro: Ubuntu 18.04.6 LTS (Bionic Beaver)
Graphics:
  Device-1: Intel HD Graphics 630 vendor: ASUSTeK driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports:
    active: DP-1,HDMI-A-2,HDMI-A-3 empty: DP-2,HDMI-A-1 bus-ID: 00:02.0
    chip-ID: 8086:5912 class-ID: 0300
  Display: x11 server: X.Org v: 1.19.6 driver: X: loaded: modesetting
    unloaded: fbdev,vesa dri: i965 gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3600x2640 s-dpi: 120 s-size: 762x558mm (30.00x21.97")
    s-diag: 944mm (37.18")
  Monitor-1: DP-1 pos: primary,bottom-l model: Acer K272HUL serial: <filter>
    built: 2018 res: 2560x1440 hz: 60 dpi: 109 gamma: 1.2
    size: 598x336mm (23.54x13.23") diag: 686mm (27") ratio: 16:9 modes:
    max: 2560x1440 min: 720x400
  Monitor-2: HDMI-A-2 mapped: HDMI-2 pos: top-left model: NEC EA243WM
    serial: <filter> built: 2011 res: 1920x1200 hz: 60 dpi: 94 gamma: 1.2
    size: 519x324mm (20.43x12.76") diag: 612mm (24.1") ratio: 16:10 modes:
    max: 1920x1200 min: 640x480
  Monitor-3: HDMI-A-3 mapped: HDMI-3 pos: top-right model: Dell P2213
    serial: <filter> built: 2012 res: 1680x1050 hz: 60 dpi: 90 gamma: 1.2
    size: 473x296mm (18.62x11.65") diag: 558mm (22") ratio: 16:10 modes:
    max: 1680x1050 min: 720x400
  API: EGL v: 1.4 platforms: gbm: drv: N/A x11: drv: N/A
    inactive: wayland,device
  API: OpenGL v: 4.6 compat-v: 3.0 vendor: intel mesa v: 20.0.8 glx-v: 1.4
    es-v: 3.2 direct-render: yes renderer: Mesa DRI Intel HD Graphics 630 (KBL
    GT2) device-ID: 8086:5912 memory: 2.93 GiB unified: yes
# xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x47 cap: 0x9, Source Output, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:modesetting
# lsmod | sort | egrep 'i915|vid'
drm                   401408  5 drm_kms_helper,i915
drm_kms_helper        172032  1 i915
i2c_algo_bit           16384  1 i915
i915                 1626112  4
video                  53248  2 asus_wmi,i915
#
Hopefully it's reasonably similar. In fact on first X open here all went fine only until I tried to log out. It was very resistant. When it finally brought me back to the login greeter, it was in a lower than normal screen resolution, and the Xorg.0.log generated was nearly 6X a normal size, with lots of repeats indicative of mode support failures with one of the displays. Something is or wasn't right with X handling of my displays. I note that the kernel I am running is 6 months old, even though I just did apt-get full-upgrade to get to that kernel.

First thing that jumped at me in your log is (EE) open /dev/fb0: No such file or directory. (EE) lines are always bad news. Next thing that got my attention is you're booted to a 49 month old kernel. There have been a lot of bug fixes since then, both in kernel, and in the rest of the OS, likely including multiple X components. (WW) modeset(0): Unable to find connected outputs - setting 1024x768 initial framebuffer is another problem. X must be able to identify connected outputs to work properly.

Have you been installing updates over the past 4 years and just not rebooting to use the updated kernels, or are you still running as originally installed, free of updates? If you've been updating without rebooting, something in the X stack may have grown incompatible with your ancient kernel, or some bug exposed by it, causing a newer to be required to fix this. I'm doubtful there's much likelihood a solution exists and can be found absent getting up-to-date and rebooting, likely meaning upgrading at least to 20.04. 22.04 will soon be 2 years old, at which time 24.04 will be released, and 18.04 should be stone dead to the FOSS world.

Without updating and rebooting, I don't know of much to suggest. You might try modprobe -r i915 && modprobe i915, and/or same with other loaded graphics modules, assuming I'm right that you're using an Intel GPU. Ordinarily I would suggest use of xrandr's tools mode, but it needs to be able to ID connected outputs to work.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] After 10 installation, login screen password fails. (rootuser works though) (login screen is not username password) studpenguin Debian 8 08-18-2019 12:32 PM
XFCE screen lock fails to login after failed login attempt semiabsent Linux - Desktop 1 11-01-2018 03:47 PM
Ubuntu login fails and returns to login maverick1989 Linux - Newbie 3 05-20-2013 02:28 PM
Login fails - being taken back to login screen donhare Mandriva 3 11-11-2004 04:53 PM
Considering Xorg, Slack favors Xorg over Xfree Nichole_knc Slackware 7 06-13-2004 06:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 02:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration