VM listed as "stopped" when started using subprocess.Popen() #968
dataprolet
started this conversation in
General
Replies: 1 comment
-
If you want for the child process to survive parent's termination, you need to set subprocess.Popen(
["tart", "run", "vm"],
stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
preexec_fn=os.setsid,
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to write a Python script that starts two VMs for my in the background. To be able to execute the script but keep the VMs running I use the Python module
subprocess.Popen
and redirect stdout and stderr to /dev/null. That leads totart list
listing the VMs as stopped and further interaction with them impossible (e. g.tart ip vm1
). Anybody any idea how I can resolve this?subprocess.Popen('/bin/bash -c "/Applications/tart.app/Contents/MacOS/tart run --net-bridged=en0 vm1"', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
Beta Was this translation helpful? Give feedback.
All reactions