Open lars18th opened 1 month ago
@lars18th Thanks for reporting this. I fiddled this and I can reproduce the same behavior. It is something we can try to fix in the future.
I fiddled this and I can reproduce the same behavior. It is something we can try to fix in the future.
Good news! 👍
Possible duplicate of #1170
Possible duplicate of #1170
Hi @ricab ,
I'm not sure, but I think it might be involuntarily fixed in #3735. I think so because there is a commit that says: "[ssh] Set stdin to Raw only after libssh inherits sane settings".
And I can't test it personally because the Windows client source code is hidden. Perhaps you could compile one version with this patch and test it.
Describe the bug
multipass.exe
Windows version of the CLI tool, this binary is not supporting any STDIN redirection. Instead it attach directly to the terminal API (or something else, but you can read but not write with a PIPE connected to this binary).To Reproduce You can test it trying to stablish a PuTTY session with the ssh-connection protocol:
psusan
tool withsudo apt install putty-tools
inside the virtual machine.plink.exe -ssh-connection -sshlog .\plink.log -proxycmd "D:\multipass.exe exec vmname -- psusan" dummy
How, and what happened?
multipass.exe
STDIN redirection.psusan
process is running inside the vmname doing anothermultipass shell vmname
andps -ae | grep psusan
.more plink.log
).plink.exe
with a CTRL+C, thepsusan
and the ssh connection continues running. You need to kill it inside the virtual machine.Expected behavior The same command in a Linux host with identical configuration works like a charm:
Logs Because this is pure command line, no
multipass_gui.log
exist. You can see theplink.log
running with the Windows version:This indicates that the
multipass.exe
is writing to the STDOUT, because the line:Event Log: Remote version: SSHCONNECTION@putty.projects.tartarus.org-2.0-PSUSAN_Release_0.81
is writed from the other end (the psusan process) and it arrived to the plink tool that reads from the STDOUT connected to the multipass process. However, the STDIN is NEVER readed from the multipass process. Therefore, nothing arrives to the other end.Additional info
OS
: Microsoft Windows [Version 10.0.22631.4317]multipass version
:multipass info
:multipass get local.driver
:Additional context Similar effect appears if you try to run the tool from WSL. Nothing is readed from the STDIN pipe.
I hope you will fix this soon. To put the windows cli tool in pair with the linux version.
And additionally try to fix the closing of ssh connections to the virtual machine if the multipass process cannot establish the connection. With these tests I ended up with a lot of phantom multipass processes on the Windows workstation. All because the CTRL+C of the incomplete connection doesn't terminate the process.