meistermn
Expert
Expert

How to install VMware tools without a reboot?

On the following url the a script for updating vmware tools. What is the parameter for no reboot?

It must be in line 48 . Is the command update-tools by vmware with all there switches described?

0 Kudos
78 Replies
meistermn
Expert
Expert

Looked at this document:

http://www.vmware.com/files/pdf/vi_toolkit_win_1.0_samples.pdf

tried the command : help update-tools

But this did not helped me. I though it could be the common parameters, but i think it is the wrong direction.

http://www.vmware.com/support/developer/windowstoolkit/wintk10/doc/viwin_admin.pdf

Ok tried look at this command . Get-Help about_CommonParameters

Allthough did not help.

Last i look at the vi toolkit cmdlets reference, but it is nothing telling about a no reboot switch.

So what i am looking for is a paramater for

REBOOT="ReallySuppress"like you cando it from cmd in windows.




msiexec -i "C:\install\vmware-tools\ESX-61618\vmware tools.msi" addlocal=all REMOVE=Hgfs /qn REBOOT="ReallySuppress"

0 Kudos
halr9000
Commander
Commander

If you want to supply switches you'll have to do it the hard way as Update-Tools cmdlet doesn't support this feature. Luckily, the hard way isn't all that hard, and I happened to blog about last night. http://halr9000.com/article/605

In the article where you see $null, you can supply arguments to the installer. I've never done so, so I can't tell you precisely how the command will work but that's how its done.

e.g.

$installerArgs = 'REBOOT="ReallySuppress"'

Get-VM | % { (Get-View $_).UpgradeTools_Task($installerArgs) }

Test it on a test VM first of course. Just put a VM name following Get-VM to do that.






Author of the upcoming book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
leisibae
Contributor
Contributor

We have the same need to install VMware Tools automatically without a reboot. The reboot will be done during a security patch rollout. In this case we can combine tasks together.

I followed this blog as other ones. The following command can be performed by PowerShell successfully, but a reboot is done after the VMware Tools upgrade.

connect-viserver -server rbams3t3-v2

get-vm -name rkams517-v3 | get-view | % { $_.UpgradeTools_task("") | get-viobjectbyviview | wait-task }

Afterwards I followed the advise from the previous blog, with the following command which should perform it without reboot:

$installerArgs = 'REBOOT="ReallySuppress"'

get-vm -name rkams517-v3 | get-view | % { $_.UpgradeTools_task($installerArgs) | get-viobjectbyviview | wait-task }

In the virtual machine I received the following message:

InstallShield

Command line parameters:

/L language ID

/S Hide initialization dialog. For silent mode use: /S/v/qn

/V parameters to MsiExec.exe

/UA<url to InstMsiA.exe>

/UW<url to InstMsiW.exe>

/UM<url to msi package>

What could be the correct parameter?

0 Kudos
ewannema
Enthusiast
Enthusiast

I have not done this with PowerShell yet, but this is how I do it via shell script on the Windows VMs. VMwareToolsUpgrader just get the tools distribution and passes the rest of the arguments after -p to Setup.exe. You can see that arguments are then passed to msiexec using the /v switch. Not sure if adding /v"/qn /norestar" will help you in this case or not.

"C:\Program Files\VMware\VMware Tools\VMwareToolsUpgrader.exe" -p "/s /v\"/qn /norestart /L*v C:\Windows\Temp\ToolsUpgrade.log\""

I would recommend using something like Process Monitor or Process

Explorer to see what is actually running on the VM when you run your

code (in PM you can filter on vmwaretoolsupgrader.exe, setup.exe, and msiexec.exe). This is how I managed to get a working command string like above. Snapshots are clearly a good thing in this situation so you can repeat the same actions.

http://wannemacher.us
0 Kudos
leisibae
Contributor
Contributor

Thank you very much for the info. I am going to investigate this approach as well.

0 Kudos
ade_orimalade
Contributor
Contributor

Hi I came accross this ..

We also have the requirement to automate the upgrade vmware tools on 190 windows virtual machine with the no-reboot option in a cluster.

If powershell can do this ..it will be a massive plus

Any one got this working yet

