Skip to content

Commit

Permalink
vboxwrapper: actually create the 'virtualbox home directory'
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
davidpanderson committed Jan 22, 2025
1 parent df43b3f commit cfafee2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions samples/vboxwrapper/vbox_vboxmanage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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
Expand Down

0 comments on commit cfafee2

Please sign in to comment.