VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts)
1 2 3 ... 5 Previous Next 65 Replies Last post: Sep 20, 2009 11:49 AM by AlexLudwig  

How to install VMware tools without a reboot? posted: Sep 14, 2008 1:40 AM

Click to view meistermn's profile Master 1,158 posts since
Dec 7, 2004

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?

http://poshcode.org/521


Re: How to install VMware tools without a reboot?

2. Sep 14, 2008 5:37 PM in response to: meistermn
Click to view halr9000's profile Master 813 posts since
Jun 7, 2007
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)

Re: How to install VMware tools without a reboot?

3. Nov 11, 2008 7:25 AM in response to: halr9000
Click to view leisibae's profile Novice 2 posts since
Feb 10, 2006
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>

OK

What could be the correct parameter?

Re: How to install VMware tools without a reboot?

4. Nov 11, 2008 1:31 PM in response to: leisibae
Click to view ewannema's profile Hot Shot 100 posts since
Aug 31, 2006

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.

Re: How to install VMware tools without a reboot?

5. Nov 13, 2008 12:55 AM in response to: ewannema
Click to view leisibae's profile Novice 2 posts since
Feb 10, 2006
Thank you very much for the info. I am going to investigate this approach as well.

Re: How to install VMware tools without a reboot?

6. Nov 19, 2008 6:07 AM in response to: leisibae
Click to view ade.orimalade@e-mis.com's profile Novice 6 posts since
Jan 18, 2006

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

Click to view gboskin's profile Hot Shot 206 posts since
Nov 19, 2008

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

Please let me know when you get this ???

Cheers


Re: How to install VMware tools without a reboot?

8. Nov 19, 2008 7:10 AM in response to: gboskin
Click to view gboskin's profile Hot Shot 206 posts since
Nov 19, 2008

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

Works but the virtual machines reboot

Trying the no-reboot option tomorrow

Re: How to install VMware tools without a reboot?

9. Nov 19, 2008 7:42 AM in response to: gboskin
Click to view ade.orimalade@e-mis.com's profile Novice 6 posts since
Jan 18, 2006

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


Click to view gboskin's profile Hot Shot 206 posts since
Nov 19, 2008
ok Cheers !!!!!!!

Re: How to install VMware tools without a reboot?

11. Nov 19, 2008 7:28 PM in response to: meistermn
Click to view wharlie's profile Novice 13 posts since
Aug 15, 2007

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.

Re: How to install VMware tools without a reboot?

12. Nov 25, 2008 1:35 PM in response to: wharlie
Click to view jp1960's profile Novice 27 posts since
Nov 11, 2004

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
}

Re: How to install VMware tools without a reboot?

13. Nov 26, 2008 2:10 PM in response to: jp1960
Click to view justin.emerson's profile Enthusiast 77 posts since
Jan 4, 2008

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?


Click to view Rajeev S's profile Hot Shot 193 posts since
Oct 27, 2006
JP1960's script works fine. Thanks for your help.
1 2 3 ... 5 Previous Next Go to original post

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Incoming Links

Communities