2

I have created a Vyatta virtual machine on my Hyper-V server, but I didn't enable ssh on that virtual machine. I want to connect to that machine without enabling the ssh and execute some shell commands using power shell. Is it possible to that? Is there any way to access that machine other than Hyper-V console?

Wesley
  • 33,060

2 Answers2

8

[...] I didn't enable ssh on that virtual machine. I want to connect to that machine without enabling the ssh and execute some shell commands using power shell.

Your desire to connect remotely with a shell is completely at odds with your desire to disable remote services that offer a shell.

One way or another you have to enable a transport to carry shell communication. PowerShell does not run on Linux (whacky pet projects and implementations aside), and even if you did you'd need to enable the WinRM service, which is basically (broadly speaking), OpenSSH for Windows. If you've disabled SSH on the Linux machine there's no reason to believe you'd enable WinRM if it was theoretically available.

You have no option but to enable ssh or use the Hyper-V console.

Wesley
  • 33,060
2

It sounds like you want console access to Vyatta without opening the ports necessary. If that's the real requirement, I think you should configure one of the virtual COM ports for the VM as a console. You'll need to configure this according to Vyatta's instructions. I'm not familiar with Vyatta, but I've done this with Ubuntu many times, as described here:

https://help.ubuntu.com/community/SerialConsoleHowto

Then you can either use PuTTY to connect to the named pipe from the virtual com port, or you can reflect it to a TCP port with this utility:

http://shvechkov.tripod.com/nptp.html

When you connect the COM port, I recommend COM2 within the VM. COM2 is, by default, configured in a way that works well for a terminal (instead of well for the NT kernel debugger.) In later versions of Hyper-V, you can configure the COM port by using the following PowerShell command. In earlier versions, COM2 is the only COM port that will work for you.

set-vmcomport -debuggermode off

Jake Oshins
  • 5,186