user245011
user245011

Reputation: 75

Cannot run interactive console without a controlling TTY

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

Answers (1)

Lukino
Lukino

Reputation: 1455

Did you tried:

ssh -t <user>@<libvirthost> virsh console <vm_name>

where: user - user that exist on libvirthost libvirthost - where libvirt VM is running

More here

Upvotes: 3

Related Questions