You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
# install virtualbox guest additions on vbox guests
|
|
if vbox?
|
|
directory 'C:/Windows/Temp/virtualbox' do
|
|
recursive true
|
|
end
|
|
|
|
powershell_script 'install vbox guest additions' do
|
|
code <<-EOH
|
|
Get-ChildItem E:/cert/ -Filter vbox*.cer | ForEach-Object {
|
|
E:/cert/VBoxCertUtil.exe add-trusted-publisher $_.FullName --root $_.FullName
|
|
}
|
|
|
|
Start-Process -FilePath "e:/VBoxWindowsAdditions.exe" -ArgumentList "/S" -WorkingDirectory "C:/Windows/Temp/virtualbox" -Wait
|
|
EOH
|
|
ignore_failure true
|
|
end
|
|
|
|
directory 'C:/Windows/Temp/virtualbox' do
|
|
action :delete
|
|
end
|
|
end
|
|
|
|
# install vmware tools on vmware guests
|
|
# This is from https://github.com/luciusbono/Packer-Windows10/blob/master/install-guest-tools.ps1
|
|
if vmware?
|
|
powershell_script 'install vmware tools' do
|
|
code <<-'EOH'
|
|
$isopath = 'C:\Windows\Temp\vmware.iso'
|
|
Mount-DiskImage -ImagePath $isopath
|
|
$exe = ((Get-DiskImage -ImagePath $isopath | Get-Volume).Driveletter + ':\setup.exe')
|
|
$parameters = '/S /v "/qn REBOOT=R"'
|
|
Start-Process -FilePath $exe -ArgumentList $parameters -Wait
|
|
Dismount-DiskImage -ImagePath $isopath
|
|
Remove-Item $isopath
|
|
EOH
|
|
end
|
|
end
|
|
|