bento icon indicating copy to clipboard operation
bento copied to clipboard

Windows boxes for VMware are missing VMware tools

Open irvingpop opened this issue 5 years ago • 5 comments

Version:

windows_2016 1.3.0

Environment:

Vmware

Scenario:

the vm_tools recipe does not have logic for installing VMware tools. It should probably do something like this (but as Chef) https://github.com/boxcutter/windows/blob/master/script/vmtool.bat

irvingpop avatar Jul 24 '19 22:07 irvingpop

@irvingpop / @tas50: I got this to work (vetted on Server 2019) by amending vm_tools.rb:

when 'vmware'
  # depends on `"tools_upload_flavor": "windows"` set in your builder
  powershell_script 'install vmware-tools' do
    code <<-EOH
      Start-Process -FilePath "d:/setup64.exe" -ArgumentList "/S /v `"/qn REBOOT=R ADDLOCAL=ALL`"" -Wait
    EOH
    ignore_failure true
  end

note: I derived the command ☝️ from the vmtool.bat referenced in the issue scenario.

johnjelinek avatar Feb 13 '20 19:02 johnjelinek

I'm not sure if there's a case in any of the bento templates to support setup.exe for 32-bit VMware tools. I'll leave that as an exercise to the reader.

johnjelinek avatar Feb 13 '20 19:02 johnjelinek

Looks like this is trying to get addressed here https://github.com/chef/bento/commit/935a43042634e82c4098f243560263f4bf6a59a2

johnjelinek avatar Feb 14 '20 21:02 johnjelinek

Yep I gave it a try last night. There’s more than just running the setup command since packer just uploads the ISO. I’ll give it a try a bit more with some logic from a few other packer projects floating aroubd

tas50 avatar Feb 14 '20 22:02 tas50

@tas50: what do you mean? It works phenomenally exactly as I listed above. I didn't have to do any additional shenanigans when referencing from the d: drive. Try adding the case statement in vm_tools.rb and see what happens for you. It worked specifically if I didn't specify a path to the ISO because it mounted into the d: drive.

johnjelinek avatar Feb 15 '20 02:02 johnjelinek

closing due to age. Please feel free to open a new issue or reopen this one if the problem still exists with the latest version of bento.

Stromweld avatar Jan 20 '23 00:01 Stromweld