0 Kudos
gboskin
Enthusiast
Enthusiast

Auto upgrading vmwaretools with the no rebbot option will be just great..

Please let me know when you get this ???

Cheers

0 Kudos
gboskin
Enthusiast
Enthusiast

Get-VM | % { (Get-View $_).UpgradeTools_Task($null) }

Works but the virtual machines reboot

Trying the no-reboot option tomorrow

0 Kudos
ade_orimalade
Contributor
Contributor

For No reboot

$cluster = "< >" # Enter the required cluster name

$installerArgs = 'REBOOT="ReallySuppress"'

Get-Cluster -Name $cluster | Get-VM | % { (Get-View $_).UpgradeTools_Task($installerArgs) }

As stated above

Cheers

gboskin
Enthusiast
Enthusiast

ok Cheers !!!!!!!

0 Kudos
wharlie
Contributor
Contributor

The following command works for me if I copy the install files to the vm and run the setup.exe (silent, no reboot)

setup.exe /S /v"REBOOT=R /qb"

But I can't get powershell to pass the arguments correctly using the scripts above.

The install runs silently and I get no errors but it still reboots.

0 Kudos
jp1960
Contributor
Contributor

Combining bits of information from different postings, I came up with this Powershell script that will update VMWare tools without reboot for all VMs within a specified cluster that have a VMWare tools status of "old":

$insParm = '/s /v"/qn /norestart"'
$updList = get-cluster -name "DMZ-AMD-CLUSTER"|get-vm | where-object {$_.powerstate -eq "PoweredON"} | % {get-view $_.ID} |where {$_.guest.toolsstatus -match "toolsOld" }
foreach ($uVM in $updList)
{
$uVM.name
$uVM.UpgradeTools_Task($insParm)
#Wait 30 seconds before starting another update task
Start-sleep -s 30
}

0 Kudos
justin_emerson
Enthusiast
Enthusiast

Unfortunately none of these scripts have worked for me properly. jp1960, your script does function and run, however my VMs still reboot after installing VMware tools. Ade, your script gives me an error message because the $installerArgs seems to think it's a null variable (even though I can go in and see the contents of the variable just fine). It seems like if I try to add REBOOT=ReallySuppress to any of the scripts, it fails. Do I need to escape the = character or something?

0 Kudos
Rajeev_S
Expert
Expert

JP1960's script works fine. Thanks for your help.

0 Kudos
FIISupport
Contributor
Contributor

Hi there,

I would like to modify JP1960's script to only apply to a folder

or alternately a specific host (vs the entire cluster) . Can anyone shed some light

on how to do this?

Cheers

0 Kudos
justin_emerson
Enthusiast
Enthusiast

Replace get-cluster -name "DMZ-AMD-CLUSTER" with get-folder -name "FOLDER NAME" or get-host -name "HOSTNAME"

0 Kudos
justin_emerson
Enthusiast
Enthusiast

As a follow up to this - the command used will only work for Windows VMs. How can you modify the command to only affect windows virtual machines? I'm just learning powershell, and I'm trying to figure out how (without sticking if statements into the large for each block) to limit it to only VMGuests whose OSFullName -like "Windows"

Any quick help?

0 Kudos
moosethumbs
Contributor
Contributor

I think you've pretty much answered your own question. I think you can just add where-object {$_.osfullname -like "Windows"} | to the second line:

$updList = get-cluster -name "DMZ-AMD-CLUSTER"|get-vm | where-object {$_.powerstate -eq "PoweredON"} | where-object {$_.osfullname -like "Windows"} |% {get-view $_.ID} |where {$_.guest.toolsstatus -match "toolsOld" }

0 Kudos
Freefall13
Contributor
Contributor

I can't get the tools to install without rebooting the VM either. I've tried jp1960's script and while it upgrades the VMware tools the VMs still reboot. If I log into the VM and run the setup command I can get it to install without rebooting, e.g.:

setup /s /v"/qn REBOOT="ReallySuppress" REINSTALLMODE=vamus REINSTALL=ALL"

The upgradetools_task method isn't passing through the no reboot to the msiexec.

0 Kudos