Category Archives: Windows Server

VMware Performance Enhancing Tweaks (Over-the-Counter Solutions)

I have been using VMware virtualization for quite a few years now, and even though it is generally fast and reliable virtualization platform, it does require some extra tuning to improve its performance. Here is a brief collection of tweaks that I personally use on Windows and Mac OS to improve I/O performance of VMware virtual machines. These tweaks have become particularly useful in the past couple of years, with larger amounts of available RAM in computers and desire to reduce unnecessary write operations to SSD drives, such as memory swap files.

In order to apply these tweaks you need to add the following settings either to your virtual machine .VMX file, or if you like it globally then to VMware settings.ini file. Settings.ini file is located at “C:\ProgramData\VMware\VMware Workstation\” or “C:\Documents and Settings\All Users\VMware\VMware Workstation\” folders, depending on your operating system. VMware Fusion Config files are located in “/Users/username/Library/Preferences/VMware Fusion/preferences” and “/Users/username/Library/Preferences/VMware Fusion/config” folders.

Tweak: Disable memory swap files .vmem files

mainMem.useNamedFile = "FALSE"
Unfortunately this parameter does not work for VMware Player, as it always creates virtual machine’s full memory swap file.
For VMware Fusion on Mac and Linux instead of mainMem.useNamedFile you have to set mainMem.backing flag.
mainMem.backing = "swap"

Tweak: Choose the right disk controller and specify SSD

Instead of the latest SATA AHCI controller choose LSI Logic SAS controller with SCSI disk for Windows guest OS, or PVSCSI for other types of OS. Unfortunately SATA AHCI on VMware has the lowest performance out of the three controllers and highest CPU overhead (see the references on the topic at the end). In addition to choosing the right controller, if your host disk is SSD you can explicitly specify the disk type as SSD to guest OS.
scsi0:0.virtualSSD = 1

Tweak: Disable log files for VM

logging = "FALSE"
Alternatively you can specify a different location to store the log file, if you ever need them:
log.filename = "c:\Windows\Temp\vm1.log"

Tweak: Other Disk & Memory I/O Performance Optimization

Disable memory trimming:
MemTrimRate = "0"
Disable page sharing:
sched.mem.pshare.enable = "FALSE"
Disable scale down of memory allocation:
MemAllowAutoScaleDown = "FALSE"
Memory allocation configuration:
prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100" (optional)

Tweak: Disabling Snapshots

Disable snapshots if you are not using them and prefer full backups:
snapshot.disabled = "TRUE"

Tweak: Disable Unity Mode

Unity might be a great feature for running virtual desktops operating systems, but it is not the most useful for virtualizing server OS. An annoying sign of enabled unity is GuestAppsCache or caches folder with a large number of files and subfolders. In order to disable it for your VM add the following lines:
isolation.tools.unity.disable = "TRUE"
unity.allowCompositingInGuest = "FALSE"
unity.enableLaunchMenu = "FALSE"
unity.showBadges = "FALSE"
unity.showBorders = "FALSE"
unity.wasCapable = "FALSE"

Tweak: MacBook Retina Display Optimization

Disable automatic fitting to window:
pref.autoFitGuestToWindow = "FALSE"
Set a different resolution (or in user interface select VM – Settings – Display – uncheck ‘Use full resolution for Retina display’):
gui.applyHostDisplayScalingToGuest = "FALSE"
When in full-screen mode, there is a couple of options to control how guest is rendered:
pref.autoFitFullScreen = "stretchGuestToHost" or pref.autoFitFullScreen = "fitHostToGuest"

References:

Moving Browser Cache Folder in IE, Firefox, Chrome, Opera, and Safari

Having recently replaced OS partition hard-drives with solid-state drives on my desktop and two laptops, I decided to tweak a few settings on my Windows in order to reduce the number of unnecessary write operations to SSD. Amongst the candidates for the move from more expensive SSD space to spinning hard-drives, I selected temporary Windows folder and browsers cache folders. Moving temporary Windows folder turned out to be one step operation – changing Environment variables in Computer – Advanced system settings dialog.

However, after this quick success moving my browsers cache away from SSD turned out to be not the most trivial task due to a large number of different browsers and their very different approach to storing configuration settings. Here is my experience and instructions on how to do it in various browsers.

Internet Explorer:

IE offers the easiest and most convenient way to change a new folder for cache.

Tools – Internet Options – under ‘Browsing History’ section choose ‘Settings’
Click ‘Move folder…’ and provide the new location, e.g. d:\Temp\IE

Heads up: After providing a new temp folder and clicking OK to save new settings, IE/Windows forcefully closes current user session, and logs the user off.

Firefox:

