Index: /trunk/include/VBox/settings.h
===================================================================
--- /trunk/include/VBox/settings.h	(revision 24135)
+++ /trunk/include/VBox/settings.h	(revision 24136)
@@ -397,4 +397,5 @@
 
     com::Utf8Str        strVersion;             // hardware version, optional
+    com::Guid           uuid;                   // hardware uuid, optional (null).
 
     bool                fHardwareVirt,
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 24135)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 24136)
@@ -237,5 +237,7 @@
                  "                            [--teleporterport <port>]\n"
                  "                            [--teleporteraddress <address|empty>\n"
-                 "                            [--teleporterpassword <password>]\n");
+                 "                            [--teleporterpassword <password>]\n"
+                 "                            [--hardwareuuid <uuid>]\n"
+                );
         RTPrintf("\n");
     }
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 24135)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 24136)
@@ -146,9 +146,9 @@
 
     BOOL accessible = FALSE;
-    CHECK_ERROR (machine, COMGETTER(Accessible) (&accessible));
-    CheckComRCReturnRC (rc);
+    CHECK_ERROR(machine, COMGETTER(Accessible)(&accessible));
+    CheckComRCReturnRC(rc);
 
     Bstr uuid;
-    rc = machine->COMGETTER(Id) (uuid.asOutParam());
+    rc = machine->COMGETTER(Id)(uuid.asOutParam());
 
     if (!accessible)
@@ -161,20 +161,20 @@
                 RTPrintf("name=\"<inaccessible>\"\n");
             else
-                RTPrintf ("Name:            <inaccessible!>\n");
+                RTPrintf("Name:            <inaccessible!>\n");
             if (details == VMINFO_MACHINEREADABLE)
-                RTPrintf ("UUID=\"%s\"\n", Utf8Str(uuid).raw());
-            else
-                RTPrintf ("UUID:            %s\n", Utf8Str(uuid).raw());
+                RTPrintf("UUID=\"%s\"\n", Utf8Str(uuid).raw());
+            else
+                RTPrintf("UUID:            %s\n", Utf8Str(uuid).raw());
             if (details != VMINFO_MACHINEREADABLE)
             {
                 Bstr settingsFilePath;
-                rc = machine->COMGETTER(SettingsFilePath) (settingsFilePath.asOutParam());
-                RTPrintf ("Config file:     %lS\n", settingsFilePath.raw());
+                rc = machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam());
+                RTPrintf("Config file:     %lS\n", settingsFilePath.raw());
                 ComPtr<IVirtualBoxErrorInfo> accessError;
-                rc = machine->COMGETTER(AccessError) (accessError.asOutParam());
-                RTPrintf ("Access error details:\n");
-                ErrorInfo ei (accessError);
+                rc = machine->COMGETTER(AccessError)(accessError.asOutParam());
+                RTPrintf("Access error details:\n");
+                ErrorInfo ei(accessError);
                 GluePrintErrorInfo(ei);
-                RTPrintf ("\n");
+                RTPrintf("\n");
             }
         }
@@ -218,4 +218,11 @@
     else
         RTPrintf("Config file:     %lS\n", settingsFilePath.raw());
+
+    Bstr strHardwareUuid;
+    rc = machine->COMGETTER(HardwareUUID)(strHardwareUuid.asOutParam());
+    if (details == VMINFO_MACHINEREADABLE)
+        RTPrintf("HardwareUUID=\"%s\"\n", strHardwareUuid.raw());
+    else
+        RTPrintf("Hardware UUID:   %lS\n", strHardwareUuid.raw());
 
     ULONG memorySize;
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	(revision 24135)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	(revision 24136)
@@ -126,5 +126,6 @@
     MODIFYVM_TELEPORTER_PORT,
     MODIFYVM_TELEPORTER_ADDRESS,
-    MODIFYVM_TELEPORTER_PASSWORD
+    MODIFYVM_TELEPORTER_PASSWORD,
+    MODIFYVM_HARDWARE_UUID
 };
 
@@ -201,4 +202,5 @@
     { "--teleporteraddress",        MODIFYVM_TELEPORTER_ADDRESS,        RTGETOPT_REQ_STRING },
     { "--teleporterpassword",       MODIFYVM_TELEPORTER_PASSWORD,       RTGETOPT_REQ_STRING },
