Skip navigation
VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts)
34,980 Views 78 Replies Last post: Feb 16, 2011 11:00 AM by aryan14in RSS
1 2 3 ... 6 Previous Next
meistermn Master 1,474 posts since
Dec 7, 2004
Currently Being Moderated

Sep 14, 2008 1:40 AM

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?

 

 

http://poshcode.org/521

 

 

 

 

 

halr9000 Master vExpert 1,124 posts since
Jun 7, 2007
Currently Being Moderated
2. Sep 14, 2008 5:37 PM in response to: meistermn
Re: How to install VMware tools without a reboot?

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
leisibae Novice 2 posts since
Feb 10, 2006
Currently Being Moderated
3. Nov 11, 2008 7:25 AM in response to: halr9000
Re: How to install VMware tools without a reboot?

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>

 

Re: How to install VMware tools without a reboot?

 

 

What could be the correct parameter?

 

 

ewannema Hot Shot 102 posts since
Aug 31, 2006
Currently Being Moderated
4. Nov 11, 2008 1:31 PM in response to: leisibae
Re: How to install VMware tools without a reboot?

 

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
leisibae Novice 2 posts since
Feb 10, 2006
Currently Being Moderated
5. Nov 13, 2008 12:55 AM in response to: ewannema
Re: How to install VMware tools without a reboot?

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

ade.orimalade… Novice 6 posts since
Jan 18, 2006
Currently Being Moderated
6. Nov 19, 2008 6:07 AM in response to: leisibae
Re: How to install VMware tools without a reboot?

 

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

 

 

gboskin Hot Shot 223 posts since
Nov 19, 2008
Currently Being Moderated
7. Nov 19, 2008 6:25 AM in response to: ade.orimalade…
Re: How to install VMware tools without a reboot?

 

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

 

 

Please let me know when you get this ???

 

 

 

 

 

Cheers

 

 

 

 

 

gboskin Hot Shot 223 posts since
Nov 19, 2008
Currently Being Moderated
8. Nov 19, 2008 7:10 AM in response to: gboskin
Re: How to install VMware tools without a reboot?

 

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

 

 

Works but the virtual machines reboot

 

 

Trying the no-reboot option tomorrow

 

 

ade.orimalade… Novice 6 posts since
Jan 18, 2006
Currently Being Moderated
9. Nov 19, 2008 7:42 AM in response to: gboskin
Re: How to install VMware tools without a reboot?

 

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 Hot Shot 223 posts since
Nov 19, 2008
Currently Being Moderated
10. Nov 19, 2008 7:45 AM in response to: ade.orimalade…
Re: How to install VMware tools without a reboot?

ok Cheers !!!!!!!

wharlie Novice 16 posts since
Aug 15, 2007
Currently Being Moderated
11. Nov 19, 2008 7:28 PM in response to: meistermn
Re: How to install VMware tools without a reboot?

 

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.

 

 

jp1960 Novice 27 posts since
Nov 11, 2004
Currently Being Moderated
12. Nov 25, 2008 1:35 PM in response to: wharlie
Re: How to install VMware tools without a reboot?

 

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
}

 

 

 

 

 

 

 

 

 

 

justin.emerson Enthusiast 83 posts since
Jan 4, 2008
Currently Being Moderated
13. Nov 26, 2008 2:10 PM in response to: jp1960
Re: How to install VMware tools without a reboot?

 

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?

 

 

 

 

 

Rajeev S Expert 306 posts since
Oct 27, 2006
Currently Being Moderated
14. Nov 28, 2008 10:56 PM in response to: justin.emerson
Re: How to install VMware tools without a reboot?

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

Go to original post 1 2 3 ... 6 Previous Next

Bookmarked By (1)

Share This Page

Communities