From 17e571c9138431483d207971374aaa27f3309089 Mon Sep 17 00:00:00 2001 From: bri Date: Sat, 24 Dec 2022 06:59:05 -0500 Subject: [PATCH] port vmserial-connect to powershell in case you want to enter the serial console on a Hyper-V server _without_ WSL still requires `socat`, obviously, but obtaining it on Windows is a little more complicated than using your package manager. I've tested with the one from [unix-utils](https://sourceforge.net/projects/unix-utils/files/socat/1.7.3.2/) and it works great, but if I install msys2 and install socat that way it doesn't work. I would prefer an easier way to put socat in, perhaps a statically-compiled one (or a wild enough wish could even be just to implement the fancy PTY stuff necessary in npiperelay itself?) --- scripts/vmserial-connect.ps1 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 scripts/vmserial-connect.ps1 diff --git a/scripts/vmserial-connect.ps1 b/scripts/vmserial-connect.ps1 new file mode 100644 index 0000000..9b77720 --- /dev/null +++ b/scripts/vmserial-connect.ps1 @@ -0,0 +1,5 @@ +$name=$args[0] +$comport=$args[1] +$vmcomport=Get-VMComPort -VMName "$name" -Number "$comport" +$pipe=$vmcomport.Path -replace "\\","/" +socat "EXEC:'$((get-command npiperelay).source -replace "\\","/") -ei $pipe',pty,rawer" "STDIO,escape=0xf,rawer"