Start X Server on Login with Systemd
I know that this is not the normal way people use X. Most setup instructions tell you to put something like startx
in your shell's profile. However I want to have systemd manage things.
Ideally I would have something like systemctl --user enable x.service
which is run when my user is logged in, and sources my .xinitrc
thus starting my WM.
All my attempts to do this have given me the error:
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
There must be a way to do this. Any help would be greatly appreciated.
systemd startx xinit x
|
show 1 more comment
I know that this is not the normal way people use X. Most setup instructions tell you to put something like startx
in your shell's profile. However I want to have systemd manage things.
Ideally I would have something like systemctl --user enable x.service
which is run when my user is logged in, and sources my .xinitrc
thus starting my WM.
All my attempts to do this have given me the error:
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
There must be a way to do this. Any help would be greatly appreciated.
systemd startx xinit x
1
I've no idea what setup instructions you read, but puttingstartx
in the shell profile is utterly ridiculous (just think what happens when you log in remotely into several shells). The normal way to do this is to start a display manager (e.g. lightdm, or any you want), which in turn starts the X server. Starting the X server without a display manager will be a bit tricky; you'll have to setup all the stuff the display manager does for you (authorization cookies, etc.) yourself.
– dirkt
Apr 15 '18 at 19:37
@dirkt while I agree (hence the question), it does seem to be a pretty common practice. See wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login.
– Nathan Lilienthal
May 11 '18 at 21:22
People do a lot of stupid things (and like to blog about it), but that's not a reason to copy it.
– dirkt
May 12 '18 at 6:03
wiki.archlinux.org/index.php/Systemd/User#Xorg_and_systemd
– jasonwryan
May 31 '18 at 21:45
@jasonwryan that link is promising, the second option seems ideal, but wrought with issues. I'll give it a shot when I have some free time and report back. P.S. I don't know how I missed that when searching this issue on my own.
– Nathan Lilienthal
Jun 1 '18 at 17:57
|
show 1 more comment
I know that this is not the normal way people use X. Most setup instructions tell you to put something like startx
in your shell's profile. However I want to have systemd manage things.
Ideally I would have something like systemctl --user enable x.service
which is run when my user is logged in, and sources my .xinitrc
thus starting my WM.
All my attempts to do this have given me the error:
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
There must be a way to do this. Any help would be greatly appreciated.
systemd startx xinit x
I know that this is not the normal way people use X. Most setup instructions tell you to put something like startx
in your shell's profile. However I want to have systemd manage things.
Ideally I would have something like systemctl --user enable x.service
which is run when my user is logged in, and sources my .xinitrc
thus starting my WM.
All my attempts to do this have given me the error:
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
There must be a way to do this. Any help would be greatly appreciated.
systemd startx xinit x
systemd startx xinit x
asked Apr 14 '18 at 20:44
Nathan LilienthalNathan Lilienthal
1011
1011
1
I've no idea what setup instructions you read, but puttingstartx
in the shell profile is utterly ridiculous (just think what happens when you log in remotely into several shells). The normal way to do this is to start a display manager (e.g. lightdm, or any you want), which in turn starts the X server. Starting the X server without a display manager will be a bit tricky; you'll have to setup all the stuff the display manager does for you (authorization cookies, etc.) yourself.
– dirkt
Apr 15 '18 at 19:37
@dirkt while I agree (hence the question), it does seem to be a pretty common practice. See wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login.
– Nathan Lilienthal
May 11 '18 at 21:22
People do a lot of stupid things (and like to blog about it), but that's not a reason to copy it.
– dirkt
May 12 '18 at 6:03
wiki.archlinux.org/index.php/Systemd/User#Xorg_and_systemd
– jasonwryan
May 31 '18 at 21:45
@jasonwryan that link is promising, the second option seems ideal, but wrought with issues. I'll give it a shot when I have some free time and report back. P.S. I don't know how I missed that when searching this issue on my own.
– Nathan Lilienthal
Jun 1 '18 at 17:57
|
show 1 more comment
1
I've no idea what setup instructions you read, but puttingstartx
in the shell profile is utterly ridiculous (just think what happens when you log in remotely into several shells). The normal way to do this is to start a display manager (e.g. lightdm, or any you want), which in turn starts the X server. Starting the X server without a display manager will be a bit tricky; you'll have to setup all the stuff the display manager does for you (authorization cookies, etc.) yourself.
– dirkt
Apr 15 '18 at 19:37
@dirkt while I agree (hence the question), it does seem to be a pretty common practice. See wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login.
– Nathan Lilienthal
May 11 '18 at 21:22
People do a lot of stupid things (and like to blog about it), but that's not a reason to copy it.
– dirkt
May 12 '18 at 6:03
wiki.archlinux.org/index.php/Systemd/User#Xorg_and_systemd
– jasonwryan
May 31 '18 at 21:45
@jasonwryan that link is promising, the second option seems ideal, but wrought with issues. I'll give it a shot when I have some free time and report back. P.S. I don't know how I missed that when searching this issue on my own.
– Nathan Lilienthal
Jun 1 '18 at 17:57
1
1
I've no idea what setup instructions you read, but putting
startx
in the shell profile is utterly ridiculous (just think what happens when you log in remotely into several shells). The normal way to do this is to start a display manager (e.g. lightdm, or any you want), which in turn starts the X server. Starting the X server without a display manager will be a bit tricky; you'll have to setup all the stuff the display manager does for you (authorization cookies, etc.) yourself.– dirkt
Apr 15 '18 at 19:37
I've no idea what setup instructions you read, but putting
startx
in the shell profile is utterly ridiculous (just think what happens when you log in remotely into several shells). The normal way to do this is to start a display manager (e.g. lightdm, or any you want), which in turn starts the X server. Starting the X server without a display manager will be a bit tricky; you'll have to setup all the stuff the display manager does for you (authorization cookies, etc.) yourself.– dirkt
Apr 15 '18 at 19:37
@dirkt while I agree (hence the question), it does seem to be a pretty common practice. See wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login.
– Nathan Lilienthal
May 11 '18 at 21:22
@dirkt while I agree (hence the question), it does seem to be a pretty common practice. See wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login.
– Nathan Lilienthal
May 11 '18 at 21:22
People do a lot of stupid things (and like to blog about it), but that's not a reason to copy it.
– dirkt
May 12 '18 at 6:03
People do a lot of stupid things (and like to blog about it), but that's not a reason to copy it.
– dirkt
May 12 '18 at 6:03
wiki.archlinux.org/index.php/Systemd/User#Xorg_and_systemd
– jasonwryan
May 31 '18 at 21:45
wiki.archlinux.org/index.php/Systemd/User#Xorg_and_systemd
– jasonwryan
May 31 '18 at 21:45
@jasonwryan that link is promising, the second option seems ideal, but wrought with issues. I'll give it a shot when I have some free time and report back. P.S. I don't know how I missed that when searching this issue on my own.
– Nathan Lilienthal
Jun 1 '18 at 17:57
@jasonwryan that link is promising, the second option seems ideal, but wrought with issues. I'll give it a shot when I have some free time and report back. P.S. I don't know how I missed that when searching this issue on my own.
– Nathan Lilienthal
Jun 1 '18 at 17:57
|
show 1 more comment
2 Answers
2
active
oldest
votes
As a systemd user who starts X at boot (without a login manager), here's what I followed: https://wiki.archlinux.org/index.php/Systemd/User#Automatic_login_into_Xorg_without_display_manager
New contributor
add a comment |
https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login
A little searching goes a long way.
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
Put this in your shell startup and in the console it will auto start.
I guess if there is some problem with startx you fall back to the tty, it should work.
6
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437809%2fstart-x-server-on-login-with-systemd%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As a systemd user who starts X at boot (without a login manager), here's what I followed: https://wiki.archlinux.org/index.php/Systemd/User#Automatic_login_into_Xorg_without_display_manager
New contributor
add a comment |
As a systemd user who starts X at boot (without a login manager), here's what I followed: https://wiki.archlinux.org/index.php/Systemd/User#Automatic_login_into_Xorg_without_display_manager
New contributor
add a comment |
As a systemd user who starts X at boot (without a login manager), here's what I followed: https://wiki.archlinux.org/index.php/Systemd/User#Automatic_login_into_Xorg_without_display_manager
New contributor
As a systemd user who starts X at boot (without a login manager), here's what I followed: https://wiki.archlinux.org/index.php/Systemd/User#Automatic_login_into_Xorg_without_display_manager
New contributor
New contributor
answered Jan 10 at 0:16
LyleLyle
1011
1011
New contributor
New contributor
add a comment |
add a comment |
https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login
A little searching goes a long way.
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
Put this in your shell startup and in the console it will auto start.
I guess if there is some problem with startx you fall back to the tty, it should work.
6
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
add a comment |
https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login
A little searching goes a long way.
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
Put this in your shell startup and in the console it will auto start.
I guess if there is some problem with startx you fall back to the tty, it should work.
6
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
add a comment |
https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login
A little searching goes a long way.
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
Put this in your shell startup and in the console it will auto start.
I guess if there is some problem with startx you fall back to the tty, it should work.
https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login
A little searching goes a long way.
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
Put this in your shell startup and in the console it will auto start.
I guess if there is some problem with startx you fall back to the tty, it should work.
answered May 31 '18 at 21:42
Louki SumirniyLouki Sumirniy
1
1
6
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
add a comment |
6
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
6
6
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
The OP specifically wants this handled by systemd...
– jasonwryan
May 31 '18 at 21:44
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437809%2fstart-x-server-on-login-with-systemd%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I've no idea what setup instructions you read, but putting
startx
in the shell profile is utterly ridiculous (just think what happens when you log in remotely into several shells). The normal way to do this is to start a display manager (e.g. lightdm, or any you want), which in turn starts the X server. Starting the X server without a display manager will be a bit tricky; you'll have to setup all the stuff the display manager does for you (authorization cookies, etc.) yourself.– dirkt
Apr 15 '18 at 19:37
@dirkt while I agree (hence the question), it does seem to be a pretty common practice. See wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login.
– Nathan Lilienthal
May 11 '18 at 21:22
People do a lot of stupid things (and like to blog about it), but that's not a reason to copy it.
– dirkt
May 12 '18 at 6:03
wiki.archlinux.org/index.php/Systemd/User#Xorg_and_systemd
– jasonwryan
May 31 '18 at 21:45
@jasonwryan that link is promising, the second option seems ideal, but wrought with issues. I'll give it a shot when I have some free time and report back. P.S. I don't know how I missed that when searching this issue on my own.
– Nathan Lilienthal
Jun 1 '18 at 17:57