Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Auto login and startx(desktop) without a display manager.

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Auto login and startx(desktop) without a display manager

#16 Post by Head_on_a_Stick »

Deb-fan wrote:What's described here works great, has for a very long time across more than one Debian stable release(and Mint) many different graphical interfaces.
Yes but it's not universal, the posted method won't work at all if the user has dash as their login shell (unlikely, yes, but certainly possible). My method will work in such a situation.

And what about that crap you wrote in respect of disabling the display manager? It's complete nonsense and you clearly didn't test it before posting.

Try these two commands after installing LightDM:

Code: Select all

# systemctl disable lightdm.service
# systemctl enable lightdm.service
The second command doesn't work at all and the error message explains why. Please remove that "advice", the dpkg-reconfigure command works so just leave that. Or set the default .target instead, which will work for all display managers.

Do you not think it's a bit silly to post a guide which you don't understand?

And just for the record, this isn't a "fued", I'm trying to help you.

@oswaldkelso: please open a new thread for your problem, it sounds interesting and I'd like to dig into it.
deadbang

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#17 Post by Deb-fan »

Yeah may as well clip that, not that serious and the fix(dpkg) is right there anyway. Bashisms, brace expansion in this context doesn't matter, as bash is default user shell in a gazillion distro's out-of-box. Somebody using something else is going to be aware of such diffs. Universal ... don't care as for Debian, deb-based works fine. Side-by-side with what you snagged from wherever, no discernable differences. No boot delay, additional processes/overhead, works just fine and has for quite a long time. Though actually glad for your posts here as it's cool for what you'd posted and this nonsense to be linked. Just for people's convenience.

Some useful, random stuff included. Surely perhaps a nugget someone will find useful or interesting, shrugs. Bunch of ways to do this kind of thing as with pretty much everything gnu/nix. No worries Hoas, it's not that serious. The fate of humanity doesn't hang in the balance. If a nixer pushes a button and gets an error msg, the world doesn't cease spinning and without poking around as such folks are never going to learn anything about the platform. :)
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: Auto login and startx(desktop) without a display manager

#18 Post by CwF »

So I have a challenge! With this technique, how does one log off!

It works for higher tty's, they're never active until called upon, then when activated - can never be logged off!

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#19 Post by Deb-fan »

Sorry CwF hadn't been checking on any of these in a long time, think I switched to using the line in the override.conf file to being the one mentioned in the Archwiki when recently installing a Buster 10.7 OS(ala, as Head_on advised) and decided it was time to move on, so nuked the Stretch installs I had. Leaves me no installs with this exact method applied. Still got what's noted in this tute in .profile. Ah really ... either way no biggie, potatoe/totoe thing I believe. So atm not setup to investigate what you mention and feeling too lazy to poke at it. Think no matter what they'd have to be logged out though, in case of something like a reboot, systemd from what I recall generates VT's as/when-however many needed anyway ? Also too lazy atm to bother looking at the doc's on it.

Would be good if you'd elaborate a bit more on what you're doing, seeing etc. ? Software involved, more about the setup you're experiencing this with, like virtual machines or what ? It sounds kind of odd to me though and as such I probably won't be able to resist putting override.conf back to as described here and checking myself. Still would appreciate a bit more of the details about what you're doing/seeing on your end. AH DAMMIT, now I've got to check, how are you determining they aren't logging out in higher tty's, what does that mean too ? Higher than what ? Okay, will spend 20mins dorking with it regardless but am confused as to what you're saying here. Gee thanks, now I've got to google the friggin cmd to list all actively logged in users, all tty's !!!??? Or something of that nature, lol. :) Am I supposed to open/log into 20 VT's/tty's and do this ? Make that probably more like 30mins of dorking, DAMMIT !!!

Also just-4-record: For doing this overall would likely opt for Head_on's version(this was something snagged from a Gentoo wiki entry. Partly, don't remember where I snagged the rest of it from, lol.) Still .. some what I think are interesting tidbits scattered in posts in this thread. Used this approach for yrs on end, including on a few distro's I was test driving for however long, Linux Mint (Bunsenlabs), though never stick with anything other than Debian for any amount of time. YARGHHHAHHH ... anyway, will go ahead and do some poking.

PS, nah ... second thought, going to put this thing on the 2-dork list @ least until CwF sounds off with some more info.
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: Auto login and startx(desktop) without a display manager

#20 Post by CwF »

I used this method to add a simple guest desktop. So the computer boots up to a conventional setup, or rather has been up and running, maybe locked, maybe not yours, but if I told you - you would know to keystroke your way into tty2 or tty5 and use this guest destop! Full browser action, nothing else - no usb, no permissions, no local networking, one user one group - did I mention the browser works...

