Second User Setup and Start GUI (runlevel 5) in 2nd terminal - How?

Here is where I am on this:

My primary user account works fine (kde). Now I created a 2nd user.
I switched to a terminal with Cntl-Alt-F1 and logged in as the 2nd user.
I tried startx (worked for decades in 'nix). This did not work.

I read threads of how this became a root-only operation. I did not see “type this instead” / what to do to start a gui-session as/for the 2nd user (not as root).

How do I switch to runlevel-5 in the new terminal as the 2nd user?
How do I set the WM/DM to use (icewm or kde) for the 2nd user?

Note: I do not want to loose my existing Session for the 1st user in another console via reboot. I need both users running at the same time.

Thank You,

also tried ‘startkde’ (which I know works because the primary user uses it - how I am typing this)

$**DISPLAY **not **set or **cannot connect to X server********

Tried setting display with:

export DISPLAY=localhost:1

No change. I suppose I need to start another x server?
So what used to be ‘startx’ to do that, and then pick up the WM from vars, is called / done what / how?

(sorry for new post - but ‘edit’ seems to go away after a time)

Similar situation with GNOME.
Login 1st user (say user 1000) in graphical target, grabs gdm on tty7 as expected.
SWITCH user via Gnome panel, say to user 1001, this one opens a gnome session on TTY2, and you CAN work normally, it seems.
On logout of user 1001, control never reverts to tty7, the system freezes, keyboard not responsive, only way out CTRL+ALT+DEL reboot.

It seems that the Desktop Environment doesn’t count, seems a login or displaymanager issue.

startx works if you start a console-only target, say rescue-target or multiuser-target: it seems that the problem is having two (or more?) graphical sessions at once.
Multiuser via console only (say, tty1 AND tty2 AND tty6… but only via command line) works; so the system is still multi-user, but apparently not with graphics.

Yes.
You cannot run startkde in text mode. startkde needs to be run inside an X session.

[QUOTE]So what used to be ‘startx’ to do that, and then pick up the WM from vars, is called / done what / how?
startx doesn’t work as user for years.
Run it as root and it should work. Or change the permissions in /etc/permissions.local (as the error message should tell you) and run “chkstat”. But that’s a security risk.

The best and easiest thing would be to configure kdm to start a second session automatically on boot.
I haven’t done this myself, but you’ll have to edit /usr/share/kde4/config/kdm/kdmrc for that. (even though this is in /usr/share, it is not overwritten on updates because it is a config file)
Probably you only have to set something like “StaticServers=:0,:1”.

But you can also just choose “Switch User” inside KDE to create a new session.
Or run “kdmctl reserve”, this also works from text mode (if kdm is running), and is probably exactly the solution you are looking for IIUYC.

Trying a workaround with Xephyr. Idea being, I can get it running, minimize it, then xterm into it from another console.

I can start it with:
Xephyr -ac -br -noreset -screen 800x600 :1

That gets you a blank screen. Then, in another terminal, I can put:
DISPLAY=:1

Now if I type, say, “gedit”, it will open in the Xephyr window. But if I try to “startkde”, I get
Could not start D-Bus. Can you call qdbus?

Tried sudo, su, ‘su -’ as well with this command, given qdbus seemingly cannot be called except as root. In those cases, “$DISPLAY is not set or cannot connect to the X server” in all cases.

Aha!! This worked:
dbus-launch startkde

Now to see if I can attach to that from another virtual console. And to see if I can change the display settings, without breaking the ones on the primary environment.

— If I had a million dollars, I would pay a team to take a 10-year old linux kernel/distro and update the drivers for current hardware.

Yes, I am old. Been awhile since I dug into this stuff.

Sounds interesting. Will try when I get the time.

That may be a winner. Thanks for the good info!!

kdmctl reserve
Cannot connect socket ‘/var/run/xdmctl/dmctl-:1/socket’.

“Switch User”
No ‘leave’ option in my menu. Just restart, shut-down, log-out.

But the command …
qdbus org.kde.krunner /App switchUser

does pop up the box. I’ll add that below my custom ‘sleep’ command (which is randomly absent from the menu).

(found that command in related discussion here: https://forums.opensuse.org/showthread.php/496340-Command-to-change-user-KDE )

That’s strange. It’s dmctl-:0 here, and should be with only 1 display.
You have more than one X server running now? Your Xephyr maybe?

“Switch User”
No ‘leave’ option in my menu. Just restart, shut-down, log-out.

Are you using KDE?
You should have Log out, Lock, Switch User, Sleep, Hibernate, Restart and Shutdown on the “Leave” tab in the K-menu.
If not, something is wrong on your system…

But the command …
qdbus org.kde.krunner /App switchUser

does pop up the box.

Yes, that’s what “Switch User” actually does.

Please, do you confirm that you are having two (or more) graphical sessions at once in 13.2 KDE one way or the other?
If so, I may have witnessed a different, gdm-specific issue and I should dig for more specific evidence before reporting again in another thread.

Yes, I do that all the time. And you can switch between them with Ctrl+Alt+F7, Ctrl+Alt+F8, and so on.

And after logging out on the second session, I get back to first session.

So the problem you describe seems to be gdm specific.
sddm has a similar problem though, when gnome-keyring-pam is installed. In that case, the session (any one, even if you only have one) just hangs on logout and never returns back to the login screen.
So maybe try to remove that as a test, it is only needed to automatically unlock GNOME’s keyring on login.

OK, thanks. I’ll try that.