Score:0

"ssh -t" from Linux to Windows and Run Command with Quoted Path

in flag

I am trying to start Virtualbox images hosted on a Window box by running a cronjob from a Linux box. The job simply SSHs into Windows and runs a vboxmanage command to start up the VMs. I specifically want to do it this way instead of locally on the Windows box as a scheduled task for my own reasons. The problem I am running into is that Windows doesn't like accepting VBoxManage as a command by itself. It is requiring I add in the C:\Program Files\Oracle\VirtualBox\VBoxManage.exe as the executable path for the command.

Currently my bash script looks like this:

#!/bin/bash
ssh -t [email protected] "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm VIRTUALMACHINE1 --type headless

When I run it the error comes back as "C:\Program is not recognized as an internal or external command."

My question can be simple or complex.

The simple version is: How can I get the proper syntax on this one line command to have the Windows SSH server interpret the VBoxManage command using the path of the executable?

The complex version is: is there a method to control VirtualBox remotely through an ssh -t script that involves no programming locally on the Windows server or storing files/batch scripts on the server?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.