[systemd-devel] Howto unshare when user session starts.

Adrian Vovk adrianvovk at gmail.com
Wed Feb 21 19:30:07 UTC 2024


On 2/21/24 12:57, Stef Bon wrote:
> Hi,
>
> maybe this is a question simple to answer.
>
> I want the user sessions to start in a {mount,user} namespace. How can
> I do this? I know there is the command systemd-nspawn. But to use this
> I have to adjust the first command to start a session. Or is it
> possible by setting parameters in logind?

You may want to look at adjusting the command executed by 
/usr/share/{x,wayland-}sessions/*.desktop

Your display manager picks one of those files (depending on what you 
select @ login time) and runs whatever command is in there.

So for example, you should copy 
/usr/share/wayland-sessions/gnome.desktop to 
/usr/share/wayland-sessions/my-namespace.desktop. Then edit the Name 
setting in the .desktop entry (so it appears in the list on your login 
screen), and the Exec setting to change what command it executes

> Stef
> the Netherlands

Best,
Adrian



More information about the systemd-devel mailing list