The Machine Folder
By default, each virtual machine has a directory on your host
computer where all the files of that machine are stored: the XML
settings file, with a .vbox file extension,
and its disk images. This is called the machine
folder.
By default, this machine folder is located in a common folder
called VirtualBox VMs, which
creates in the current system user's home directory. The
location of this home directory depends on the conventions of
the host operating system, as follows:
-
On Windows, this is the location returned by the
SHGetFolderPath function of the Windows
system library Shell32.dll, asking for the user profile. A
typical location is
C:\Users\username
.
-
On Linux, macOS, and Oracle Solaris, this is generally
taken from the environment variable
$HOME, except for the user
root where it is taken from the account
database. This is a workaround for the frequent trouble
caused by users using in combination with the
tool sudo, which by default does not
reset the environment variable $HOME.
A typical location on Linux and Oracle Solaris is
/home/username
and on macOS is
/Users/username
.
For simplicity, we abbreviate the location of the home directory
as $HOME. Using that convention, the common
folder for all virtual machines is $HOME/VirtualBox
VMs.
As an example, when you create a virtual machine called Example VM, creates the following:
-
A machine folder: $HOME/VirtualBox VMs/Example
VM/
-
In the machine folder, a settings file: Example
VM.vbox
-
In the machine folder, a virtual disk image:
Example VM.vdi.
This is the default layout if you use the
Create New Virtual Machine
wizard described in Creating Your First Virtual Machine. Once you
start working with the VM, additional files are added. Log files
are in a subfolder called Logs, and if you
have taken snapshots, they are in a
Snapshots subfolder. For each VM, you can
change the location of its snapshots folder in the VM settings.
You can change the default machine folder by selecting Preferences
from the File menu in the main window. Then, in the displayed
window, click the General tab. Alternatively, use the
VBoxManage setproperty machinefolder command. See VBoxManage setproperty.