From cfafee2020846aeb307235c5bfe2d84a08e9632e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 22 Jan 2025 13:14:40 -0800 Subject: [PATCH] vboxwrapper: actually create the 'virtualbox home directory' As far as I can tell this dir is used only on Win; we run VBoxSVC.exe there, and look for a log file later. Should we remove it for other platforms? Also: there's some code to create a 'scratch' dir, projects/scratch. This seems like a bad idea; we shouldn't put random stuff in projects/, and also if there are multiple VM jobs they share the same dir. Should we get rid of this? --- samples/vboxwrapper/vbox_vboxmanage.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp index 1a0068d936..5ff09505bb 100644 --- a/samples/vboxwrapper/vbox_vboxmanage.cpp +++ b/samples/vboxwrapper/vbox_vboxmanage.cpp @@ -101,14 +101,20 @@ int VBOX_VM::initialize() { #endif // Determine the 'VirtualBox home directory'. + // On Windows, we run VboxSVC.exe in this directory, + // and we look for its log file there. + // On other platforms I don't think this is used. + // // NOTE: I'm not sure this is relevant; see // https://docs.oracle.com/en/virtualization/virtualbox/6.1/admin/TechnicalBackground.html#3.1.3.-Summary-of-Configuration-Data-Locations // if (getenv("VBOX_USER_HOME")) { virtualbox_home_directory = getenv("VBOX_USER_HOME"); } else { - // If the override environment variable isn't specified then - // it is based of the current users HOME directory. + // If not specified by environment variable then create it + // Win, Linux: under user home dir + // Mac: in BOINC data dir + // const char *home; #ifdef _WIN32 home = getenv("USERPROFILE"); @@ -126,6 +132,7 @@ int VBOX_VM::initialize() { #endif virtualbox_home_directory = home; virtualbox_home_directory += "/.VirtualBox"; + boinc_mkdir(virtualbox_home_directory.c_str()); } #ifdef _WIN32