简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM