public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] startx Cannot open virtual console 7
@ 2020-10-27 11:18 edes
  2020-10-27 12:15 ` Arve Barsnes
  0 siblings, 1 reply; 10+ messages in thread
From: edes @ 2020-10-27 11:18 UTC (permalink / raw
  To: gentoo-user


Hi,

I'm using xfce without a graphical login. The system boots into a
terminal and after logging in in tty1, I start the GUI with startx.

This used to start X in vt7, but after the migration to elogind, X
starts in the same tty where I type the command, which I don't want.

I can't replicate the old behaviour. I tried "startx -- vt7", but I get
this error message:

Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied)

I don't know if this is relevant, but under /dev I see:

crw--w---- 1 root tty 4, 0 oct 27 07:54 /dev/tty0
crw------- 1 edes tty 4, 1 oct 27 07:57 /dev/tty1
crw--w---- 1 root tty 4, 2 oct 27 07:54 /dev/tty2
crw--w---- 1 root tty 4, 3 oct 27 07:54 /dev/tty3
crw--w---- 1 root tty 4, 4 oct 27 07:54 /dev/tty4
crw--w---- 1 root tty 4, 5 oct 27 07:54 /dev/tty5
crw--w---- 1 root tty 4, 6 oct 27 07:54 /dev/tty6
crw--w---- 1 root tty 4, 7 oct 27 07:54 /dev/tty7
crw--w---- 1 root tty 4, 8 oct 27 07:54 /dev/tty8
crw--w---- 1 root tty 4, 9 oct 27 07:54 /dev/tty9

I would appreciate any help, since I'm completely ignorant of all things
related to authentication, pam, and the rest, which I suspect might
have something to do with this (or perhaps not?).



--
edes <edes@gmx.net>


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 11:18 [gentoo-user] startx Cannot open virtual console 7 edes
@ 2020-10-27 12:15 ` Arve Barsnes
  2020-10-27 12:35   ` edes
  0 siblings, 1 reply; 10+ messages in thread
From: Arve Barsnes @ 2020-10-27 12:15 UTC (permalink / raw
  To: Gentoo

On Tue, 27 Oct 2020 at 12:18, edes <edes@gmx.net> wrote:
> Fatal server error:
> (EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied)
>
> I don't know if this is relevant, but under /dev I see:
>
> crw--w---- 1 root tty 4, 0 oct 27 07:54 /dev/tty0
> crw------- 1 edes tty 4, 1 oct 27 07:57 /dev/tty1
> crw--w---- 1 root tty 4, 2 oct 27 07:54 /dev/tty2
> crw--w---- 1 root tty 4, 3 oct 27 07:54 /dev/tty3
> crw--w---- 1 root tty 4, 4 oct 27 07:54 /dev/tty4
> crw--w---- 1 root tty 4, 5 oct 27 07:54 /dev/tty5
> crw--w---- 1 root tty 4, 6 oct 27 07:54 /dev/tty6
> crw--w---- 1 root tty 4, 7 oct 27 07:54 /dev/tty7
> crw--w---- 1 root tty 4, 8 oct 27 07:54 /dev/tty8
> crw--w---- 1 root tty 4, 9 oct 27 07:54 /dev/tty9
>
> I would appreciate any help, since I'm completely ignorant of all things
> related to authentication, pam, and the rest, which I suspect might
> have something to do with this (or perhaps not?).

If you've migrated to elogind, you have probably moved away from a
setuid xorg-server. I'd start loooking here:
https://wiki.gentoo.org/wiki/Non_root_Xorg

Regards,
Arve


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 12:15 ` Arve Barsnes
@ 2020-10-27 12:35   ` edes
  2020-10-27 12:53     ` Michael
  2020-10-27 12:53     ` edes
  0 siblings, 2 replies; 10+ messages in thread
From: edes @ 2020-10-27 12:35 UTC (permalink / raw
  To: gentoo-user

el Tue, 27 Oct 2020 13:15:32 +0100
Arve Barsnes <arve.barsnes@gmail.com> escribió:

> If you've migrated to elogind, you have probably moved away from a
> setuid xorg-server. I'd start loooking here:
> https://wiki.gentoo.org/wiki/Non_root_Xorg

Hi, thanks for the response. I had read that document (and others), but
I thought it addressed the problem of not being able to start Xorg as
regular user, which is not my case.

Just to be sure: I should enable the -suid USE flag in
x11-base/xorg-server?



-- 
edes <edes@gmx.net>


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 12:35   ` edes
@ 2020-10-27 12:53     ` Michael
  2020-10-27 13:28       ` edes
  2020-10-27 12:53     ` edes
  1 sibling, 1 reply; 10+ messages in thread
From: Michael @ 2020-10-27 12:53 UTC (permalink / raw
  To: gentoo-user

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

On Tuesday, 27 October 2020 12:35:25 GMT edes wrote:
> el Tue, 27 Oct 2020 13:15:32 +0100
> 
> Arve Barsnes <arve.barsnes@gmail.com> escribió:
> > If you've migrated to elogind, you have probably moved away from a
> > setuid xorg-server. I'd start loooking here:
> > https://wiki.gentoo.org/wiki/Non_root_Xorg
> 
> Hi, thanks for the response. I had read that document (and others), but
> I thought it addressed the problem of not being able to start Xorg as
> regular user, which is not my case.
> 
> Just to be sure: I should enable the -suid USE flag in
> x11-base/xorg-server?

Running Xorg with suid is insecure and can lead to privilege escalation.  So 
this method of running Xorg is no longer recommended.

The systemd-logind and elogind by default only allow you to run X on the 
console you have logged in as a user - this is controlled by the corresponding 
pam module (e.g. pam-elogind.so).

As I understand it systemd-logind and its elogind derivative both use the 
variable $XDG_VTNR to set the VT number.  I suppose this variable could be set 
to a different VT than the console you login, via .xinitrc, or .xserverrc, or 
.bashrc - but I haven't tried it out.

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

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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 12:35   ` edes
  2020-10-27 12:53     ` Michael
@ 2020-10-27 12:53     ` edes
  2020-10-27 14:05       ` Jack
  1 sibling, 1 reply; 10+ messages in thread
From: edes @ 2020-10-27 12:53 UTC (permalink / raw
  To: gentoo-user

el Tue, 27 Oct 2020 09:35:25 -0300
edes <edes@gmx.net> escribió:

> Just to be sure: I should enable the -suid USE flag in
> x11-base/xorg-server?

Just for the record, I rebuilt x11-base/xorg-server with +suid, and the
problem persists:

$ startx -- vt7
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied)


-- 
edes <edes@gmx.net>


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 12:53     ` Michael
@ 2020-10-27 13:28       ` edes
  0 siblings, 0 replies; 10+ messages in thread
From: edes @ 2020-10-27 13:28 UTC (permalink / raw
  To: gentoo-user

el Tue, 27 Oct 2020 12:53:44 +0000
Michael <confabulate@kintzios.com> escribió:
 
> The systemd-logind and elogind by default only allow you to run X on
> the console you have logged in as a user.

So I guess my question is basically if this default can be modified, and
how.

> As I understand it systemd-logind and its elogind derivative both use
> the variable $XDG_VTNR to set the VT number.  I suppose this variable
> could be set to a different VT than the console you login,
> via .xinitrc, or .xserverrc, or .bashrc - but I haven't tried it out.

Setting XDG_VTNR to a different value didn't change anything. As far as
I can see, it's not different from running startx -- vtN, and I get the
same error.



-- 
edes <edes@gmx.net>


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 12:53     ` edes
@ 2020-10-27 14:05       ` Jack
  2020-10-27 20:09         ` Walter Dnes
  0 siblings, 1 reply; 10+ messages in thread
