leecher1337 / ntvdmx64

Run Microsoft Windows NTVDM (DOS) on 64bit Editions
805 stars 81 forks source link

SSH #122

Closed Tonda102 closed 3 years ago

Tonda102 commented 3 years ago

Is it possible to use this in SSH? I tried to launch Norton Commander in SSH but it responded with the "Program nc.exe is not compatible...." error.

leecher1337 commented 3 years ago

SSH on Windows? I guess it depends how the SSH-daemon works, I didn't try if loader also works in a running service, which SSH daemon do you use so that I can try?

Tonda102 commented 3 years ago

I use OpenSSH. Client is bundled with Powershell since Fall Creators Update. Server could be installed easily using "optional features" in settings.

Tonda102 commented 3 years ago

I've also noticed that same problem occurs in Windows Terminal

Tonda102 commented 3 years ago

Ok. I think that I've figured it out. NTVDM won't run under anything but cmd and Powershell in legacy mode. It seems like cmd in OpenSSH will never run in legacy mode probably bacause of the new UTF-8 character encoding standard. Windows Terminal does the same.

leecher1337 commented 3 years ago

The reason why it doesn't start in OpenSSH is that ldntvdm.dll loader doesn't get injected into spawned cmd.exe process. You can test it and inject c:\windows\system32\ldntvdm.dll into the spawned cmd.exe with i.e. Process Hacker (right click on cmd.exe process -> Miscellaneous -> Inject DLL...). You will be able to start streaming I/O DOS Applications then, but i.e. textmode UI applications will fail, as all the Windows console integration requierd isn't mapped to the SSH daemon and so I guess it won't be of much use. If this would be usable, I can try to find out how to inject loader into spawned cmd.exe process, but if it's not really useful anyway, I may not put much work into it. Here is dpmi.exe test program running in an OpenSSH-Session:

image

Tonda102 commented 3 years ago

Thank you for your professional explanation! I was originally looking for some universal software that would integrate emulation for original DOS textmode UI applications into modern Windows shell. That's how I ended up here. I personally would not have any real use from the loader so I think that you don't have to really do anything about this.

I really like your work anyway. Wish you the best.

leecher1337 commented 3 years ago

Just a note: If you don't mind running Linux and you want to use DOS-applications remotely via SSH, I would suggest dosemu, see: https://github.com/leecher1337/ntvdmx64/issues/49 It works really well and fast for this purpose and has the same performance as original NTVDM when running in V86 mode. I also made some drivers for dosemu, i.e. Pervasive BTRIEVE driver. dosemu2 also support KVM integration, so you also have good performance with VT-x.

Btw, here are some images of running DOS-applications via SSH in dosemu2: https://github.com/dosemu2/dosemu2/issues/1076