So, not active at all until it is. You can switch back to other tty's, but you don't know the password. What I can't do it log off and switch away, leaving that magic desktop logged off. It cycles back to life, forever live. Doesn't bother anything, I could kill it, but it would be nice if log off worked. I put in a delay so there was 30 seconds before it logs off. It works for thirty seconds. For 29.5 seconds I'm back in tty not 2 or 5 and then with the timer, it logs off and the SWITCHES hands free to that former tty -whoa boy...

I thought it was a good idea... oh well, it's there, a few hundred MB's and spare cycles wasted...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Auto login and startx(desktop) without a display manager

#21 Post by Head_on_a_Stick »

CwF wrote:how does one log off

Code: Select all

# systemctl stop getty@ttyX
Replace X with the TTY number from which you wish to log off.
deadbang

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#22 Post by Deb-fan »

^ Thanks Hoasinator ... At this point I still really don't understand what's even going on here anyway. :D

@CwF ... I thought you were doing something like that, some of your nix-wizardry. Running apps or whatever else in a bunch of the tty's. Nothing at all wrong with that either and it sounds interesting + cool. Am about 110% certain there's MANY ways to address it, make things work smoothly, outside of the one Head_on was nice enough to provide already. It's gnu/Linux when isn't there many ways to do just about anything and everything ? :P Other than all this babbling/droning I don't have much of value to offer about the issue. Am mentally worn out right now so going to fallback to watching a movie. No way I'd even try to replicate the kind of setup you describe, it sounds involved setting such a configuration up.

Would be curious, if it's easily possible for you to employ Head_on's method, the approach he posted for this and see if it acts the same way. Really what he posted seems more proper and clean anyway. Only getting the feeling it has nothing to do with autologin/startx without a display manager, more that the issue lay somewhere else, something to do with configuration or the way things are setup. For some more groundless (and probably incorrrect) speculation maybe even a systemd bug, what version is involved here ? The thing is apparently now responsible for setting up VT's to a great extent, thus should play a keyrole in tearing them down too. Such as when a user wants to logout of one of them. DAMMIT, again ... that's just rampant speculation. I really like systemd personally anyway.

Did I ever mention I tend to wayyyyy overthink chit ? :D Just too many things which could be, might be, blahblahblah. Only way to really know would be hands on and take much time for something that sounds like it's not all that big a deal or real problem for you anyway. Alright, movie time.
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: Auto login and startx(desktop) without a display manager

#23 Post by CwF »

Head_on_a_Stick wrote:# systemctl
Thanks for the input, but clarify if that logs off or kills (as in crashes) that desktop, since I would be in another tty and that desktop is not logged off.

'#' is not possible on this desktop by intention. So me coming along later and using my authority to kill the unused desktop is not the use case.

I'd like the instruction to be to key into this tty and it's self explanatory, do what you will, log out - and please key back to ttyx. Somewhat analogous to please put the seat down when you're done.

...and I just tried it, redirected the menu's command line this in one long command

Code: Select all

bash -c "sleep 15 && xfce4-session-logout --logout && systemctl stop getty@tty2"
Not sure the authority on that last part called from the standard user menu? But I flip over in my desktop, and 15 seconds later my screen flips tty's, text scrolling, backdrop, desktop, done, about that fast. And it makes me giggle! WTH So, flip back, ignore...
Oh wait, yes, helpful, it does work and appears graceful if done from my terminal. But no answer yet for 'from that user'

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#24 Post by Deb-fan »

Just-4-rec: The mighty Linkinator will run just fine on any tty and doesn't require X ... SO THERE !! :D (Edit: CHIT, make that links2 part will the nator would require X :( they are still both awesome and together unstoppable !!! Gawds okay movie time for real.)

Actual reason I'm posting, this stuff had me cycling through tty's for no meaningful reason, while doing so noticed something odd in Firefox, going to just copy/paste from the note I made on it for later dorking.
Funny some weird thing I just found in FF, it's called Caret browsing, you press F7 to turn it off/on and it looks like it's some kind of keyboard mouse, says puts movable cursor in webpgs and allows someone to select text with the keyboard.
LMFrigAO, been using FF since there's been a FF and never heard of this, Caret browsing ? Wth ? :)

PS, definitely wurve Firefox, Debian's the universal OS and FF has got to be the universal web-browser, am sure there are a gazillion things about FF I don't know, gotta wurve a browser that everytime you use the thing you can find something new and interesting. :D @CwF ... again only a thought but switch methods for doing this to what Head_on posted, it's changing two files and a reboot and/or try a display manager too. If you think your issue is related to what's in this tute an obvious 1st step is doing that type of thing. You switch to one of those, same thing happens, nope ... obviously it's something else. In which case you'd have to start a help thread on it, would really need to provide folks MUCH more info in it and honestly wouldn't bother as I'd bet ca$h you aren't going to get any better direction on this in a dedicated thread about it than Head_on already pointed out. Would pursue that and bug him in a PM or summin, if it's really important to you. :)
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Auto login and startx(desktop) without a display manager

