How do I run an desktop executable file on Windows over SSH? - cygwin

Here's my situation:
I have Machine A - Linux Box, and Machine B - Windows Box using Cygwin and OpenSSH.
Currently, I can ssh between the two machines, and run programs. There is this program that I need to run on the Windows Machine that will Control the Desktop (some mouse clicks and such).
I need to be able to ssh to the Windows Machine from my Linux machine (done already) and run the program. When I do this, the program just hangs up. I can see the program in the System Processes on Windows, however it is doing nothing. When I call the program on Cygwin on the Windows machine, it runs flawlessly.
My question:
Is there a way to run the executable program on the Windows Machine that controls its Desktop environment - run it remotely over SSH?
PS: I have tried on the Windows Machine to go to Services > Cygwin sshd > Log on > Allow Services to interact with desktop. However, when this is checked I can't get the Cygwin sshd service started.

Related

How does my Windows computer running WSL2 know which OS kernel to run a program on?

How does my Windows computer that is running WSL2 know which OS kernel (Windows or Linux) to execute a program with? I know that WSL2 is essentially a lightweight VM but idk how to leverage this knowledge. I thought it might depend on whether or not the program was inside the WSL2 directory but when I moved a Windows executable (explorer.exe) into my WSL2's /home/username directory and executed it, it ran fine and opened File Explorer normally. Is it something about the executable file that lets the computer know which OS kernel (Windows or Linux) to run it with?
I am asking this because I'm wondering if it's ok to keep and work with Linux executables in my Windows directory ("/mnt/c/Users/myname/node projects").

VSCode execute node script on remote linux or windows machine

Using VSCode, is it possible to execute a node.js script on a remote linux or windows system without setting up a full Visual Studio Code Remote Development Environment?
Assume the following:
VSCode installed on client (Windows)
remote system is a virtual machine running on the client. It has access to the project folder (including the script to be executed and the node modules) on the client. Node is installed on the remote system.
Actually I just need something like a launch configuration which executes an SSH command for linux, for windows maybe something else. With these assumptions (shared project folder between remote system and client), is that possible without setting up a full Visual Studio Code Remote Development Environment? I don't need remote editing or debugging.

Is it possible to execute sh files GUI application from linux remote server and view it on local machine?

I have a job that runs denodo platform on remote server. Sh files is a GUI application, and I have to run it to start denodo service. I can't access it in windows, is there a way to solve these problems?
Already running sh files on Putty Windows, but only return null.
If it's a linux GUI application, you should "export display" to view the server screen on your workstation.
Depending of your workstation linux distribution, it might be as easy as :
xhost +<IP_address_of_workstation>
./runMyApp.sh
As your workstation is running windows operating system, you have do further configuration :
https://superuser.com/questions/325630/how-can-i-export-display-from-a-linux-terminal-to-a-windows-pc
https://seanthegeek.net/234/graphical-linux-applications-bash-ubuntu-windows/
If your workstation is connected through SSH you need even more configuration as discussed here : https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-to-run-graphics-applications-remotely
You can run GUI-Applications of remote linux host in a windows client via ssh (putty) with x-forwarding and an installed x-server (xming)
See this question:
https://superuser.com/questions/299158/how-to-make-putty-do-the-equivalent-of-ssh-x

How to share Mac screen to Linux docker container?

I want to run odesk time tracker (a Qt4 app) which captures your screen and keystrokes for freelance work logging. But I don't trust it and want to sandbox it.
On Linux, there are ways to run GUI items on docker container and forward X11 to Linux host. Can I do this on mac? The app will run on Linux container and will be displayed on Mac with capturing screen/keystroke.
I think VNC method would display the linux host, not the mac. If linux connects mac, I have to install the software on mac. I don't know if I can do X11 forwarding.
You need to have XQuartz installed on your Mac. You can get it here -
http://xquartz.macosforge.org/landing/
Once you installed it, follow this procedure -
Run X11 application (included with XQuartz)
Open X11 Preferences and make sure "Allow connections..." is checked
Restart X11 application
Open a terminal
ssh to your docker with X11 forwarding: ssh -X YOUR_DOCKER_IP
From now on, any GUI application that you run on your docker will show up on your Mac.

open Teamviewer on a Debian machine via PuTTY on a Windows machine

hope everyone is doing well.
Got an issue I would like to pick the great brains in this forum about.
So, I have many Debian machines I often remote into using Teamviewer and a Windows machine, which works out great; however Teamviewer crashes for what appears to be no apparent reason. When such happens, normally I will PuTTY into the suspect Debian machine from a Windows 7 machine and issue the shutdown -r now command. When the debian computer reboots, so does Teamviewer and the suspect Debian machine is now visible in the "My computers" list on my Windows machine.
My question is this, why cant I just type teamviewer from the command line while PuTTYing into the Debian machine and have Teamviewer reopen on the Debian machine, making it visible in "My computers?" When I execute teamviewer command from PuTTY command line, I see the verbose output of teamviewer opening, but the machine never becomes visible in "My computers."
Now, I know it is possible to start Teamviewer remotely and have it show up back in 'My computers" list. I can do it via NoMachine; I simply connect to the suspect Debian machine and double click on the Teamviewer desktop launcher. However, NoMachine is very heavy and quite frankly, i just don't like it. I also know I can execute teamviewer via command line while sitting in front of the suspect Debian machine. PuTTY would be so much faster.
I have also tried VNC as well as X sessions. In both cases, i can open Teamviewer and it shows up in "My computers," but when I close the VNC of X, Teamviewer also closes and removes itself from "My computers."
Can someone help me figure out a way to restart Teamviewer via PuTTY please? Is there a way to open a desktop launcher via PuTTYs command line? Or is there a way to tell Teamviewer to execute in the suspect Debian machines active desktop session via PuTTYs command line?
Thanks all

Resources