Vagrant 1.8.6, Windows 10, trying to use ssh instead of winrm

395 views
Skip to first unread message

lucidbee

unread,
Oct 26, 2016, 2:52:54 PM10/26/16
to Vagrant
I have a windows 10 custom box that I made according to vagant doc instructions
            tar cvzf custom.box ./*
as this is provider vmware_workstation and vagrant package is not supported.

This vm fails to vagrant up with ssh failures. It is supposed to use winrm.
The host machine is ubuntu 16.04

 ==> win10dev_3: Verifying vmnet devices are healthy...
==> win10dev_3: Preparing network adapters...
==> win10dev_3: Fixed port collision for 22 => 2222. Now on port 2203.
==> win10dev_3: Starting the VMware VM...
==> win10dev_3: Waiting for machine to boot. This may take a few minutes...
    win10dev_3: SSH address: 172.16.224.163:22
    win10dev_3: SSH username: vagrant
    win10dev_3: SSH auth method: private key             # should not be using ssh!!

The Vagrantfile I have in the dir where I am bringing it up contains:


# Configure vagrant using Configure API v2
Vagrant.configure(2) do |config|

  # Configuration for the windows development VM (this is the
  # original 'brain' VM)
  config.vm.define "win10dev_3" do |win10dev_3|

    # TODO: the box can be tied to an environment variable so we can build on
    #       different platforms and/or 32-bit vs 64-bit

    config.vm.communicator = "winrm"
    win10dev_3.vm.box = "bonsai/win10dev_3"
    config.vm.guest = :windows
    config.vm.boot_timeout = 600
    config.winrm.transport = :plaintext
    config.winrm.basic_auth_only = true
    config.winrm.password = "vagrant"
    config.winrm.username = "vagrant"
    config.ssh.insert_key = false

I have tried different things.
To configure winrm I run the following script:

# Supress network location Prompt
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" -Force

# Set network to private
$ifaceinfo = Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex $ifaceinfo.InterfaceIndex -NetworkCategory Private

# Set up WinRM and configure some things
winrm quickconfig -q
winrm s "winrm/config" '@{MaxTimeoutms="1800000"}'
winrm s "winrm/config/winrs" '@{MaxMemoryPerShellMB="2048"}'
winrm s "winrm/config/service" '@{AllowUnencrypted="true"}'
winrm s "winrm/config/service/auth" '@{Basic="true"}'

# Enable the WinRM Firewall rule, which will likely already be enabled due to the 'winrm quickconfig' command above
Enable-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)"

sc.exe config winrm start= auto

exit 0

Any help sincerely appreciated.

lucidbee



Alvaro Miranda Aguilera

unread,
Oct 26, 2016, 3:47:13 PM10/26/16
to vagra...@googlegroups.com
Hi

This is how you can enable winrm for win10


If you want you build boxes, check packer.io, its also a hashicorp tool to build boxes.

Have a look at this repo. you should be able to check the scripts.



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/f281eb18-471d-42b7-ac68-a6286fd86003%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

lucidbee

unread,
Oct 26, 2016, 6:05:54 PM10/26/16
to Vagrant

https://github.com/MattHodge/PackerTemplates/blob/master/floppy/winrm.ps1

I tried running that and winrm was still not enabled.

So I tried a vagrant destroy and tried to do up again. I got this message in the --debug file:

DEBUG vmware: VM state requested. Current state: running
 INFO subprocess: Starting process: ["/usr/bin/vmrun", "list"]
 INFO subprocess: Command not in installer, restoring original environment...

Could this be causing problems?

lucidbee
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Oct 27, 2016, 3:03:21 AM10/27/16
to vagra...@googlegroups.com
That is not an error.

On adition to WinRM, Firewall setup is required.

If you could RDP or connect to the console, then disable the Firewall on Windows should help.

Alvaro,

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/eaa8a8a7-aa05-4864-8b9f-65655c62c2ef%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

lucidbee

unread,
Oct 27, 2016, 1:13:10 PM10/27/16
to Vagrant
I can connect to the console (inside vmware), it is the provisioning which has not taken place.
I have completely disabled the windows firewall and that did not change the ssh problem.

I would have used packer in the beginning if I knew this would not work. But this method is in the docs and looks simpler. (See 'packaging' section at the bottom of this page: https://www.vagrantup.com/docs/vmware/boxes.html).

lucidbee



--
Alvaro

lucidbee

unread,
Oct 27, 2016, 5:52:10 PM10/27/16
to Vagrant
 HEY I was able to get this up.
I followed the instructions here, adjusted for vmware rather than virtualbox.
  http://huestones.co.uk/node/305
I used the 'tar' instructions to create the box. It had a Vagrant file in the box which followed the suggestions at the link.
Noteworthy: port forwarding used by winrm and also conifiguration of of the machine before I made the base box.
thanks,
lucidbee
Reply all
Reply to author
Forward
0 new messages