Wayland running GUI program as another user
I use github.com/slingamn/namespaced-openvpn to have a isolated namespace and VPN connection to work
On X, these two steps would allow me to run a GUI program in the protected namespace. So I could have .e.g an IDE configuration for my main user/personal projects, and another entirely different instance of the same IDE for work because they use different users
<span style="color:#323232;">sudo xhost '+si:localuser:user'
</span><span style="color:#323232;">sudo ip netns exec protected sudo -u user -i
</span><span style="color:#323232;">
</span>
On Wayland, although the protected shell is created fine, GUI programs don’t start. E.g fgor Dolphin
<span style="color:#323232;">error: XDG_RUNTIME_DIR is invalid or not set in the environment.
</span><span style="color:#323232;">Failed to create wl_display (No such file or directory)
</span><span style="color:#323232;">
</span>
I’ve tried to preserve the env without success:
<span style="color:#323232;">
</span><span style="color:#323232;">sudo -E ip netns exec protected sudo -u user -i
</span>
It seems that I access to the wayland socket is a must for this to work
This discussion has a nuke option - giving 777 access to the dir where the wayland socket is, and another less permissive approach adding the users to a group and giving access to a new location where the wayland socket is created
stackoverflow.com/…/linux-wayland-display-multipl…
Is this second approach secure? If not, which other steps could I take to achieve what I did in X?
Add comment