From: Jack @ 2020-10-27 14:05 UTC (permalink / raw
  To: gentoo-user

On 10/27/20 8:53 AM, edes wrote:
> el Tue, 27 Oct 2020 09:35:25 -0300
> edes <edes@gmx.net> escribió:
>
>> Just to be sure: I should enable the -suid USE flag in
>> x11-base/xorg-server?
> Just for the record, I rebuilt x11-base/xorg-server with +suid, and the
> problem persists:
>
> $ startx -- vt7
> Fatal server error:
> (EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied)
 From one of your earlier posts, it looks like tty0-tty9 all exist. My 
guess is that getty was launched on all of them.  Since that is owned by 
root (until someone logs in) you certainly don't have permission to use 
it for X.  I'm not sure where the list of vts on which to spawn getty is 
controlled, but that's what I'd look for.


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 14:05       ` Jack
@ 2020-10-27 20:09         ` Walter Dnes
  2020-10-30 17:35           ` antlists
  0 siblings, 1 reply; 10+ messages in thread
From: Walter Dnes @ 2020-10-27 20:09 UTC (permalink / raw
  To: gentoo-user

On Tue, Oct 27, 2020 at 10:05:28AM -0400, Jack wrote

>  From one of your earlier posts, it looks like tty0-tty9 all exist. My
> guess is that getty was launched on all of them.  Since that is owned
> by root (until someone logs in) you certainly don't have permission
> to use it for X.  I'm not sure where the list of vts on which to spawn
> getty is controlled, but that's what I'd look for.

  On my non-systemd machine, it's /etc/inittab, with the lines below the
comment line...

# TERMINALS

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-27 20:09         ` Walter Dnes
@ 2020-10-30 17:35           ` antlists
  2020-11-04 14:38             ` edes
  0 siblings, 1 reply; 10+ messages in thread
From: antlists @ 2020-10-30 17:35 UTC (permalink / raw
  To: gentoo-user

On 27/10/2020 20:09, Walter Dnes wrote:
> On Tue, Oct 27, 2020 at 10:05:28AM -0400, Jack wrote
> 
>>   From one of your earlier posts, it looks like tty0-tty9 all exist. My
>> guess is that getty was launched on all of them.  Since that is owned
>> by root (until someone logs in) you certainly don't have permission
>> to use it for X.  I'm not sure where the list of vts on which to spawn
>> getty is controlled, but that's what I'd look for.
> 
>    On my non-systemd machine, it's /etc/inittab, with the lines below the
> comment line...
> 
> # TERMINALS
> 
I've got memories that you should launch getty on 1 to 6, and I don't 
know whether you declare how many exist, but you tell X to grab the next 
available.

I'm pretty certain if I do a <ctrl><alt><F8> and I haven't launched a 
second user, it just comes up with a blank screen, not a login prompt.

Cheers,
Wol


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

* Re: [gentoo-user] startx Cannot open virtual console 7
  2020-10-30 17:35           ` antlists
@ 2020-11-04 14:38             ` edes
  0 siblings, 0 replies; 10+ messages in thread
From: edes @ 2020-11-04 14:38 UTC (permalink / raw
  To: gentoo-user

el Fri, 30 Oct 2020 17:35:30 +0000
antlists <antlists@youngman.org.uk> escribió:

> I've got memories that you should launch getty on 1 to 6, and I don't 
> know whether you declare how many exist, but you tell X to grab the
> next available.
> 
> I'm pretty certain if I do a <ctrl><alt><F8> and I haven't launched a 
> second user, it just comes up with a blank screen, not a login prompt.

This is exactly what happens here. The thing is that I can only run X on
the console I logged in, and I don't see a way to override that.

Only root can launch X on vt7 and up. I cannot believe there is no way to
overrule that, but so far I haven't been able to find information on
how to do it.

In my /etc/inittab I have this:

# TERMINALS
#x1:12345:respawn:/sbin/agetty 38400 console linux
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux



-- 
edes <edes@gmx.net>


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

end of thread, other threads:[~2020-11-04 14:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-27 11:18 [gentoo-user] startx Cannot open virtual console 7 edes
2020-10-27 12:15 ` Arve Barsnes
2020-10-27 12:35   ` edes
2020-10-27 12:53     ` Michael
2020-10-27 13:28       ` edes
2020-10-27 12:53     ` edes
2020-10-27 14:05       ` Jack
2020-10-27 20:09         ` Walter Dnes
2020-10-30 17:35           ` antlists
2020-11-04 14:38             ` edes

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