Thursday 27 December 2012

VMWARE Tips and Tricks

VMware Server: 8 Must-Know Tips and Tricks

I have been using VMware for about 8 years now, and at this point I don’t think I could live without it. I started using it when my corporate laptop required Windows and I was using Linux. VMware allowed me to have both.
VMware is also a great tool for IT departments, for many reasons. It allows users to create unique environments and test different scenarios.  VMware can also replace production boxes, as is becoming more and more popular.
In fact, it seems that all my clients are using virtualization in one way or another to save money and increase performance.  That’s why I thought it would be good to share some VMware tips and tricks that can make using VMware easier than ever.

1. Enabling Virtual Network Computing

A handy tip for all of us that need to access the various servers remotely is Virtual Network Computing (VNC). VMware Server comes with VNC preinstalled; all you have to do is enable and configure it. To do this you must modify the virtual machine’s configuration file (.vmx) while the virtual machine is powered off.
First open the .vmx file in a text editor and add the following line:
RemoteDisplay.vnc.enabled = TRUE
This will enable standard VNC support. Now you can power on the virtual device and connect! VNC lets you interact with your PC from any other computer or mobile device on the Internet. So, for example, you can access the files on your home computer from your work computer, and vice versa.

2. Downloading Preconfigured Appliances

Why spend the time building a server when you can download a pre-built one? There are many pre-built servers to choose from, all available on the web. Technically they are free, but keep in mind you will still need to pay for licenses.
The benefits to these appliances are:
  • The appliances come with the OS and applications installed
  • You can simply install and run the appliance — no need to install the OS and apps
  • They are a great way to build a test environment
Several vendors provide these appliances, including Microsoft and VMware. VMware’s site has a section specifically devoted to appliances, called the VMware Virtual Appliance Marketplace. The Virtual Appliance Marketplace is a great source for downloading virtual appliances.

3. Increasing Performance

To increase performance on your virtual machines, there are several things you can do. The first thing you should always do is install the VMware tools on every virtual machine. The VMware tools contain drivers that are designed to increase virtual machine performance.
Next you can defragment your virtual drives regularly just as you would with a physical drive. You can also increase performance by scheduling antivirus and backup programs to run during off-peak hours when use is low, and turning off screen savers.
To further increase performance, VMware advises that you disable unused resources to free system resources. Items that you should evaluate and disable if not used include:
  • COM port 1
  • COM port 2
  • LPT port 1
  • Floppy drive
  • CD-ROM Auto-Detect
  • USB adapters
Disabling these devices will free up IRQ resources and eliminate IRQ sharing conflicts within the guest operation system that can cause performance problems. Remember, you should enable devices only when you need them.

4. Disabling CTRL-ALT-DEL

When you have a Virtual Machine loaded and you press CTRL-ALT-DEL it can cause various issues depending on the OS, especially with Linux hosts. VMware uses CTRL-ALT-INS in place of this command on virtual hosts and it can simplify your life to disable VMware from recognizing the CTRL-ALT-DEL command.
To make VMware ignore this key combination all you have to do is add the line:
mks.ctlAltDel.ignore = "TRUE"
to the "C:\Users\All Users\VMware\VMware Workstation\config.ini" file. Doing so instructs VMware to ignore the CTRL-ALT-DEL so you can eliminate the annoying pop-up message that says “VMware has detected you pressed CTRL-ALT-DEL.”

5. Using VMware Virtual Disk Manager

The Virtual Disk Manager allows you to manage your virtual disks within VMware. You can perform many tasks including growing, creating, shrinking, and defragmenting disks — all without powering on the Virtual Device.
  • To defragment your disks simply use the command: vmware-vdiskmanager.exe-d myVDisk.vmdk
  • To shrink a virtual disk without powering on the Virtual Device (Windows hosts only), use this command: vmware-vdiskmanager.exe-k myVDisk.vmdk
  • To expand the size of a virtual disk so it is larger than the size specified when you created it use: vmware-vdiskmanager.exe-x 45Gb myVDisk.vmdk. This however, will not expand the guest partition, you will have to use disk management software for that.

6. Using the Web Interface

VMware Server comes with a web based management tool. The VMware Management Interface allows you to manage most aspects of your Virtual Devices from one simple interface. With the web based tool you can:
  • Power on, suspend, resume, reset and power off the virtual machines
  • Connect the VMware Server Console to a given virtual machine
  • View details about the Virtual Devices, including system summary, hardware information, any connected users and a log of recent events
  • Setup secure console and management interface sessions with SSL for administrators
  • Change the start order and start/stop delay time of auto start Virtual Devices

7. Configuring Auto Start and Stop

If the web interface is not installed, you can set the order in which Virtual Devices start and stop, as well as the start and stop delay time, manually. To do this, edit the config file of the server, which can be found at:
  • Windows host = \Documents and Settings\All Users\ApplicationData\VMware\VMware Server\config.ini
  • Linux host = /etc/vmware/config
To set the delay start / stop time of the Virtual Devices use the following:
  • autoStart.defaultStartDelay= "300"
  • autoStart.defaultStopDelay= "300"
The value we set is in seconds; so 300 seconds would be 5 minutes.
To set the start and stop order of our Virtual Devices use:
  • autostart= "poweron"
  • autostart.order= "10”
  • Set  #1 to 10, #2 to 20….etc
  • autostop.order= "10"
  • Set  #1 to 10, #2 to 20….etc

8. Backing-Up Virtual Devices

As with any device, you want to make sure to back up your data. The simplest method is just to back up the Virtual Devices Host directory and if you need to restore — you just restore the files. However, you should never backup the Virtual devices files on the VMware Server host if the Virtual Device is powered on.
First, either suspend or shut down the virtual machine before backing up its directory. Attempting to back up a powered on Virtual Device can cause it to hang. ALos, be sure to test your backup method before implementing it.
If you can’t take your server down, or just want to back up data, treat the Virtual Device like any other device. Back it up by installing backup software and connecting to backup media.

No comments:

Post a Comment