In the URL type: about:config
Create a new string preference: browser.cache.disk.parent_directory
and specify a path to your cache folder, e.g.: d:\Temp\Firefox

Mozilla Zine: Browser.cache.disk.parent directory

Chrome:

The only way to change location of the cache folder is through the command prompt arguments (UPDATED):

C:\…\Application\chrome.exe --user-data-dir=d:\Temp\Chrome
Chrome deprecated previous disk-cache-dir command, and the only way to move cache folder is to do it along with the rest of profile information. Reference: User Data Directory.

C:\…\Application\chrome.exe --disk-cache-dir=”d:\Temp\Chrome” --disk-cache-size=75000000
Where --disk-cache-dir points to your custom cache folder, and –disk-cache-size specifies the maximum cache size in bytes.

Here is a full list of Chrome’s command line switcheshttp://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc. Surprisingly, source code seems to be the only official documentation from Google. A brief blog post on the same topic: http://peter.sh/experiments/chromium-command-line-switches/.

Another useful command for Chrome, which reduces its memory footprint: --process-per-site. This command allows Chrome to run tabs from the same domain in the same process, thus reducing number of spun out processes and memory use, while still offering process isolation. http://www.chromium.org/developers/design-documents/process-models.

Even though Chrome has configuration page similar to FireFox (type about:flags in the browser URL), it does not allow changing its cache configuration.

How to Turn On/ Disable GPU Hardware Acceleration on Google Chrome.

Opera:

Review the location of the current cache folder by typing in the URL: opera:about or from Menu – Help – About Opera.

To modify the settings type the URL: opera:config

Navigate to “User Prefs” tab and modify its cache folder: Cache Directory4 =d:\Temp\Opera\
(alternative quick jump link: opera:config#UserPrefs|CacheDirectory4)

Additionally you can modify temporary download folder for Opera as well, through another key:
Temporary Download Directory = d:\Temp\Opera

Opera’s Settings File Explained

UPDATE: The latest versions of Opera do not provide that user input functionality, but instead you have to use command line parameter: –disk-cache-dir=d:\path

Safari:

Safari unfortunately does not allow changing the location of its cache directory, just like it does not allow changing any of its advanced settings in a comprehensive way.

about URI scheme

Deleting GTP and EFI Partitions on Windows 7/Server 2008/Vista

If you are trying to delete GTP or EFI partition on your hard drive under Windows Server 2008/7/Vista using management console are you out of luck. However, here is the easiest way to get around it:

Start command prompt and run diskpart.exe in command prompt issuing these commands as per illustration below:
d:\path>diskpart.exe
DISKPART> list disk
DISKPART> select disk x
DISKPART> clean

Please note, the reason for using ‘clean’ command instead of ‘delete volume’ is that ‘delete volume’ crashes diskpart utility when attempting to delete GTP/EFI partitions. Also outdated diskpar.exe utilitiy, which is frequently used for aligning physical partitions and is still quite popular for SSD optimization, cannot even read disk layout containing GTP or EFI partitions.



Great post: How to Delete GPT Partition or EFI from Mac Hard Disks In Vista or XP
Reference: A Description of the Diskpart Command-Line Utility
Diskpar & Diskpart in server environment: Disk Partitioning Offset
Disk partitioning Alignment: Disk Partition Alignment Best Practices for SQL Server
SSD Optimization guide: OCZ Technology Forum

Converting Physical x64 Machine to Virtual (Windows 7/Server 2008 R2): Microsoft – 1 : VMware – 0

Being an old fan of VMware products (in particular, the fact that I can run VMware VMs on my MacBook, as well as on Wintel desktop), I found myself utterly disappointed this week, when I tried to convert my physical Windows Server 2008 R2 x64 into a virtual instance.

The latest version of VMware Converter kept crashing on me at the start of the conversion process with the error: “Unable to create a VSS snapshot of the source volume(s).”
More disappointingly, even according to press releases VMware vCenter Converter – the latest and greatest version of VMware Converter, officially doesn’t support Windows 7 or Windows Server 2008 R2 editions (its latest version at the moment is 4.0.1 and dated 2009-12-08).

After a few failed attempts with VMware, I decided to look at Microsoft offerings. Even though, I couldn’t find an official Microsoft converter product, I found something better – a Sysinternals utility Disk2vhd, which can create a virtual hard disk (VHD) out of running physical image.

The most impressive part that the whole process of converting my running 60G RAID-0 hard drive array took only a couple of minutes, with minimal configuration effort – no heavy installation or complex user-interface interactions. All I had to do is select a check box with the volume(s), which needs to be converted and that’s it. Systinternals delivered an impressive utility once again! Kudos to Microsoft for keeping Sysinternals brand alive and bringing new useful tools.

Links: