diff --git a/samples/vboxwrapper/vbox_mscom_impl.cpp b/samples/vboxwrapper/vbox_mscom_impl.cpp index 74ba4ef5451dba663a94656cae016de3db3ae691..a00161cc136251289558819423ef50e4e59a7d1b 100644 --- a/samples/vboxwrapper/vbox_mscom_impl.cpp +++ b/samples/vboxwrapper/vbox_mscom_impl.cpp @@ -833,7 +833,11 @@ int VBOX_VM::create_vm() { TRUE ); if (CHECK_ERROR(rc)) goto CLEANUP; + } + // Enable the scratch folder if a scratch folder is specified. + // + if (enable_scratch_directory) { vboxlog_msg("Enabling scratch shared directory for VM."); rc = pMachine->CreateSharedFolder( CComBSTR("scratch"), @@ -844,6 +848,7 @@ int VBOX_VM::create_vm() { if (CHECK_ERROR(rc)) goto CLEANUP; } + CLEANUP: if (pMachine) { pMachine->SaveSettings(); diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp index 2d2849c8f551b7b7059d7192c4633f777bdb266c..c6906a831641b8a84649861c0d2f0983343524ff 100644 --- a/samples/vboxwrapper/vbox_vboxmanage.cpp +++ b/samples/vboxwrapper/vbox_vboxmanage.cpp @@ -611,7 +611,7 @@ int VBOX_VM::create_vm() { } } - // Enable the shared folders if a shared folder is specified. + // Enable the shared folder if a shared folder is specified. // if (enable_shared_directory) { vboxlog_msg("Enabling shared directory for VM."); @@ -621,7 +621,11 @@ int VBOX_VM::create_vm() { retval = vbm_popen(command, output, "enable shared dir"); if (retval) return retval; + } + // Enable the scratch folder if a scratch folder is specified. + // + if (enable_scratch_directory) { vboxlog_msg("Enabling scratch shared directory for VM."); command = "sharedfolder add \"" + vm_name + "\" "; command += "--name \"scratch\" "; diff --git a/samples/vboxwrapper/vboxjob.cpp b/samples/vboxwrapper/vboxjob.cpp index 156d5a716c7b07fbaaf4e9afcd235c2dfd09f3a8..0c0c44120921ce88f8fbe136b8ad7b55d6f26a62 100644 --- a/samples/vboxwrapper/vboxjob.cpp +++ b/samples/vboxwrapper/vboxjob.cpp @@ -109,6 +109,7 @@ void VBOX_JOB::clear() { temporary_exit_trigger_file.clear(); enable_cern_dataformat = false; enable_shared_directory = false; + enable_scratch_directory = false; enable_floppyio = false; enable_cache_disk = false; enable_isocontextualization = false; @@ -164,6 +165,7 @@ int VBOX_JOB::parse() { else if (xp.parse_bool("enable_network", enable_network)) continue; else if (xp.parse_bool("network_bridged_mode", network_bridged_mode)) continue; else if (xp.parse_bool("enable_shared_directory", enable_shared_directory)) continue; + else if (xp.parse_bool("enable_scratch_directory", enable_scratch_directory)) continue; else if (xp.parse_bool("enable_floppyio", enable_floppyio)) continue; else if (xp.parse_bool("enable_cache_disk", enable_cache_disk)) continue; else if (xp.parse_bool("enable_isocontextualization", enable_isocontextualization)) continue; diff --git a/samples/vboxwrapper/vboxjob.h b/samples/vboxwrapper/vboxjob.h index ff9d690d1b7ca364b935dd40d16112782439e430..5dd7bf5d95a7c608b99c6fd73410696f80c53538 100644 --- a/samples/vboxwrapper/vboxjob.h +++ b/samples/vboxwrapper/vboxjob.h @@ -89,6 +89,9 @@ public: // whether to use shared directory infrastructure bool enable_shared_directory; + // whether to use scratch directory infrastructure + bool enable_scratch_directory; + // whether to use floppy io infrastructure bool enable_floppyio;