Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] xf86OpenConsole: Cannot open virtual console 1 (Permission denied)

2,967 views
Skip to first unread message

the...@sys-concept.com

unread,
Feb 7, 2021, 3:30:04 AM2/7/21
to
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)

Neil Bothwick

unread,
Feb 7, 2021, 6:10:04 AM2/7/21
to
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.


--
Neil Bothwick

Mac screen message: "Like, dude, something went wrong."

the...@sys-concept.com

unread,
Feb 7, 2021, 2:20:03 PM2/7/21
to
On 2/7/21 4:09 AM, Neil Bothwick wrote:
> On Sun, 7 Feb 2021 01:28:39 -0700, the...@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.

I removed startx from .bash_profile and put in: ~/.xinitrc "exec startxfce4" and I was under impression that xfce4 will start automatically when I log-in but instead I get a user command prompt and have to type:
startxfce4
But now ssh login works and x2go-session works as well.

So why isn't startxfce4 starts automatically, what am I missing?

Neil Bothwick

unread,
Feb 7, 2021, 2:30:04 PM2/7/21
to
On Sun, 7 Feb 2021 12:10:50 -0700, the...@sys-concept.com wrote:

> On 2/7/21 4:09 AM, Neil Bothwick wrote:
> > On Sun, 7 Feb 2021 01:28:39 -0700, the...@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.


--
Neil Bothwick

If you got the words it does not mean you got the knowledge.

the...@sys-concept.com

unread,
Feb 7, 2021, 2:40:04 PM2/7/21
to
Maybe I wasn't clear. No, I don't start any X over ssh.

When I'm directly in front of the PC and I have a log-in screen and type user ID + passwords
I was under impression that "startxfce4" would run automatically when from .xinitrc
~/.xinitrc
exec startxfce4

but it doesn't, when I log-in the XFCE4 is not starting automatically, I have to type manually: startxfce4

Neil Bothwick

unread,
Feb 7, 2021, 3:20:03 PM2/7/21
to
On Sun, 7 Feb 2021 12:38:25 -0700, the...@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.


--
Neil Bothwick

Hospitality: making your guests feel like they're at home, even if you
wish they were.

the...@sys-concept.com

unread,
Feb 7, 2021, 4:10:03 PM2/7/21
to
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.

Neil Bothwick

unread,
Feb 7, 2021, 4:10:04 PM2/7/21
to
On Sun, 7 Feb 2021 14:01:57 -0700, the...@sys-concept.com wrote:

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

It is effectively the same as the one I suggested right at the start of
this thread.


--
Neil Bothwick

Windows95 - crash compatible on Windows 3.x

cal

unread,
Feb 8, 2021, 11:50:03 PM2/8/21
to
I see you have already solved your problem. But it bears mentioning:
.xinitrc is executed by runing `startx`, not by the login shell.

the...@sys-concept.com

unread,
Feb 9, 2021, 12:00:03 AM2/9/21
to
On 2/8/21 9:44 PM, cal wrote:
[snip]
>>
>> When I'm directly in front of the PC and I have a log-in screen and type user ID + passwords
>> I was under impression that "startxfce4" would run automatically when from .xinitrc
>> ~/.xinitrc
>> exec startxfce4
>>
>> but it doesn't, when I log-in the XFCE4 is not starting automatically, I have to type manually: startxfce4
>>
> I see you have already solved your problem.  But it bears mentioning: .xinitrc is executed by runing `startx`, not by the login shell.

I see, so instead of going around and calling .xinitrc from .bash_profile

why not call startxfce4 directly from .bash_profile

Instead of:
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi

start as:
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startxfce4; fi

It should work.

the...@sys-concept.com

unread,
Feb 9, 2021, 8:10:04 PM2/9/21
to
With the above setup starting "startxfce4" from .bash_profile, I get an error when ssh:
"No xauth data; using fake authentication data for X11 forwarding."

This error does not show up when "startxfce4" is run from .xinitrc
I don't know what difference it makes how xfce4 is started.

cal

unread,
Feb 10, 2021, 12:00:04 AM2/10/21
to
startx does some additional work besides just running the .xinitrc
script. If you are not using a display manager, startx is the correct
way to start X, with .xinitrc containing the commands to launch your
window manager.

My .xinitrc:
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi

exec dbus-launch --exit-with-session i3

antlists

unread,
Feb 10, 2021, 8:40:04 AM2/10/21
to
On 09/02/2021 04:44, cal wrote:
>> but it doesn't, when I log-in the XFCE4 is not starting automatically,
>> I have to type manually: startxfce4
>>
> I see you have already solved your problem.  But it bears mentioning:
> .xinitrc is executed by runing `startx`, not by the login shell.

Indeed, I don't know what "rc" at the end stands for, but if a file ends
in rc it is almost always a *config* file, which is *read* by the target
of interest. It is in no way shape or form an executable of any sort.

Cheers,
Wol

Grant Edwards

unread,
Feb 10, 2021, 9:50:04 AM2/10/21
to
IIRC, rc originally stood for "run commands", and it contained a list
of commands for the application to run during initialization. They are
almostly always not executable, but rather configuration commands in
some application-specific syntax.

--
Grant
0 new messages