![startx only runs as root startx only runs as root](https://www.maketecheasier.com/assets/uploads/2014/07/4MLinux-root-password.jpg)
Press Esc, then shift + z + z to save and quit (this keys is for vim, you can run ps a in other terminal tab while edit to know its command is editor in which editor is symlink to vim.gtk3 in my system, your system may vary). sbin/agetty above might different in your system, ensure your check the correct path with: $ type -a agetty │ we override tty1 file: $ sudo systemctl edit this content (which m is your username): ĮxecStart=-/sbin/agetty -autologin m %I $TERM.So, change it to multi-user.target: $ sudo systemctl set-default multi-user.targetĪnd multi-user.target will start at tty1 (Ctrl+Alt+F1): $ systemctl list-dependencies multi-user.target | grep getty You told me in other comment that your system shows this: $ systemctl get-default Next, you run sudo systemctl daemon-reload to reload the configuration and reboot.Īssuming your startx is in /usr/bin/startx, that "should" work. Also, users might not be a group the user is a member of, last but not least, /path/to/your/startx is not the path to your startx. you probably do not want to start X as jdoe but as another user. You will have to adapt the unit, somewhat. Put the following in the file: /etc/systemd/system/rvice (assuming that is where systemd lives on your system) I searched google for "systemd unit file" and found the following: There are many resources online for this. If you do have systemd, you need to create a unit file for this.
![startx only runs as root startx only runs as root](http://penguinpetes.com/images/wolvix_ss1.jpg)
I doubt you have systemd, because systemd, by default, ignores rc.local unless you upgraded from a prior version that did not have systemd and even then, not sure. You should thus use su -l jdoe -c startx in rc.local, assuming jdoe is the user you want to start Xorg. I was just being optimistic in finding a shell-independent method for automatically starting X./etc/rc.local is executed as user root. For now, I don't have a problem typing "startx" after the few times a year that I reboot. Hopefully we'll all be using Wayland by then anyway. I guess I need to learn more about systemd, logind, and what exactly a "session" is before I try to devise a better solution. Also note that there is no official approach yet. I doubt that your service will work, it does not solve the session permissions. I've already run systemctl -user enable startx. ~/.config/systemd/user/startx -user start startx works, the only problem is getting it to work automatically at login. I'd like to add it to the wiki once I figure it out. Murukesh ( talk) 17:00, 8 January 2014 (UTC)Ĭan this be done with systemctl -user? I think this method could be advantageous over the methods listed already, as it is shell-independent. Is this the right behaviour, or am I doing something wrong? Should we change the note to Thus, whenever I log in via SSH, startx is executed. The note suggests using -lt, but in an SSH login, XDG_VTNR is unset, and the less-than comparison succeeds. If you are going to make significant changes to pages that have an impact on people's ability to, among other things, login to an active session, please discuss them beforehand. 4 x server, auto-login and not running as root.