On 2/7/21 1:14 PM, Neil Bothwick wrote:
> On Sun, 7 Feb 2021 12:38:25 -0700, thelma@sys-concept.com wrote:
>
>>>>>> I disable "slim" login manager and try not to use any display
>>>>>> manger (for simplicity). I start X from:
>>>>>>
>>>>>> ~/.bash_profile
>>>>>> exec startx -- vt1
>>>>>>
>>>>>> but now when I try to ssh as user, I get:
>>>>>>
>>>>>> (==) Using system config directory "/usr/share/X11/xorg.conf.d"
>>>>>> (EE)
>>>>>> Fatal server error:
>>>>>> (EE) xf86OpenConsole: Cannot open virtual console 1 (Permission
>>>>>> denied)
>>>>>
>>>>> Of course you are, because you are still trying to start X. If you
>>>>> must start X from .bash_profile, you need something like
>>>>>
>>>>> [ -z "$SSH_TTY" ] && startx ...
>>>>>
>>>>> to only start it when not using SSH.
>>>>
>>>> What do you suggest?
>>>> I was planning to get away from "slim" as I think it is getting more
>>>> unstable; I just need a simple system to start X, log-in over ssh and
>>>> use x2go session.
>>>
>>> Why do you need to start X, doesn't x2go run its own X session? You
>>> are trying to start X in an SSH session, which is what gives your
>>> error. The line I suggested runs startx only if you are not logging
>>> in via SSH. No display manager is involved.
>>
>> Maybe I wasn't clear. No, I don't start any X over ssh.
>
> But you do, because you run it from .bash_profile whenever you login.
> That's why I suggested an alternative command that wouldn't do that.
OK, according to Gentoo-wiki:
https://wiki.gentoo.org/wiki/Start_X_on_login ~/.bash_profile
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi
The above command works.
with:
~/.xinitrc
exec startxfce4
Both ssh and x2go sessions (both: connect to local desktop and XFCE) work correctly.