intgr / ego

Alter Ego: run Linux desktop applications under a different local user
MIT License
128 stars 1 forks source link

Teams does not run directly, but works via bash #50

Open greemo opened 3 years ago

greemo commented 3 years ago

I installed ego, and I get the following output but the program is not run...

(base) user_1@laptop:~$ ego -v -v -v -v -v --user=user_2 teams [ego::logging] Log level TRACE [users::base] Running getpwnam_r for user "user_2" [users::base] Loading user with uid 1001 Setting up Alter Ego for user user_2 (1001) Runtime data dir '/run/user/1000' configured Wayland: WAYLAND_DISPLAY not set, skipping X11 configured to allow +si:localuser:user_2 Publishing PulseAudio cookie /home/user_1/.config/pulse/cookie to /run/user/1000/ego/pulse-cookie PulseAudio dir '/run/user/1000/pulse' configured Running command: machinectl shell '--uid=user_2' '-EDISPLAY=:0' '-EPULSE_SERVER=unix:/run/user/1000/pulse/native' '-EPULSE_COOKIE=/run/user/1000/ego/pulse-cookie' -- .host /bin/sh -c 'dbus-update-activation-environment --systemd DISPLAY PULSE_SERVER PULSE_COOKIE; systemctl --user start xdg-desktop-portal-gtk; exec teams' Connected to the local host. Press ^] three times within 1s to exit session. Connection to the local host terminated.

Any thoughts??

intgr commented 3 years ago

Hi! A some things to try:

greemo commented 3 years ago

Thanks Marti,

Running ego --user=user_2 bash and then running teams from there worked perfectly.

Now I can log into multiple teams accounts simultaneously on Linux, thanks!

intgr commented 3 years ago

Great! I'm still curious though, why your original command doesn't work. It's probably something that can be improved in ego.

PS: This is the first user feedback I've received. It's good to hear that somebody finds this useful. :)

greemo commented 3 years ago

FYI:

ego --sudo --user=user_2 teams works, but I get the following output on the console:

X Error of failed request: BadName (named color or font does not exist) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 16 (RRCreateMode) Serial number of failed request: 34 Current serial number in output stream: 34

Running journalctl before ego --user=user_2 teams:

Mar 08 11:51:46 laptop polkitd(authority=local)[946]: Registered Authentication Agent for unix-process:200399:73989715 (system bus name :1.791 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_AU.UTF-8) Mar 08 11:51:50 laptop polkitd(authority=local)[946]: Operator of unix-session:c2 successfully authenticated as unix-user:user_1 to gain TEMPORARY authorization for action org.freedesktop.machine1.host-shell for system-bus-name::1.792 [machinectl shell --uid=user_2 -EDISPLAY=:0 -EPULSE_SERVER=unix:/run/user/1000/pulse/native -EPULSE_COOKIE=/run/user/1000/ego/pulse-cookie -- .host /bin/sh -c dbus-update-activation-environment --systemd DISPLAY PULSE_SERVER PULSE_COOKIE; systemctl --user start xdg-desktop-portal-gtk; exec teams] (owned by unix-user:user_1) Mar 08 11:51:50 laptop systemd[1]: Started Shell for User user_2. Mar 08 11:51:50 laptop systemd[200414]: pam_unix(login:session): session opened for user user_2 by (uid=0) Mar 08 11:51:50 laptop systemd-logind[956]: New session 128 of user user_2. Mar 08 11:51:50 laptop systemd[1]: Started Session 128 of user user_2. Mar 08 11:51:50 laptop systemd[1]: container-shell@3.service: Succeeded. Mar 08 11:51:50 laptop systemd[1]: session-128.scope: Succeeded. Mar 08 11:51:50 laptop systemd-logind[956]: Session 128 logged out. Waiting for processes to exit. Mar 08 11:51:50 laptop systemd-logind[956]: Removed session 128. Mar 08 11:51:50 laptop polkitd(authority=local)[946]: Unregistered Authentication Agent for unix-process:200399:73989715 (system bus name :1.791, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_AU.UTF-8) (disconnected from bus)

Cheers

intgr commented 3 years ago

OK I tried it and I see the issue now. The teams command forks a background process and exits immediately. Since the command exits, the session quits and systemd tears down background processes with it.

This demonstrates the issue by keeping the session around for 5 more seconds. Teams has a chance to start up and then exits.

ego sh -c 'teams && sleep 5'

Hopefully there is a nice way to handle this situation that doesn't add much complexity, I'll have to do some research.

intgr commented 3 years ago

Jotting down notes about this issue...

lucasvienna commented 3 years ago

Stumbled upon ego while trying to run Teams on a different user session. Had the exact same issue, where running ego teams would instantly exit without any discernible effect. I'm using Elementary OS 5.1.7 Hera (Ubuntu 18.04).

The bash -> teams workflow does work for me as well.

EDIT: if I can provide logs or any sort of debug data to help feel free to ask, I'd be happy to!