+    { "--hardwareuuid",             MODIFYVM_HARDWARE_UUID,             RTGETOPT_REQ_STRING },
 };
 
@@ -1816,4 +1818,10 @@
             }
 
+            case MODIFYVM_HARDWARE_UUID:
+            {
+                CHECK_ERROR(machine, COMSETTER(HardwareUUID)(Bstr(ValueUnion.psz)));
+                break;
+            }
+
             default:
             {
Index: /trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 24135)
+++ /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 24136)
@@ -199,7 +199,7 @@
     hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());             H();
 
-    hrc = pMachine->COMGETTER(Id)(&str);                                            H();
-    Guid MachineUuid(str);
-    PCRTUUID pUuid = MachineUuid.raw();
+    hrc = pMachine->COMGETTER(HardwareUUID)(&str);                                  H();
+    RTUUID HardwareUuid;
+    rc = RTUuidFromUtf16(&HardwareUuid, str);                                       RC_CHECK();
     STR_FREE();
 
@@ -234,5 +234,5 @@
     hrc = pMachine->COMGETTER(Name)(&str);                                          H();
     rc = CFGMR3InsertStringW(pRoot, "Name",                 str);                   RC_CHECK();
-    rc = CFGMR3InsertBytes(pRoot,   "UUID", pUuid, sizeof(*pUuid));                 RC_CHECK();
+    rc = CFGMR3InsertBytes(pRoot,   "UUID", &HardwareUuid, sizeof(HardwareUuid));   RC_CHECK();
     rc = CFGMR3InsertInteger(pRoot, "RamSize",              cbRam);                 RC_CHECK();
     rc = CFGMR3InsertInteger(pRoot, "RamHoleSize",          cbRamHole);             RC_CHECK();
@@ -705,5 +705,5 @@
         rc = CFGMR3InsertInteger(pBiosCfg,  "IOAPIC",               fIOAPIC);           RC_CHECK();
         rc = CFGMR3InsertInteger(pBiosCfg,  "PXEDebug",             fPXEDebug);         RC_CHECK();
-        rc = CFGMR3InsertBytes(pBiosCfg,    "UUID", pUuid, sizeof(*pUuid));             RC_CHECK();
+        rc = CFGMR3InsertBytes(pBiosCfg,    "UUID", &HardwareUuid,sizeof(HardwareUuid));RC_CHECK();
 
         DeviceType_T bootDevice;
Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 24135)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 24136)
@@ -213,4 +213,5 @@
 
     if (mHWVersion != that.mHWVersion ||
+        mHardwareUUID != that.mHardwareUUID ||
         mMemorySize != that.mMemorySize ||
         mMemoryBalloonSize != that.mMemoryBalloonSize ||
@@ -988,4 +989,44 @@
     mHWData.backup();
     mHWData->mHWVersion = hwVersion;
+
+    return S_OK;
+}
+
+STDMETHODIMP Machine::COMGETTER(HardwareUUID)(BSTR *aUUID)
+{
+    CheckComArgOutPointerValid(aUUID);
+
+    AutoCaller autoCaller(this);
+    CheckComRCReturnRC(autoCaller.rc());
+
+    AutoReadLock alock(this);
+
+    if (!mHWData->mHardwareUUID.isEmpty())
+        mHWData->mHardwareUUID.toUtf16().cloneTo(aUUID);
+    else
+        mData->mUuid.toUtf16().cloneTo(aUUID);
+
+    return S_OK;
+}
+
+STDMETHODIMP Machine::COMSETTER(HardwareUUID) (IN_BSTR aUUID)
+{
+    Guid hardwareUUID(aUUID);
+    if (hardwareUUID.isEmpty())
+        return E_INVALIDARG;
+
+    AutoCaller autoCaller(this);
+    CheckComRCReturnRC(autoCaller.rc());
+
+    AutoWriteLock alock(this);
+
+    HRESULT rc = checkStateDependency(MutableStateDep);
+    CheckComRCReturnRC(rc);
+
+    mHWData.backup();
+    if (hardwareUUID == mData->mUuid)
+        mHWData->mHardwareUUID.clear();
+    else
+        mHWData->mHardwareUUID = hardwareUUID;
 
     return S_OK;
@@ -5304,4 +5345,5 @@
         /* The hardware version attribute (optional). */
         mHWData->mHWVersion = data.strVersion;
+        mHWData->mHardwareUUID = data.uuid;
 
         mHWData->mHWVirtExEnabled             = data.fHardwareVirt;
@@ -6251,4 +6293,5 @@
 
         data.strVersion = mHWData->mHWVersion;
+        data.uuid = mHWData->mHardwareUUID;
 
         // CPU
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 24135)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 24136)
@@ -4059,5 +4059,5 @@
   <interface
      name="IMachine" extends="$unknown"
