Xinit: unable to connect to X server: Connection refused

My PC isn’t booting.

When I type startx in command line I get this error:

xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

I didn’t change any config or log files prior to this.

Partial update state, unsupported kernel and kernel modules for your Nvidia GPU ?
From TTY run:
sudo pacman-mirrors -f5 && sudo pacman -Syyu
after it finishes, then run:
systemctl reboot

That didn’t work, I’m still having same problem.
I don’t know what’s the reason for that error.

when you type startx, post picture of the whole message

XOrg X Server 1.21.1.4
X Protocol Version 11, Revision 0
Current Operating System: Linux user 6.0.2-2-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Oct 15 13:31:58 UTC 2022 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.0-x86_64 root=UUID=4d7ba64f-dd90-426f-b8bc-89f642d6a6bb rw quiet udev.log_priority=3

Current version of pixmin: 0.40.0
Markers: (–) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II)
informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: “/var/log/Xorg.0.log”, Time: Mon Oct 24 16:11:36 2022
(==) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
(EE) Please check the log file at “/var/log/Xorg.0.log” for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: givig up
xinit: unable to connect to X server: Connection refused
xinit: server error

ok nothing suspicious… provide also this log:
cat /var/log/Xorg.0.log

does this issue happens also with the 5.15 kernel?

[    15.904]
X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
[    15.904] Current Operating System: Linux user 6.0.2-2-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Oct 15 13:31:58 UTC 2022 x86_64
[    15.904] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.0-x86_64 root=UUID=4d7ba64f-dd90-426f-b8bc-89f642d6a6bb rw quiet udev.log_priority=3
[    15.904]
[    15.904] Current version of pixman: 0.40.0
[    15.904] Markers: (–) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    15.904] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Oct 24 16:11:36 2022
[    15.906] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    15.906] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    15.908] (==) ServerLayout "layout"
[    15.908] (**) |-->Screen "Screen0"
[    15.908] (**) |   |-->Monitor "Monitor0"
[    15.908] (**) |   |-->Device "Device 0"
[    15.908] (==) Automatically adding devices
[    15.908] (==) Automatically enabling devices
[    15.908] (==) Automatically adding GPU devices
[    15.908] (==) Automatically binding GPU devices
[    15.908] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    15.910] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[    15.910]    Entry deleted from path.
[    15.910] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[    15.910]    Entry deleted from path.
[    15.910] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[    15.910]    Entry deleted from path.
[    15.910] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[    15.910]    Entry deleted from path.
[    15.910] (==) Font path set to:
        /usr/share/fonts/misc,
        /usr/share/fonts/TTF
[    15.910] (==) ModulePath set to "/usr/lib/xorg/modules"
[    15.910] (**) Extension "COMPOSITE" is enabled
[    15.910] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[    15.910] (II) Module ABI versions:
[    15.910]    X.Org ANSI C Emulation: 0.4
[    15.910]    X.Org Video Driver: 25.2
[    15.910]    X.Org XInput driver : 24.4
[    15.910]    X.Org Server Extension : 10.0
[    15.911] (++) using VT number 2

[    15.913] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[    15.915] (--) PCI:*(1@0:0:0) 10de:1f82:1043:86b7 rev 161, Mem @ 0x52000000/16777216, 0x40000000/268435456, 0x50000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[    15.915] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    15.915] (II) LoadModule: "glx"
[    15.916] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    15.923] (II) Module glx: vendor="X.Org Foundation"
[    15.923]    compiled for 1.21.1.4, module version = 1.0.0
[    15.923]    ABI class : X.Org Server Extension, version 10.0
[    15.923] (II) LoadModule: "nvidia"
[    15.923] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[    15.927] (II) Module nvidia: vendor="NVIDIA Corporation"
[    15.927]    compiled for 1.6.99.901, module version = 1.0.0
[    15.927]    Module class: X.Org Video Driver
[    15.928] (II) NVIDIA dlloader X Driver  520.56.06  Thu Oct  6 21:29:26 UTC 2022
[    15.928] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    15.929] (II) Loading sub module "fb"
[    15,929] (II) LoadModule: "fb"
[    15.929] (II) Module "fb" already built-in
[    15.929] (II) Loading sub module "wfb"
[    15.929] (II) LoadModule: "wfb"
[    15.929] (II) Loading /usr/lib/xorg/modules/libwfb.so
[    15.930] (II) Module wfb: vendor="X.Org Foundation"
[    15.930]    compiled for 1.21.1.4, module version = 1.0.0
[    15.930]    ABI class: X:Org ANSI C Emulation, version 0.4
[    15.930] (II) Loading sub module "ramdac"
[    15.930] (II) LoadModule: "ramdac"
[    15.930] (II) Module "ramdac" already built-in
[    15.937] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[    15.937] (EE) NVIDIA:     system's kernel log for additional error messages and
[    15.937] (EE) NVIDIA:     consult the NVIDIA README for details.
[    15.937] (EE) No devices detected.
[    15.937] (EE)
Fatal server error:
[    15.937] (EE) no screens found(EE)
[    15.937] (EE) Please check the log file at "/var/log/Xorg.0.log" for additional information.
[    15.937] (EE)
[    15.940] (EE) Server terminated with error (1). Closing log file.

and this:


it looks like its some nvidia issue…
try adding this parameter to your kernel (you can do it from tty):
sudo nano /etc/default/grub
and in this line: GRUB_CMDLINE_LINUX_DEFAULT - inside the quotes add this parameter:
ibt=off
dont remove anything from there, just add it to the existing parameters, save the file with ctrl+x, update grub with:
sudo update-grub
reboot and see if it helped

I still get same error. And I don’t know does the same issue happens with 15.5 kernel.

so try it out … if you dont have the grub menu shown during boot do this:
sudo nano /etc/default/grub
and edit this line to look like this (its the third from top):
GRUB_TIMEOUT_STYLE=menu
save it with: ctrl+x, update grub:
sudo update-grub
reboot and in the grub menu/advanced options select the 5.15 kernel - not the fallback one…

of course you have to install the 515 first if you dont have it installed:
sudo mhwd-kernel -i linux515

It works. Thank you. Will I now need to pick 5.15 kernel in grub menu every time and if yes is there a way to set it as default?

no, it will remember the last kernel you booted with… the grub time out is by default set to 5 seconds, after that it automatically boots with the latest selected kernel - in this case the 5.15;
if you dont want to wait 5s you can reduce the timeout to 3s:
sudo nano /etc/default/grub
and edit this line to look like this (its the second from top):
GRUB_TIMEOUT=3
save it with: ctrl+x, update grub:
sudo update-grub


also boot again with the 6.0 kernel, then boot back to the 5.15 kernel and provide logs from the failed 6.0 boot with:
journalctl -b-1 -p5 --no-pager
maybe there will be some hint for it not working…


also check output from:
grep ibt /etc/default/grub
to verify that the ibt parameter is set