My ubuntu version is 18. I use commands to create a network namespace and open nautilus.
sudo ip netns add net1
sudo ip netns exec net1 ip link set dev lo up
sudo ip netns exec net1 nautilus
Some warnings appear when opening Nautilus
(nautilus:4909): dbind-WARNING **: 13:57:41.587: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-I08XuESdSb: Connection refused
(nautilus:4909): IBUS-WARNING **: 13:57:41.820: The owner of /home/test/.config/ibus/bus is not root!
(nautilus:4909): IBUS-WARNING **: 13:57:42.572: Unable to connect to ibus: Could not connect: Connection refused
I searched some articles and said to use the following command to ignore this situation.
NO_AT_BRIDGE=1
like this : https://askubuntu.com/questions/432604/couldnt-connect-to-accessibility-bus
But the above answer is not what I want. I think connecting to dbus is very important. This may cause some functions to fail. For example, if you cannot connect to dbus, you cannot restore any files from the trash. I know that using the network namespace will isolate the dbus.
So I want to know if there is a way to solve it. Maybe I can bind something or use veth pair ?