-     uuid="db35f17a-179f-4332-91b2-a49d5cfb678c"
+     uuid="37642E74-969A-4590-BD52-390E541F904D"
      wsmap="managed"
      >
@@ -4236,4 +4236,14 @@
     </attribute>
 
+    <attribute name="hardwareUUID" type="uuid" mod="string">
+      <desc>
+        The UUID presented to the guest via memory tables, hardware and guest
+        properties.  For most VMs this is the same as the @a id, but for VMs
+        which have been cloned or teleported it may be the same as the source
+        VM.  This latter is because the guest shouldn't notice that it was
+        cloned or teleported.
+      </desc>
+    </attribute>
+
     <attribute name="CPUCount" type="unsigned long">
       <desc>Number of virtual CPUs in the VM.</desc>
@@ -11947,5 +11957,5 @@
     <attribute name="ports" type="wstring">
       <desc>
-        VRDP server port numbers. The server will try to bind to one of free ports from the list. 
+        VRDP server port numbers. The server will try to bind to one of free ports from the list.
         <note>
           This is a string of comma separated TCP port numbers or port number ranges.
Index: /trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MachineImpl.h	(revision 24135)
+++ /trunk/src/VBox/Main/include/MachineImpl.h	(revision 24136)
@@ -282,4 +282,5 @@
 
         Bstr           mHWVersion;
+        Guid           mHardwareUUID;   /**< If Null, use mData.mUuid. */
         ULONG          mMemorySize;
         ULONG          mMemoryBalloonSize;
@@ -521,4 +522,6 @@
     STDMETHOD(COMGETTER(HardwareVersion))(BSTR *aVersion);
     STDMETHOD(COMSETTER(HardwareVersion))(IN_BSTR aVersion);
+    STDMETHOD(COMGETTER(HardwareUUID))(BSTR *aUUID);
+    STDMETHOD(COMSETTER(HardwareUUID))(IN_BSTR aUUID);
     STDMETHOD(COMGETTER(MemorySize))(ULONG *memorySize);
     STDMETHOD(COMSETTER(MemorySize))(ULONG memorySize);
Index: /trunk/src/VBox/Main/xml/Settings.cpp
===================================================================
--- /trunk/src/VBox/Main/xml/Settings.cpp	(revision 24135)
+++ /trunk/src/VBox/Main/xml/Settings.cpp	(revision 24136)
@@ -1447,4 +1447,10 @@
             // defaults to 2 and is only written if != 2
 
+    Utf8Str strUUID;
+    if (elmHardware.getAttributeValue("uuid", strUUID))
+        parseUUID(hw.uuid, strUUID);
+    else
+        hw.uuid.clear();
+
     xml::NodesLoop nl1(elmHardware);
     const xml::ElementNode *pelmHwChild;
@@ -2330,4 +2336,6 @@
     if (hw.strVersion != "2")
         pelmHardware->setAttribute("version", hw.strVersion);
+    if (!hw.uuid.isEmpty())
+        pelmHardware->setAttribute("uuid", makeString(hw.uuid));
 
     xml::ElementNode *pelmCPU      = pelmHardware->createChild("CPU");
@@ -2896,4 +2904,8 @@
             )
        )
+        m->sv = SettingsVersion_v1_9;
+
+    if (    m->sv < SettingsVersion_v1_9
+        &&  !hardwareMachine.uuid.isEmpty())
         m->sv = SettingsVersion_v1_9;
 }
