{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/5742","labels_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5742/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5742/comments","events_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5742/events","html_url":"https://github.com/mitchellh/vagrant/issues/5742","id":79291831,"number":5742,"title":"vagrant hangs settings hostname on windows","user":{"login":"tcuthbert","id":4110383,"avatar_url":"https://avatars.githubusercontent.com/u/4110383?v=3","gravatar_id":"","url":"https://api.github.com/users/tcuthbert","html_url":"https://github.com/tcuthbert","followers_url":"https://api.github.com/users/tcuthbert/followers","following_url":"https://api.github.com/users/tcuthbert/following{/other_user}","gists_url":"https://api.github.com/users/tcuthbert/gists{/gist_id}","starred_url":"https://api.github.com/users/tcuthbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcuthbert/subscriptions","organizations_url":"https://api.github.com/users/tcuthbert/orgs","repos_url":"https://api.github.com/users/tcuthbert/repos","events_url":"https://api.github.com/users/tcuthbert/events{/privacy}","received_events_url":"https://api.github.com/users/tcuthbert/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-22T05:12:13Z","updated_at":"2015-05-22T08:27:27Z","closed_at":"2015-05-22T08:27:27Z","body":"Hey I'm running OSX and vagrant version 1.7.2\r\nWhen I explicitly set the hostname in my Vagrantfile, my windows guest hits an exception and I'm unable to perform tasks like, opening powershell or control panel without an insufficient memory exception.\r\n\r\nWhen I comment out the hostname line, everything appears to work again.\r\n\r\nVagrantfile\r\n````\r\nVagrant.configure(2) do |config|\r\n  config.vm.box = \"eval-win2012r2-standard-nocm-1.0.4\"\r\n  #config.hostmanager.enabled = true\r\n  #config.hostmanager.manage_host = true\r\n  #config.hostmanager.ignore_private_ip = false\r\n  #config.hostmanager.include_offline = true\r\n  config.vm.define 'example-box' do |node|\r\n    node.vm.guest = :windows\r\n    node.vm.hostname = 'example-box-hostname'\r\n    #node.vm.network :private_network, ip: '192.168.42.42'\r\n    #node.hostmanager.aliases = %w(example-box.localdomain example-box-alias)\r\n  end\r\nend\r\n````\r\n\r\nDebug:\r\n\r\n````\r\nDEBUG winrmshell: powershell executing:\r\nif ([System.Net.Dns]::GetHostName() -eq 'example-box-hostname') { exit 0 } exit 1\r\nif ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }\r\nDEBUG winrmshell: Output: {:data=>[], :exitcode=>1}\r\nDEBUG winrmshell: powershell executing:\r\n            try\r\n            {\r\n              $computer = Get-WmiObject -Class Win32_ComputerSystem\r\n              $computer.rename(\"example-box-hostname\")\r\n\r\n              Remove-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"Hostname\"\r\n              Remove-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"NV Hostname\"\r\n\r\n              New-PSDrive -name HKU -PSProvider \"Registry\" -Root \"HKEY_USERS\"\r\n\r\n              Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Computername\\Computername\" -name \"Computername\" -value \"example-box-hostname\"\r\n              Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Computername\\ActiveComputername\" -name \"Computername\" -value \"example-box-hostname\"\r\n              Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"Hostname\" -value \"example-box-hostname\"\r\n              Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"NV Hostname\" -value  \"example-box-hostname\"\r\n              Set-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -name \"AltDefaultDomainName\" -value \"example-box-hostname\"\r\n              Set-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -name \"DefaultDomainName\" -value \"example-box-hostname\"\r\n              Set-ItemProperty -path \"HKCU:\\Volatile Environment\" -name \"LOGONSERVER\" -value \"example-box-hostname\"\r\n              [Environment]::SetEnvironmentVariable(\"COMPUTERNAME\", \"example-box-hostname\", \"User\")\r\n\r\n              exit 0\r\n            }\r\n            catch\r\n            {\r\n              exit -1\r\n            }\r\n\r\nif ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }\r\nDEBUG winrmshell: Output: {:data=>[{:stdout=>\"\\r\\n\"}, {:stdout=>\"\\r\\n\"}, {:stdout=>\"__GENUS          : 2\"}, {:stdout=>\"\\r\\n__CLASS          : __PARAMETERS\\r\\n__SUPERCLASS     : \\r\\n__DYNASTY        : __PARAMETERS\\r\\n__RELPATH        : \\r\\n__PROPERTY_COUNT : 1\\r\\n__DERIVATION     : {}\\r\\n__SERVER         : \\r\\n__NAMESPACE      : \\r\\n__PATH           : \\r\\nReturnValue      : 0\\r\\nPSComputerName   : \\r\\n\\r\\n\"}, {:stdout=>\"CurrentLocation : \"}, {:stdout=>\"\\r\\nName            : HKU\\r\\nProvider        : Microsoft.PowerShell.Core\\\\Registry\\r\\nRoot            : HKEY_USERS\\r\\nDescription     : \\r\\nCredential      : System.Management.Automation.PSCredential\\r\\nDisplayRoot     : \\r\\nUsed            : \\r\\nFree            : \\r\\n\\r\\n\"}], :exitcode=>0}\r\n\r\n...\r\n\r\nhostname\r\nif ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }\r\n INFO winrmshell: Attempting to connect to WinRM...\r\n INFO winrmshell:   - Host: 127.0.0.1\r\n INFO winrmshell:   - Port: 5985\r\n INFO winrmshell:   - Username: vagrant\r\n INFO retryable: Retryable exception raised: #<WinRM::WinRMHTTPTransportError: Bad HTTP response returned from server (500).>\r\nDEBUG winrmshell: powershell executing:\r\nhostname\r\nif ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }\r\n INFO retryable: Retryable exception raised: #<WinRM::WinRMHTTPTransportError: Bad HTTP response returned from server (500).>\r\n\r\n````"},"comment":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/comments/104566445","html_url":"https://github.com/mitchellh/vagrant/issues/5742#issuecomment-104566445","issue_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5742","id":104566445,"user":{"login":"tcuthbert","id":4110383,"avatar_url":"https://avatars.githubusercontent.com/u/4110383?v=3","gravatar_id":"","url":"https://api.github.com/users/tcuthbert","html_url":"https://github.com/tcuthbert","followers_url":"https://api.github.com/users/tcuthbert/followers","following_url":"https://api.github.com/users/tcuthbert/following{/other_user}","gists_url":"https://api.github.com/users/tcuthbert/gists{/gist_id}","starred_url":"https://api.github.com/users/tcuthbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcuthbert/subscriptions","organizations_url":"https://api.github.com/users/tcuthbert/orgs","repos_url":"https://api.github.com/users/tcuthbert/repos","events_url":"https://api.github.com/users/tcuthbert/events{/privacy}","received_events_url":"https://api.github.com/users/tcuthbert/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T08:27:27Z","updated_at":"2015-05-22T08:27:27Z","body":"This can be closed. Turns out the issue was caused by having hyphens in the hostname."}}