public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Michael <confabulate@kintzios.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] can't start X as user
Date: Thu, 15 Jun 2023 13:32:29 +0100	[thread overview]
Message-ID: <4149270.1IzOArtZ34@lenovo> (raw)
In-Reply-To: <ZIp1qZlH3/Xyryu2@ca.inter.net>

[-- Attachment #1: Type: text/plain, Size: 6637 bytes --]

On Thursday, 15 June 2023 03:21:29 BST Philip Webb wrote:
> 230614 Michael wrote:
> > On Wednesday, 14 June 2023 01:21:53 BST Philip Webb wrote:
> >> My new machine has no problem with graphics using System Rescue etc
> >> nor using 'startx' as root with Gentoo, but it refuses to start as user.
> >> 
> >> I've had a series of errors :
> >>   parse_vt_settings : can't open /dev/tty0 (permission denied)
> >> 
> >> after adding my user to 'tty input' in 'group' :
> >>   can't open virtual console 7 : permission denied

The startx command would launch a GUI in the same VT you are running startx in 
- you will not have permission to launch a GUI in a console when you are not 
logged in it.


> > Not sure if this is necessary:
> >   $ grep 'tty|input' /etc/group
> >   tty:x:5:
> >   input:x:97:
> My user is in 'tty wheel usb input video' (among others).

I understand, but this is not necessary - unless you have some special 
programs requiring your user to have direct access to devices/libraries/
whatever is controlled by these groups - e.g. on the PC I'm currently logged 
in:

$ grep 'tty|wheel|usb|input|video' /etc/group
tty:x:5:
wheel:x:10:root,michael
video:x:27:root,michael,sddm
usb:x:85:pcscd
input:x:97:


> > The elogind service ought to be in boot runlevel according to the wiki:
> > https://wiki.gentoo.org/wiki/Elogind#Configuration
> 
> I've corrected that & checked that Pam is running & Udev is in 'sysinit'.

"... Pam is running"?

Not sure what you mean here.  Did you mean to say dbus is in the default run 
level and running?


> >> 'xorg-server' has 'USE="elogind"'.

Good.


> >> In my current machine, there is a  /dev/fb0  with permission  660 .
> >> but there is no such device in the new machine.
> 
> Ditto for  /dev/dri/card0 .
> 
> > Have you followed this wiki page to configure your kernel,
> > include the appropriate firmware for your card(s),
> > set up INPUT_DEVICES & VIDEO_CARDS in make.conf,
> > emerged associated x11-base/xorg-drivers
> > and the x11-base/xorg-server packages before a reboot ?
> > https://wiki.gentoo.org/wiki/Xorg/Guide
> 
> Yes.  I have "evdev" + "radeon vesa" in 'make.conf'.

You need to recast an eye over the above Xorg Guide:

There is a kernel module EVDEV:

$ grep EVDEV /usr/src/linux/.config
CONFIG_INPUT_EVDEV=y

which should not be confused with the portage variable INPUT_DEVICES "evdev", 
now superseded by "libinput":

$ portageq envvar INPUT_DEVICES
libinput

About half way down the page the recommended INPUT_DEVICES flags to use when 
emerging x11-base/xorg-drivers are shown as:

INPUT_DEVICES="libinput ... -evdev".

Also, the radeon input device is meant for older radeon cards.

As is vesa.

> 'xf86-video-ati/vesa' are installed,

These would not be installed if you had configured your kernel correctly for 
your current video card.

You should not need the vesa generic driver for a graphic framebuffer these 
days:

$ grep FB_VESA /usr/src/linux/.config
# CONFIG_FB_VESA is not set

What you should be using instead is kernel mode setting (KMS), by setting it 
up in the kernel as explained in this section:

https://wiki.gentoo.org/wiki/Xorg/Guide#Kernel_modesetting

As suggested in the above guide and depending on how new your card is, check 
this page to adjust your kernel config and specify the necessary firmware 
accordingly:

https://wiki.gentoo.org/wiki/AMDGPU


> as is 'xorg-server' + all its requirements ("dependencies").

> > There should be a fb0 device listed:
> >   $ ls -l /dev/fb*
> >   crw-rw---- 1 root video 29, 0 Jun 14 08:52 /dev/fb0
> 
> ANB5 has  /dev/fb0  /dev/dri/card0  with  660  permitions, ANB6 hasn't
> (those are my names for the present + new machines).

You need KMS and direct rendering configured in your kernel, which is why I 
suspect your kernel requires more work as suggested above.  Thereafter you'll 
need to re-emerge xorg and mesa before your reboot to drag in the correct xf86 
and mesa drivers.

[snip...]

> 230614 Jack wrote :
> > what does /var/log/Xorg.0.log show ?
> 
> It has these errors (EE) in the X log file :
> 
>   Failed to load module "fbdev" (does not exist)
>   Open /dev/dri/card0 : no such directory or file
>   VESA (0) : cannot read int vect
>   Screens found, but none has a useable configuration
> 
> Do I need 'fbdev' or 'card0' ?  Whatever is "int vect" ?

You're missing the appropriate graphics configuration in your kernel, hence 
there's no direct rendering card0 available.

I think the "int vect" message is due to an old xorg-server bug, related to 
keyboard hotkeys.  Not relevant to your problem.


> When I try to 'startx' as user, the log file is in  ~/.local/share/xorg ,
> which is also where it is in ANB5.  When I try 'Xorg -configure',
> it produces nothing of use & dumps it in my home directory (ugh).

Normally, you should not need an Xorg config file these days, unless you have 
special requirements and GUI desktop configuration menu cannot address these.  
Very much a last resort.


> I can probably cut the Gordian knot by emerging Xorg-server with 'suid'.
> How insecure is that for a single-user system in a house ?

If any of your graphics applications were to be compromised in any way, then 
rogue code being run will be doing so with root access.  This is not a 
particularly good idea and a weakness in the old way Xorg used to be 
configured.  At long last, xorg-server is now run as non-suid:

https://www.gentoo.org/support/news-items/2020-06-24-xorg-server-dropping-default-suid.html


> The Elogind approach has worked in ANB5 since Aug 2020.
> 
> I can't make much of a useful comparison between the  2  machines,
> as ANB5 dates from 2015, ie long before the 'elogind' affair in 2020,
> & it has Nvidia graphics, whereas ANB6 has cutting-edge AMD.

Their graphics drivers and firmware will be different between these two cards.  
Corresponding Gentoo Wiki pages address this.


> BTW System Rescue + Mint (live USB) load modules for AMDGPU,
> which seems to be the latest graphics offering ;
> I need to find some firmware to get it to work
> (enabling AMDGPU in the kernel causes the boot process to stall
> with a message re missing firmware).

See above links.


> There are in fact  2  graphics tools in ANB6,
> one in the CPU (AMD), the other on the Mobo (Gigabyte).
> How can I tell which one the machine is trying to use ?

By tools do you mean graphics cards?


> I will continue to poke around, but further advice is very welcome.
> Please read my comments above carefully (smile).

Please provide the output of lshw, lspci, lsmod, dmesg if the above hints and 
Wiki pages don't help to get your your graphics going.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-06-15 12:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  0:21 [gentoo-user] can't start X as user Philip Webb
2023-06-14  0:36 ` Jack
2023-06-14  8:53 ` Michael
2023-06-15  2:21   ` Philip Webb
2023-06-15 12:32     ` Michael [this message]
2023-06-16 12:59     ` Björn Fischer
2023-06-14 15:23 ` [gentoo-user] " James Cloos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4149270.1IzOArtZ34@lenovo \
    --to=confabulate@kintzios.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox