Archive for 31/03/2012

Copy and Paste Through A Virtual Machine Console

This post will detail how to enable the copy and paste function through a VMware virtual machine console.

Step 1. Power down the virtual machine you want to enable copy and paste for.

Step 2. Edit the virtual machine settings and navigate to the Options tab, then click General under Advanced. On the bottom right of the options screen, click Configuration Parameters.

Step 3. In the Configure Parameters option window, click Add Row to create a new configuration entry.

Step 4. Create two entries with the following Names and Values:

isolation.tools.copy.disable    false

isolation.tools.paste.disable   false

Note, this feature only allows you to copy and past text from your clipboard. This unfortunately does not allow you to copy files through the virtual machine console. If this is what you are trying to achieve, I would recommend using a similar method I use of creating an ISO of your files using CDBurnerXP (very easy to use) and attach the ISO to your virtual machine.

Thanks for reading.

How To Install VMware Tools Without Rebooting

This post will detail how to upgrade VMware tools on virtual machines without having to reboot by using PowerCLI. Personally I have found this quite useful when having to upgrade VMware tools on production servers that require 24×7 up time. I have tried this update method on Windows Server 2008/R2 and RHEL 5/6 with success.

First you need to connect to your vCenter server via PowerCLI and choose one of the two methods of deployment detail below.

Upgrade VMware tools on a singular virtual machine:

Get-VM “yourvm” | Update-Tools –NoReboot

Upgrade VMware tools on all virtual machines:

Get-VM | Update-Tools –NoReboot

Thanks for reading and remember to lookout for my other posts on PowerCLI.

How To Export PowerCLI vCenter Reports

This is a quick post on how to generate some reports from vCenter through PowerCLI.

Log in to your vCenter server via PowerCLI and run a report of your choice:

Virtual Machine Report:

Get-VM | Export-Csv -Path “c:\vmreport.csv”

Snapshot Report:

Get-VM | Get-Snapshot | Export-Csv -Path “c:\snapshotreport.csv”

Datastore Report:

Get-Datastore | Export-Csv -Path “c:\datastorereport.csv”

Host Report:

Get-VMHost | Export-Csv -Path “c:\hostreport.csv”

Cluster Report:

Get-Cluster | Export-Csv -Path “c:\clusterreport.csv”

Thanks for reading.

Connect All Virtual Machine Network Adapters With PowerCLI

In this post I will explain how to run a PowerCLI command to connect or disconnect all virtual machine network adapters. Recently I experienced a power failure in one of my data centres that took out one of my SANs as well a host that held my vCenter server. When the kit was powered back on and vCentre was responding, an odd occurrence took place where all virtual machines managed by this vCenter server had the “Connect On Power On” check box enabled but the “Connected” check box wasn’t. At the time the only way to rectify this issue was to manually go though each virtual machine and check the box for the adapter to be connected. Not a fun experience.

To avoid the requirement for manual intervention to solve this issue for each virtual machine in the future, I have put together a PowerCLI command that will run though all virtual machines and connected their respective network adapters.

To do so, first load PowerCLI and connect to your vCenter server with the following command:

Connect-VIServer -Server vcenter.domain.local  -User domain/username -Password yourpassword

Following this, run the below command. This will run through all virtual machines managed by vCentre and connect network adapters 1 and 2. You can add additional adapters to be connected by simply adding more into the command e.g. “Network adapter 3″,”Network adapter 4″ etc.

Get-VM | Get-NetworkAdapter -Name “Network adapter 1″,”Network adapter 2″ | Set-NetworkAdapter -Connected:$true -Confirm:$false

I hope you found this post useful, and remember to look out for my future posts on PowerCLI.