Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup vbox profile location #6116

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

computezrmle
Copy link
Contributor

Recently there were a lot of comments and suggestions regarding where to locate the VirtualBox configuration files.

See:
#6015
#6016
#6018

This PR is intended to combine them into a working solution on Linux/MacOS/Windows.

Major objectives:

  1. use VirtualBox's default file locations where possible
  2. use a well defined file location if (1.) is not possible

(1.) mitigates a possible race between VirtualBox Manager (launched by the user) and BOINC VMs (launched via VBoxHeadless).
Since the first VirtualBox process that starts up for a distinct user determines which vbox profile is used, all of them should use the same vbox profile.
(1.) also ensures that an interactive user can monitor the running VMs, e.g. on Windows.

(2.) must be used in environments where BOINC has not enough permissions to access the default vbox profile location, e.g. from inside MacOS's sandbox.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@Crystal-Pellet
Copy link

Tested the Windows version of this PR and concluded that VirtualBox is using again the default Oracle VirtualBox location for its xml- and log-files.
Unnecessary .VirtualBox and/or VirtualBox directories are not longer created in BOINC's datadirectory.

So OK to this version of vboxwrapper.

@davidpanderson
Copy link
Contributor

Can you please also add comments (in vbox_common.h) for these fields:
string virtualbox_home_directory;
string virtualbox_scratch_directory;
string virtualbox_install_directory;
string virtualbox_guest_additions;

... saying what they're used for and how they're determined.

Also: I don't understand why these are elements of VBOX_BASE and not global vars.
(more generally I don't understand why we need VBOX_JOB, VBOX_VM, and VBOX_BASE at all.
But that's beyond the scope of this).

@computezrmle
Copy link
Contributor Author

Can you please also add comments (in vbox_common.h) for these fields:
string virtualbox_home_directory;
string virtualbox_scratch_directory;
string virtualbox_install_directory;
string virtualbox_guest_additions;

As for virtualbox_scratch_directory
This is unused, hence I removed it.

Added comments for the others.
These variables have been introduced more than a decade ago together with comments explaining what they are used for.
Over the years the original comments obviously got lost.

VBOX_JOB, VBOX_VM, and VBOX_BASE are also used for more than a decade.
Changing this should indeed not be the scope of this PR.

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.95%. Comparing base (ab9ae86) to head (4216226).
Report is 9 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6116      +/-   ##
============================================
- Coverage     11.96%   11.95%   -0.01%     
  Complexity     1068     1068              
============================================
  Files           278      278              
  Lines         36940    36938       -2     
  Branches       8529     8529              
============================================
- Hits           4419     4416       -3     
  Misses        32121    32121              
- Partials        400      401       +1     

see 1 file with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

4 participants