Friday, February 24, 2012

VMware Player – performance settings

Virtual machine on USB or other slow storage device runs slowly http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1620

A couple of settings that might improve performance of a virtual machine running in VMware Player – changes go into the .vmx file, make sure that it’s shutdown first otherwise they will be removed when you shutdown the VM.

The first setting makes it stop creating the .vmem file on disk – before the change you can actually see it’s a memory mapped file using RAMMap from Sysinternals.
mainMem.useNamedFile=FALSE

The second set makes the VM pre-allocate the configured amount of RAM at start-up, rather than dynamically expand as needed - change visible in Process Explorer.
sched.mem.pshare.enable = "FALSE"
MemTrimRate = 0
prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100"

Microsoft SQL Server Compact - connection string parameters

SqlCeConnection.ConnectionString Property
http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlceconnection.connectionstring(v=vs.100).aspx

using System;
using System.Data.Entity;
using System.IO;
using System.Data.Entity.Infrastructure;
  
namespace WindowsFormsApplication1
{
    public class DatabaseContext : System.Data.Entity.DbContext
    {
        public DatabaseContext() : base(DatabaseContext.ConnectionString)
        {
            Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
        }
  
        public static string ConnectionString
        {
            get
            {
                return String.Format(@"Data Source={0}\database.sdf;Max Database Size={1};Max Buffer Size={2}", 
                                    Path.GetTempPath(), 1024, 16384);
            }
        }
  
        [...]
    }
}

Sunday, February 19, 2012

Kernrate Viewer, VMware Player, Intelppm

Reading this article on high CPU spikes on Mark Russinovich’s blog the other day found about Kernrate Viewer, coming very handy when looking at some high kernel times today on a Windows XP (x32) VM running locally in VMware Player 4.




A quick search found this article on Virtual PC Guy's blog – setting the two registry keys from 1 to 4 seems to have somewhat solved the problem, although now “hal” is showing quite high, I might need to look into that a little further...

Update 28 March 2012

You may find that after the registry change that vmware-vmx.exe will exhibit constant high CPU consumption on the host system, in which case you might want to revert back to the default registry values.

Friday, February 3, 2012

You have an incorrect version of driver "vmx86.sys". Try reinstalling VMware Player.

Just got this problem trying to run a Windows XP image (x86) on Windows 8 Developer Preview (x64) with User Account Enabled (although I’m pretty sure the same happens to any other x64 system with UAC enabled).

Could not get vmx86 driver version: The handle is invalid.

You have an incorrect version of driver "vmx86.sys". Try reinstalling VMware Player.

Failed to initialize monitor device.

Found this KB from WMware and this thread, and the solution is to run VMplayer as Administrator (the first thing that should’ve popped to mind, but didn’t). VMware Player should’ve asked for elevation on its own, but I guess that’s a different discussion…

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2006883

http://communities.vmware.com/message/1137846

* * *

Personally I’ve changed the properties of the pinned VMware Player icon in my task bar:

  • SHIFT + right click on the icon > Properties
  • Advanced button
  • check “Run as administrator” > OK

image

image