#25 Post by Head_on_a_Stick »

CwF wrote:for 'from that user'
The only way I could think of to do that would be to add the systemctl command to a script then allow the user to run that script (and no other commands) with sudo.
deadbang

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#26 Post by Deb-fan »

Of course had to dork, so put the override.conf file as it is in the OP and rebooted, nothing unusual, logged my user onto tty4, ran startx to start X, browsed around the web for awhile, killed X with "openbox --exit" took me to the expected command prompt, logged my user out with "exit", switched back to ongoing session on tty1 and back again to check. Am at a loss, everything worked as expected, user was logged out normally. By higher tty's am now assuming you mean higher than the one this logs in on = tty1 and nopers am not seeing the same behavior CwF. Nothing seems amiss and appears to be working normally.

So am left scratching head here and again ... Still thinking it's something to do with how you've set things up ... configuration and have no information about what you've done or how you've set anything up to even speculate about the issue you're having. Still wondering what basis you have to conclude the info in this tute is even involved anyway or a contributing factor ? You're starting X and a web-browser running on tty's 2 and 5 ? Zero idea how you've set any of this up and can't see how that topic or the ongoing issues you're having would be something that belongs in this thread. Ah shrugs, no biggie. :)
Dang it pointless speculation follows anyway. To be honest of course I have no over-riding desire to help a nixer debug some exotic configuration they've hobbled together and that has nothing much to do with autologin/startx with no display manager ...

My understanding gnu/Linux was always intended to be a multi-user/multi-seat operating system. In absence of anything solid to have the slightest idea how you've set things up on the OS CwF, thought is create different users for this, with different uid's/gid's, home directories and all the normal configuration files they would have and use those on these tty's, so that when the user(s) are logged into them(whichever tty's), then X is started automatically and the web-browser you want is too. Then should be no problem to cleanly log them out of any tty's, shouldn't-wouldn't matter how the OS is started with or w/o a display mananger etc etc. Once it's up, none of that should have any effect on the kind of multi-user setup I've outlined above. When the OS is up, it's up. Users can login and out wherever/whenever on the system as expected and it all works predictably.
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: Auto login and startx(desktop) without a display manager

#27 Post by CwF »

Head_on_a_Stick wrote:with sudo
Ya, there is no sudo.
There is pkexec authority for some, I may have to create something for this. This user has nothing. But I do have a fully funtional root desktop for 'hold my beer' situations, but I don't drink.

Here ya go Deb-fan, it's the condensed version...

Code: Select all

#systemctl edit getty@tty2
------------
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin simpleton --noclear %I $TERM
------------
append /home/simpleton/.profile:
------------
[ "$(tty)" = "/dev/tty2" ] && exec startx
------------
Remember, the system is run normally and boots to tty1. This mod has no bearing until you actually flip over to tty2. tty2 is not logged in until then. That desktop is a stripped xfce. The normal ways to log out work fine, then the autologin simply starts over.

The answer is likely a rule 'to be determined' where i do authority,
that is /etc/polkit-1/localauthority/30-site.d/42-users.pkla
This has mostly eliminated the need for sudo. So as of yet, this bullseye has no sudo. I think preferred, but past systems make heavy use of command enabled sudo in scripts for libvirt and virsh. That has filled out some recently in pkexec, so when I finish up on that, I'll look at this question...

For vm's this works great. Authority is in the rights to start the vm, so....

For now, I'll ignore it.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#28 Post by Deb-fan »

At this point can only say good luck, follow your muse and persistence can payoff. :)

Ps, Oops and/or file it away on your 2-dork list, I've got stuff on mine from 1979 just haven't errrr gotten around to yet. :P
Most powerful FREE tech-support tool on the planet * HERE. *

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#29 Post by Deb-fan »

Dorkish newflash, this just in.

CwF as mentioned what you're trying to do has nothing to do with what's covered in this tute, totally unrelated and different. After much ado about secret browser sessions scattered on tty's, a hold my beer user with super cow powers etc etc. Turns out from the last stuff you posted, you're not even using what's in this thread anyway, what you posted is from the how-to Head_on shared about this topic.

Anyway reason for posting is the answer to the mystery of the immortal and undying X popped into my head. Consists of two things, one ... this type of setup doesn't use a display manager, you go to logout of X, user gets logged right back in and the second part is you've got a line in the users .profile file to autostart x again, which gets sourced over n over, so yeah, doesn't work out really smoothly.

Alrighty that's a wrap ... :)
Most powerful FREE tech-support tool on the planet * HERE. *

Post Reply