SSH for Windows

Hi,

To set this straight first, what I REALLY want is the possibility to use `vagrant ssh myWinVM` from my host system and then get into the VMs PowerShell. Why? Because I want to access win VMs the same way as linux VMs and I want to use tools like vim directly. I don't want to remove winrm, I just want to have both to be an option.

Some background on my project:

>!I am using Vagrant to spin up a Kubernetes cluster consisting of Win VM (worker node) and a linux VM (control plane node). Currently, it only really works with VirtualBox.!< At the moment I use [this vagrant box](https://app.vagrantup.com/StefanScherer/boxes/windows_2019) that is based on [Stefan Scherers repo](https://github.com/StefanScherer/packer-windows) that itself is a fork of [Joe Fitzgerald repos](https://github.com/joefitzgerald/packer-windows) (that looks to be a vagrant/ packer legend). The problem is, that Stefan removed SSH completely, while adding some cool new features. So I am currently trying to get SSH back. Here is what I tried: [This is my .json.](https://github.com/FriedrichWilken/packer-windows/blob/k8sinit/windows_2019_core_k8s_vb.json) I basically remove all the things that are not virtualbox (for now) and added the [openssh.ps1](https://github.com/joefitzgerald/packer-windows/blob/master/scripts/openssh.ps1) to the floppy files and set the pw and username: { "builders": [ { ... "floppy_files": [ ... "./scripts/openssh.ps1" ], ... "ssh_username": "vagrant", "ssh_wait_timeout": "{{user `winrm_timeout`}}", "ssh_password": "vagrant" } ], [This is my .template.](https://github.com/FriedrichWilken/packer-windows/blob/k8sinit/vagrantfile-windows_2019_core_k8s_vb.template) I added some forwarded ports that are --I think-- used by ssh. I also tried to set up some parameters for winssh but that did not work: config.winssh.username = "vagrant" config.winssh.password = "vagrant" config.winssh.shell = "powershell" ... config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true Still, if I `vagrant up` the resulting box, I can't ssh' into the machine. I basically time out after 5 minutes without any error. What am I doing wrong?

1 thought on “SSH for Windows”

Leave a Comment