title: Getting CPU ID on virtual machine
body: <p>I am trying to use this code:</p>
  
  <pre><code>public string GetCPUId()
  {
      string cpuInfo = String.Empty;
      string temp = String.Empty;
      ManagementClass mc = new ManagementClass("Win32_Processor");
      ManagementObjectCollection moc = mc.GetInstances();
      foreach (ManagementObject mo in moc)
      {
          if (cpuInfo == String.Empty)
          {
              cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
          }
      }
      return cpuInfo;
  }
  </code></pre>
  
  <p>To get a hw uid on a XP virtual machine (virtualbox), but I am only getting a messagebox that says:</p>
  
  <pre><code>Object reference not set to an instance of an object.
  </code></pre>
  
  <p>Is it because it's a virtual machine or what?</p>