diff --git a/checkin_notes b/checkin_notes
index 4dc10a5ff0..3b37947299 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -713,3 +713,10 @@ David 18 Jan 2012
wap.inc
user/
userw.php
+
+Rom 18 Jan 2011
+ - VBOX: Use the documented way to reset the UUID of a virtual hard
+ disk. Thanks Daniel.
+
+ samples/vboxwrapper
+ vbox.cpp
diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp
index 75ec718cf4..34bc6e94a5 100644
--- a/samples/vboxwrapper/vbox.cpp
+++ b/samples/vboxwrapper/vbox.cpp
@@ -817,45 +817,11 @@ int VBOX_VM::register_vm() {
command += "--port 0 ";
command += "--device 0 ";
command += "--type hdd ";
+ command += "--setuuid \"\" ";
command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
- retval = vbm_popen(command, output, "storage attach (fixed disk)", false);
- if (retval) {
- // Is this an error condition we know how to handle?
-
- // Check to see if the Virtual HD UUID needs to be reset
- if ((output.find("E_INVALIDARG") != string::npos) && (output.find("already exists") != string::npos)) {
-
- command = "internalcommands ";
- command += "sethduuid \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
-
- retval = vbm_popen(command, output, "sethduuid");
- if (retval) return retval;
-
- // Now lets try to attach the Virtual HD
- command = "storageattach \"" + vm_name + "\" ";
- command += "--storagectl \"IDE Controller\" ";
- command += "--port 0 ";
- command += "--device 0 ";
- command += "--type hdd ";
- command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
-
- retval = vbm_popen(command, output, "storage attach (fixed disk)");
- if (retval) return retval;
-
- } else {
- fprintf(
- stderr,
- "%s Error in %s for VM: %d\nCommand:\n%s\nOutput:\n%s\n",
- boinc_msg_prefix(buf, sizeof(buf)),
- "storage attach (fixed disk)",
- retval,
- command.c_str(),
- output.c_str()
- );
- return retval;
- }
- }
+ retval = vbm_popen(command, output, "storage attach (fixed disk)");
+ if (retval) return retval;
// Adding virtual floppy disk drive to VM
//
diff --git a/win_build/vboxwrapper.vcproj b/win_build/vboxwrapper.vcproj
index 2401a3dec1..20a3158afd 100644
--- a/win_build/vboxwrapper.vcproj
+++ b/win_build/vboxwrapper.vcproj
@@ -81,13 +81,13 @@
@@ -182,13 +182,13 @@