Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set username and password #268

Open
slambdev opened this issue Apr 7, 2023 · 1 comment
Open

Unable to set username and password #268

slambdev opened this issue Apr 7, 2023 · 1 comment

Comments

@slambdev
Copy link

slambdev commented Apr 7, 2023

Description

I am attempting to set the password of my machine, but it's continually hanging on the command. I referenced other examples within this repos history/issues, but unfortunately, it continues to hang. Any help is appreciated!

Example Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

vmname = "unreal-base"

Vagrant.configure("2") do |config|
  config.vm.box = "google/gce"

  config.vm.guest = :windows
  config.vm.communicator = "winrm"  
  config.winrm.port = 5986
  
  config.winrm.username = "shannen"
  config.winrm.password = "passw0rd"

  config.winrm.transport = :ssl
  config.winrm.ssl_peer_verification = false

  config.vm.define :winserver do |winserver|
    winserver.vm.synced_folder ".", "/vagrant", disabled: true
    
    winserver.vm.provider :google do |google, override|
      google.google_project_id = REDACTED
 
      google.image_family = "windows-2016"
      google.machine_type = "n1-standard-4"
      
      google.disk_size = "80"
      google.name = "dev"

      google.zone = "us-east4-c"

      google.setup_winrm_password = true

      google.tags = ['winrm', 'http-server', 'https-server']

      google.can_ip_forward = true

      google.accelerators = [{
        :type => "nvidia-tesla-p4-vws",
        :count => 1
      }]

      google.on_host_maintenance = "TERMINATE"

      override.winrm.port = 5986
      override.ssh.username = "shannen"
      override.ssh.private_key_path = "./tmp/id_rsa.pub"
    end
  end
end

Logs

Bringing machine 'winserver' up with 'google' provider...
==> winserver: Checking if box 'google/gce' version '0.1.0' is up to date...
==> winserver: Warning! The Google provider doesn't support any of the Vagrant
==> winserver: high-level network configurations (`config.vm.network`). They
==> winserver: will be silently ignored.
==> winserver: Launching an instance with the following settings...
==> winserver:  -- Name:                dev
==> winserver:  -- Project:              REDACTED
==> winserver:  -- Type:                 n1-standard-4
==> winserver:  -- Disk type:            pd-standard
==> winserver:  -- Disk size:            80 GB
==> winserver:  -- Disk name:            
==> winserver:  -- Image:                
==> winserver:  -- Image family:         windows-2016
==> winserver:  -- Instance Group:       
==> winserver:  -- Zone:                 us-east4-c
==> winserver:  -- Network:              default
==> winserver:  -- Network Project:      REDACTED
==> winserver:  -- Metadata:             '{}'
==> winserver:  -- Labels:               '{}'
==> winserver:  -- Network tags:         '["winrm", "http-server", "https-server"]'
==> winserver:  -- IP Forward:           true
==> winserver:  -- Use private IP:       false
==> winserver:  -- External IP:          
==> winserver:  -- Network IP:           
==> winserver:  -- Preemptible:          false
==> winserver:  -- Auto Restart:         true
==> winserver:  -- On Maintenance:       TERMINATE
==> winserver:  -- Autodelete Disk:      true
==> winserver:  -- Additional Disks:     []
==> winserver:  -- Accelerators:         [{:type=>"nvidia-tesla-p4-vws", :count=>1}]
==> winserver: Waiting for instance to become "ready"...
==> winserver: Machine is booted and ready for use!
==> winserver: Setting up WinRM Password
==> winserver: Temp Password: REDACTED
==> winserver: Waiting for WinRM To be ready
    winserver: WinRM address: REDACTED
    winserver: WinRM username: shannen
    winserver: WinRM execution_time_limit: PT2H
    winserver: WinRM transport: ssl
==> winserver: Changing password from temporary to winrm password # Hangs here
Vagrant timed out while attempting to connect via WinRM. This usually
means that the VM booted, but there are issues with the WinRM configuration
or network connectivity issues. Please try to `vagrant reload` or
`vagrant up` again.

Additional details

Vagrant v2.3.4

Screenshots

I did notice below. I have added my ssh keys to Metadata and VMs are supposed to inherit the ssh keys automatically so I didn't think this is an issue

Screenshot 2023-04-07 at 9 52 33 AM

From Metadata:

Screenshot 2023-04-07 at 9 53 36 AM

@slambdev
Copy link
Author

slambdev commented Apr 7, 2023

for anyone who runs into a similar issue...I've added the following and it helped get me further

      google.metadata = {
        'sysprep-specialize-script-cmd' => "googet -noconfirm=true install google-compute-engine-ssh",
        'enable-windows-ssh' => true
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant