Reputation: 75
I am trying to read and write to guest-vm console using the POPEN command. Reading(stdout) works fine, but when i add the stdin to POPEN i get the "Cannot run interactive console without a controlling TTY". Appreciate any suggestion on how to overcome this error.
p = Popen(["virsh", "console", "guest-vm"],
shell=False, stdin=PIPE, stdout=PIPE, close_fds=True)
for line in iter(p.stdout.readline, b''):
if line == "SUCCESS":
p.stdin.write('\n')
ERROR: error: Cannot run interactive console without a controlling TTY
Upvotes: 2
Views: 2774