Using a simple Bash script in Ubuntu 20.04, I am trying to let it create a new Gnome terminal tab, then run an interactive Python script inside a LXC container my_lxc
.
#!/bin/bash
cmd="python interactive_foo.py"
gnome-terminal --tab -- lxc exec my_lxc -- "$cmd"
and
#!/bin/bash
cmd="python interactive_foo.py"
gnome-terminal --tab -- bash -ic "lxc exec my_lxc -- \"$cmd\""
However, when I run either bash script, I notice a new terminal tab opens and closes quickly.
The new terminal tab should remain open and allow me to interactive with interactive_foo.py
. How can we do this?
Also, when on the LXC host, running the following does not do/output anything:
lxc exec my_lxc -- "python interactive_foo.py"