I have upgraded Ubuntu 16.04 to Ubuntu 18.04. I do not intend to make a further upgrade to Ubuntu 20.xx for the moment. All looks to have gone well except the switching of users from within the desktop environment. My desktop environment was and is Unity.
There are two users in this computer. The expected behaviour is that within the desktop environment I can switch to any other profile without logging out of the current one, like in a multi-user system. In fact, I always have to log out from one profile to log into the other.
What's below happens always regardless of which profile is first.
1 Straight after the upgrade
1.1 Issue
The situation straight after the upgrade was:
- I log in into both desktop profiles separately: PASS.
- Once I am in either profile and click on the menu to access the other, nothing happens: FAIL.
So I stay where I am. I need to log out completely in order to access the other profile.
1.2 Partial fix
I followed the suggestion to reinstall the desktop environment with
sudo apt remove lightdm
sudo apt install lightdm
sudo reboot
This fixed the issue only partially.
- I can log in into either profile separately: PASS, OLD.
- If I click on the menu inside a profile to access any other profile, something happens: I am presented with the login screen with the password input: PASS, NEW.
- The resolution of the login screen where to input the password is rather coarse: FAIL, NEW.
- After I type in the password of the other profile, it hangs for several seconds before it loops back into the log-in screen.
- Therefore, I cannot access the other user profile: FAIL, NEW.
- However, I can log in back into the previous profile.
Other actions like
sudo apt install ubuntu-unity-desktop
or
sudo dpkg-reconfigure lightdm
have no effect or are redundant. Indeed, the same problem occurs regardless of whether the desktop environment is Unity or Ubuntu.
2 Current situation
2.1 Tests from the terminal
I can log in into both profiles from the terminal. After I am in the desktop environment of profile A, I move to a tty terminal and log in into profile B.
At the first login, before the prompt the system message is
Could not find key with description: [SIGNATURE] Could not find process_request_key_err in user session keyring for sig specified Error parsing option; rc = [-2]
Both tests
keyctl show
andls
pass: so I CAN see the session keyring (the not-found message above is nonsense) and the directory content (the message above is immaterial).I exit and log in again. Before the prompt there is another message
Signature not found in user keyring Perhaps try the interactive 'ecryptfs-mount-private'
The test
keyctl show
fails (the not-found message above is consistent) andls
passes (the message above remains immaterial). Even if I tryecryptfs-mount-private
, I load the key, the user switch problem persists, and these message occur again at the next reboot.Sometimes these messages do not show up at all (so, plain sailing within the terminal), but the problem of switching accounts in the desktop environment persists.
In the terminal I can see and browse the contents of the home directories. In all cases there is no blockage due to encryption.
2.2 From the desktop environment
- If I log out of the desktop environment of profile A and start afresh, the log-in screen with the password input is rendered neatly (no coarse resolution). I can log into profile B.
- When I try to switch from profile A to B and have left behind the desktop environment of profile A without logging out, I can always come back to profile A by typing the user password. That is: it goes in the way I would expect to work for activating profile B as well.
- If I create a new user C with administrator rights (a suggestion of @matigo), the following happens:
- I cannot switch from A and B to C precisely in the same way as I could not between A and B;
- I cannot log in the newly created C from the login screen either: the greeter screen returns to itself. The latter happens whether or not I have set a password for user C, so it's no human error.
2.3 Other posts
I have looked into these other posts, which refer to older releases of Ubuntu
- Unable to switch users in 13.10
- Ubuntu cannot switch user
- Switch user after upgrade to 14.04 not working
- Could not find valid key in user session keyring for sig specified in mount option after upgrade from 16.04 to 18.04
3. Analysis of errors in journalctl
This follows up a suggestion of lemrm. This is my situation:
wmctrl -m
Name: Compiz
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF
echo $DESKTOP_SESSION
unity
echo $GDMSESSION
unity
echo $XDG_CURRENT_DESKTOP
Unity:Unity7:ubuntu
3.1 Without libpam-kwallet*
The command journalctl -p err -b
returns among others the following interesting lines on lightdm
:
dec 10 21:33:59 computer lightdm[3992]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwalle
dec 10 21:33:59 computer lightdm[3992]: PAM adding faulty module: pam_kwallet.so
dec 10 21:33:59 computer lightdm[3992]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwall
dec 10 21:33:59 computer lightdm[3992]: PAM adding faulty module: pam_kwallet5.so
dec 10 21:33:59 computer lightdm[3992]: pam_unix(lightdm:auth): conversation failed
dec 10 21:33:59 computer lightdm[3992]: pam_unix(lightdm:auth): auth could not identify password for ...
I found these resources
- 2017: Slow boot on Ubuntu 16.04 ... issue with pam_kwallet5.so.
- 2018: Is libpam-kwallet required/necessary in ubuntu 18.04?
- https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1309535
The libraries pam_kwallet.so
and pam_kwallet5.so
belong to the packages
which are missing in my system. I do install them.
The interesting difference is that, when I move out to another profile via the menu, I do not splash again into the greeter with a choice of profiles, but in the "re-entry" page of the current profile (as though I had pressed Ctrl + L). I still need to log out to find a way into another profile. I can only come back to the profile I was in.
3.2 With libpam-kwallet*
The lines of journalctl -p err -b
regarding lightdm
become:
dec 10 22:16:23 computer lightdm[1766]: pam_kwallet(lightdm:session): pam_kwallet: Impossible to write walletKey to walletPipe
dec 10 22:16:23 computer lightdm[1767]: pam_kwallet5(lightdm:session): pam_kwallet5: Impossible to write walletKey to walletPipe
I have not found much on this Impossible to write walletKey to walletPipe that I could make use of:
- the source code: https://github.com/KDE/kwallet-pam/blob/master/pam_kwallet.c
- a complaint: https://forums.gentoo.org/viewtopic-p-8220820.html
- a bug report: https://bugs.launchpad.net/lightdm/+bug/1781418
3.3 pam_ecryptfs
After I try to change user from the menu, as per 3.1, the journal has appends one more line to the messages in 3.2
dec 10 23:28:11 computer compiz[2490]: pam_ecryptfs: seteuid error
after which I check that:
dpkg -S pam_ecryptfs
ecryptfs-utils: /usr/share/man/man8/pam_ecryptfs.8.gz
ecryptfs-utils: /lib/security/pam_ecryptfs.so
This shifts the focus from lightdm
and kwallet
to compiz
and ecryptfs
. These resources apply:
- https://bugs.launchpad.net/ecryptfs/+bug/1085706 (confirmed and unassigned bug, first reported in 2012 and last reported in 2021)
4. Question
Therefore, the problem seems to be purely one of managing the switch from any first current profile into any other profile inside the desktop environment.
Basically, I always have to log out from one profile to log into the other. So no multi-user behaviour.
Any suggestions to fix this?
This behavior could be related to
gnome-session
<->desktop environment
<->windowmanager
Test the new account (C) with open new tty by
ctrl
+alt
+F3
, login with the given credentials andstartx
Check your error logs with
journalctl -p err -b
and maybe post at pastebin.3. Check if something is missing by i.e.dpkg -l | grep '^ii' | grep gnome-s
.Check your current environment by (see here)
wmctrl -m
echo $DESKTOP_SESSION
echo $XDG_CURRENT_DESKTOP
For me it is i.e.
GNOME-Shell
ubuntu-xorg
ubuntu-GNOME
, installed after dist-upgrade by install or reinstallsudo apt install gnome-session gnome-shell ubuntu-desktop-minimal
Solve the
ecryptfs
issues, see this answerOption to remove
compiz
, see here (should work in the same way in18.04
)After this steps it's maybe helpful to do a
sudo apt full-upgrade