bento
bento copied to clipboard
Windows boxes for VMware are missing VMware tools
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 / @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.
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.
Looks like this is trying to get addressed here https://github.com/chef/bento/commit/935a43042634e82c4098f243560263f4bf6a59a2
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: 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.
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.