public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] can't start X as user
@ 2023-06-14  0:21 Philip Webb
  2023-06-14  0:36 ` Jack
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Philip Webb @ 2023-06-14  0:21 UTC (permalink / raw
  To: Gentoo User

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

after adding 'elogind' to 'default' runlevel & starting it :

  xf86EnableIO : failed to enable I/O ports 0000-03ff
   (operation not permitted)

yes, my user is in the 'video' group & 'xorg-server' has  USE="elogind" .

In my current machine, there is a  /dev/fb0  with permission  660 .
but there is no such device in the new machine.

I've looked at several "solved" cases of the same error messages,
but they don't seem to help my problem.

Can anyone offer possible solutions ?

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] can't start X as user
  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-14 15:23 ` [gentoo-user] " James Cloos
  2 siblings, 0 replies; 7+ messages in thread
From: Jack @ 2023-06-14  0:36 UTC (permalink / raw
  To: gentoo-user

On 6/13/23 20:21, 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
>
> after adding 'elogind' to 'default' runlevel & starting it :
>
>    xf86EnableIO : failed to enable I/O ports 0000-03ff
>     (operation not permitted)
>
> yes, my user is in the 'video' group & 'xorg-server' has  USE="elogind" .
>
> In my current machine, there is a  /dev/fb0  with permission  660 .
> but there is no such device in the new machine.
>
> I've looked at several "solved" cases of the same error messages,
> but they don't seem to help my problem.
>
> Can anyone offer possible solutions ?

what does "ll /dev/tty*" show?  I see lots of them, including 0, 
although I can't say which are relevant.  It does seem odd if you don't 
have any.  Have you compared kernel config on the machine that works and 
the one that doesn't?

what does /var/log/Xorg.0.log show?  It's likely to be more voluminous 
than output to console.

what's in ~/.xinitrc?  I don't actually suspect anything there, but it 
might be relevant.

In my case, X is started on the same virtual console it is invoked from, 
but I don't remember where the change from always using 7 shows up in 
any config file.  However, that does suggest some permission error MIGHT 
be relevant (but no guarantees.)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] can't start X as user
  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-14 15:23 ` [gentoo-user] " James Cloos
  2 siblings, 1 reply; 7+ messages in thread
From: Michael @ 2023-06-14  8:53 UTC (permalink / raw
  To: Gentoo User

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

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

Not sure if this is necessary:

$ grep 'tty|input' /etc/group
tty:x:5:
input:x:97:


> after adding 'elogind' to 'default' runlevel & starting it :
> 
>   xf86EnableIO : failed to enable I/O ports 0000-03ff
>    (operation not permitted)

The elogind service ought to be in boot runlevel according to the wiki:

https://wiki.gentoo.org/wiki/Elogind#Configuration


> yes, my user is in the 'video' group & 'xorg-server' has  USE="elogind" .
> 
> In my current machine, there is a  /dev/fb0  with permission  660 .
> but there is no such device in the new machine.

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, emerge associated x11-base/xorg-drivers and the x11-base/xorg-
server packages before a reboot?

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

There should be a fb0 device listed:

$ ls -l /dev/fb*
crw-rw---- 1 root video 29, 0 Jun 14 08:52 /dev/fb0

You'll also need to have emerged a Desktop Environment, or at least a window 
manager:

https://wiki.gentoo.org/wiki/Window_manager

Check the above wiki pages and post back with any queries and accompanying 
logs if things do not work as expected.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-user] Re: can't start X as user
  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-14 15:23 ` James Cloos
  2 siblings, 0 replies; 7+ messages in thread
From: James Cloos @ 2023-06-14 15:23 UTC (permalink / raw
  To: gentoo-user

if nothing else works, this should:

  :; chmod 4711 /usr/bin/Xorg

that was changed to not be suid some time back, relying instead on
things like elogind.  but the old way should still work.

on gentoo the suid use flag for x11-base/xorg-server would do that
at merge time.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] can't start X as user
  2023-06-14  8:53 ` Michael
@ 2023-06-15  2:21   ` Philip Webb
  2023-06-15 12:32     ` Michael
  2023-06-16 12:59     ` Björn Fischer
  0 siblings, 2 replies; 7+ messages in thread
From: Philip Webb @ 2023-06-15  2:21 UTC (permalink / raw
  To: gentoo-user

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
> 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).

> 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'.

>> 'xorg-server' has 'USE="elogind"'.
>> 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'.
'xf86-video-ati/vesa' are installed,
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'll also need to have emerged a Desktop Environment
> or at least a window manager: https://wiki.gentoo.org/wiki/Window_manager

I've installed 'twm xterm' to test X for now.
I will install KDE for regular use later.

'.xinitrc' is

  #xscreensaver &
  numlockx
  exec dbus-launch --exit-with-session /usr/bin/twm

ie the same as in ANB5, but substituting Twm for Plasma.

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" ?

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).

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 ?
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.

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).
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 ?

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

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] can't start X as user
  2023-06-15  2:21   ` Philip Webb
@ 2023-06-15 12:32     ` Michael
  2023-06-16 12:59     ` Björn Fischer
  1 sibling, 0 replies; 7+ messages in thread
From: Michael @ 2023-06-15 12:32 UTC (permalink / raw
  To: gentoo-user

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] can't start X as user
  2023-06-15  2:21   ` Philip Webb
  2023-06-15 12:32     ` Michael
@ 2023-06-16 12:59     ` Björn Fischer
  1 sibling, 0 replies; 7+ messages in thread
From: Björn Fischer @ 2023-06-16 12:59 UTC (permalink / raw
  To: gentoo-user

Hi Philip,

> My user is in 'tty wheel usb input video' (among others).

that shoud suffice.

You need to use '-keeptty' for xinit and preselect a TTY. For myself I 
have put this into my bashrc and it works quite well:

xinit ()
{
     local VT;
     local DISPLAY;
     VT=vt$(tty | sed 's/.*tty//');
     DISPLAY=:$(pgrep -cf 'X.*keeptty.*vt');
     /usr/bin/xinit -- $DISPLAY -keeptty -wr $VT
}

Cheers
Björn


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-16 12:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-06-16 12:59     ` Björn Fischer
2023-06-14 15:23 ` [gentoo-user] " James Cloos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox