You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to understand the handling of STDIN and am a little lost. From the comments in libkrun.h where it says
The VMM will attempt to take over stdin/stdout to manage them on behalf of the process running inside the isolated environment, simulating that the latter has direct control of the terminal.
I'm assuming that something is being done with the STDIN FD of the chroot_vm and therefore the target process STDIN and it looks from running a process with chroot_vm as a subprocess via python that STDIN is getting closed and reopened somehow.
In these lsof listings I can see the parent (75590) has opened PIPEs to the subprocess and STDOUT/STDERR remain open and connected to the chroot_vm child (75622) but the child has FD 0 as a PIPE with no connection back to the parent.
Is this expected? If so what is the recommended way to drive a subprocess where you need to feed input to it's STDIN?
This is actually a known limitation of libkrun. STDIN/STDOUT are tied to the emulated virtio-console, and their interactions are designed with interactive TTY sessions in mind, to the point of tying the lifetime of the VM to STDIN.
We need to revamp this mechanism to properly use non-TTY uses, such as the one you're describing. I'll create an Issue to track this progress.
I'm trying to understand the handling of STDIN and am a little lost. From the comments in libkrun.h where it says
I'm assuming that something is being done with the STDIN FD of the chroot_vm and therefore the target process STDIN and it looks from running a process with chroot_vm as a subprocess via python that STDIN is getting closed and reopened somehow.
In these lsof listings I can see the parent (75590) has opened PIPEs to the subprocess and STDOUT/STDERR remain open and connected to the chroot_vm child (75622) but the child has FD 0 as a PIPE with no connection back to the parent.
Is this expected? If so what is the recommended way to drive a subprocess where you need to feed input to it's STDIN?
The text was updated successfully, but these errors were encountered: