VMM Beta 2: Installing VM Additions

In VMM we say "everything you can do in the GUI you can do on the command line” because the Administrator Console is build on top of Windows PowerShell.

The fact is, there are some things you can do on the command-line much easier than in the GUI. For example, if you are creating VMs using the Administrator Console, you will want to install VM Additions on them.

Using the Administrator Console you would:

1) Open the VM properties.

2) Click the Hardware Config tab.

3) Add a DVD drive to the IDE device if there is not one there already

4) Click "Known image file" and then browse to the VMAdditions ISO, click it, and click OK.

5) Click Apply

.

If the Known image file list does not currently include VMAdditions, you can copy the VMAdditions.iso file from Microsoft Virtual Server 2005 (which is installed by default with Virtual Machine Manager). You can find the VMAdditions.iso file in Windows Explorer at <C>:\Program Files\Microsoft Virtual Server\Virtual Machine Additions

Here is a PowerShell script you can run on the VMM server that will do that. Of course this is an example to get you thinking, and error checking should be added. It assumes that you have an ISO called VMAdditions.iso in a library share managed by VMM. The VM Additions are installed with Virtual Server 2005 R2 SP1 in the <yourinstalldrive>\Program Files\Microsoft Virtual Server\Virtual Machine Additions folder. So you first either copy this ISO to the library for use on all VMs, or modify the script to use the copy local to the host your VM is on. We recommend the first way J

# Install-VMAdditions.ps1

 

$vm = $args[0]

if ( $vm.State -eq ‘Running’ )

{

$vmadditions = get-iso | where { $_.Name –eq ‘VMAdditions’ }

Set-VirtualDVDDrive –VirtualDVDDrive $vm.VirtualDVDDrives[0] -Link –ISO $vmadditions

}

else

{

write-host "The VM must be Running before you can install VM Additions."

}

 

To use this script:

$vm = get-vm –Name “My VM”

C:\Scripts\Install-VMAdditions.ps1 $vm

 

The VM Additions installer will launch automatically inside the guest OS.

 

NOTE:

· At RTM, $vm.State will be $vm.Status

· The VM does not need to be running order to attach an ISO to a Virtual DVD drive, but the VM does need to be running in order to install VM Additions.

· On the Set-VirtualDVDDrive lines, the –Link­ parameter means: Point to the ISO inside the library instead of copying it to the host.

 

Bonus Question: Where are the virtual machine additions for Linux?

Answer: Read https://www.microsoft.com/technet/virtualserver/downloads/linuxguestsupport.mspx