I am using the newns script from here:
https://superuser.com/questions/983727/route-only-specific-traffic-through-vpn
... except on this system:
$ mate-about -v
MATE Desktop Environment 1.24.0
$ cat /etc/issue
Ubuntu 20.04.2 LTS \n \l
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
So, the thing is, I have changed to export XTERM=/usr/bin/mate-terminal in that script, and when I run newns MYNS start right after reboot, the "namespaced" terminal runs fine; then I run newns MYNS stop, and the "namespaced" terminal is shut down - all good, all as expected.
But then, when I want to repeat the procedure - the terminal does NOT start anymore, but there is no error either?! I have eventually reduced it to this line (once the network namespace MYNS is made):
$ sudo /usr/bin/ip netns exec MYNS su -c /usr/bin/mate-terminal myusername
(mate-terminal:12410): dbind-WARNING **: 17:33:10.398: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-pRWfI7rzyW: Connection refused
Every once in a while, it might run once, but 99% of the time, re-running this command results with nothing.
Here is the funny part - if I replace mate-terminal with xterm in the above command line:
sudo /usr/bin/ip netns exec MYNS su -c /usr/bin/xterm myusername
... it works every time! But I do not want to use xterm - I need a terminal with tabs ...
Just for fun, I tried running VLC here, too:
sudo /usr/bin/ip netns exec MYNS su -c /usr/bin/vlc myusername
... and at least it starts fine (though it complains "vlcpulse audio output error: PulseAudio server connection failure: Connection refused"; "dbus interface error: Failed to connect to the D-Bus session daemon: Failed to connect to socket /tmp/dbus-CRRGy7gvlN: Connection refused" etc ...)
So, finally I installed gnome-terminal and tried with it - and it will not start either, just like mate-terminal, except with different messages:
$ sudo /usr/bin/ip netns exec MYNS su -c /usr/bin/gnome-terminal myusername
# Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-pRWfI7rzyW: Connection refused
# Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Could not connect: Connection refused
This file /tmp/dbus-pRWfI7rzyW keeps on repeating for starts of both terminals, but:
$ sudo ls -la /tmp/dbus*
ls: cannot access '/tmp/dbus*': No such file or directory
... it is most definitely not present on the system.
So, my guess is, this might have something to do with DBUS - unfortunately, I do not really know or understand dbus.
My question is - is there a workaround I could do, so mate-terminal or gnome-terminal could start in this context every time?