Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
Date: Sun, 07 Feb 2021 21:02:21
Message-Id: 42b90833-e5ef-736d-b52f-1f54e1aafdb3@sys-concept.com
In Reply to: Re: [gentoo-user] xf86OpenConsole: Cannot open virtual console 1 (Permission denied) by Neil Bothwick
1 On 2/7/21 1:14 PM, Neil Bothwick wrote:
2 > On Sun, 7 Feb 2021 12:38:25 -0700, thelma@×××××××××××.com wrote:
3 >
4 >>>>>> I disable "slim" login manager and try not to use any display
5 >>>>>> manger (for simplicity). I start X from:
6 >>>>>>
7 >>>>>> ~/.bash_profile
8 >>>>>> exec startx -- vt1
9 >>>>>>
10 >>>>>> but now when I try to ssh as user, I get:
11 >>>>>>
12 >>>>>> (==) Using system config directory "/usr/share/X11/xorg.conf.d"
13 >>>>>> (EE)
14 >>>>>> Fatal server error:
15 >>>>>> (EE) xf86OpenConsole: Cannot open virtual console 1 (Permission
16 >>>>>> denied)
17 >>>>>
18 >>>>> Of course you are, because you are still trying to start X. If you
19 >>>>> must start X from .bash_profile, you need something like
20 >>>>>
21 >>>>> [ -z "$SSH_TTY" ] && startx ...
22 >>>>>
23 >>>>> to only start it when not using SSH.
24 >>>>
25 >>>> What do you suggest?
26 >>>> I was planning to get away from "slim" as I think it is getting more
27 >>>> unstable; I just need a simple system to start X, log-in over ssh and
28 >>>> use x2go session.
29 >>>
30 >>> Why do you need to start X, doesn't x2go run its own X session? You
31 >>> are trying to start X in an SSH session, which is what gives your
32 >>> error. The line I suggested runs startx only if you are not logging
33 >>> in via SSH. No display manager is involved.
34 >>
35 >> Maybe I wasn't clear. No, I don't start any X over ssh.
36 >
37 > But you do, because you run it from .bash_profile whenever you login.
38 > That's why I suggested an alternative command that wouldn't do that.
39
40 OK, according to Gentoo-wiki:
41 https://wiki.gentoo.org/wiki/Start_X_on_login
42
43 ~/.bash_profile
44 if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi
45 The above command works.
46
47 with:
48 ~/.xinitrc
49 exec startxfce4
50
51 Both ssh and x2go sessions (both: connect to local desktop and XFCE) work correctly.

Replies

Subject Author
Re: [gentoo-user] xf86OpenConsole: Cannot open virtual console 1 (Permission denied) Neil Bothwick <neil@××××××××××.uk>