Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sudo root + su user in Wayland - No display
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3337
Location: de

PostPosted: Sun Feb 04, 2024 12:35 am    Post subject: sudo root + su user in Wayland - No display Reply with quote

Hi there,

I'm running a configuration with a LAN interface (eth) and a wifi interface (wifi). Via network namespaces I use 2 networks on my computer for different user:
  • user A → eth0
  • user B → wlan0


In X this worked without any problems. I used a keyboard shortcut to switch from user A to user B:
Code:
sudo /usr/sbin/ip netns exec nswifi su - userb -c urxvt


Now I got a new computer and switched to KDE with Wayland. If I do this on Wayland:
Code:
sudo /usr/sbin/ip netns exec nswifi su - userb -c urxvt
urxvt: can't open display :0, aborting.


To avoid this problem and additionally get Pipewire running, I tried ego (Gentoo-Forums).

That works, if I switch from userA→userB, but doesn't work for userA → sudo → userB.

How can I use graphical applications, e.g. Firefox/Chromium with userB?




----------- Explain Netnamespaces --------------
Code:
ip netns add nswifi
ip netns exec nswifi ip addr add 127.0.0.1/8 dev lo
ip netns exec nswifi ip link set lo up
iw phy phy0 set netns name nswifi
ip netns exec nswifi ip link set wifi0 up
ip netns exec nswifi systemctl start wpa_supplicant
ip netns exec nswifi dhcpcd -C resolv.conf wifi0
ip netns exec nswifi su - userb -c urxvt

With that code I remove wifi0 from the default netnamespace, put wifi0 into nswifi netnamespace. And with the last command userB doesn't see anymore eth0 but can now use the network established for wifi0. Both networks don't see each other.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum