Oracle VM VirtualBox is capable of producing its own core files for extensive debugging when things go wrong. Currently this is only available on Oracle Solaris hosts.
The Oracle VM VirtualBox CoreDumper can be enabled using the following command:
$ VBoxManage setextradata VM-name
VBoxInternal2/CoreDumpEnabled 1
You can specify which directory to use for core dumps with this command, as follows:
$ VBoxManage setextradataVM-name
VBoxInternal2/CoreDumpDirpath-to-directory
Make sure the directory you specify is on a volume with sufficient free space and that the Oracle VM VirtualBox process has sufficient permissions to write files to this directory. If you skip this command and do not specify any core dump directory, the current directory of the Oracle VM VirtualBox executable will be used. This would most likely fail when writing cores as they are protected with root permissions. It is recommended you explicitly set a core dump directory.
You must specify when the Oracle VM VirtualBox CoreDumper should be triggered. This is done using the following commands:
$ VBoxManage setextradataVM-name
VBoxInternal2/CoreDumpReplaceSystemDump 1 $ VBoxManage setextradataVM-name
VBoxInternal2/CoreDumpLive 1
At least one of the above two commands will have to be provided if you have enabled the Oracle VM VirtualBox CoreDumper.
Setting CoreDumpReplaceSystemDump
sets up the
VM to override the host's core dumping mechanism and in the event
of any crash only the Oracle VM VirtualBox CoreDumper would produce the
core file.
Setting CoreDumpLive
sets up the VM to produce
cores whenever the VM process receives a
SIGUSR2
signal. After producing the core file,
the VM will not be terminated and will continue to run. You can
thus take cores of the VM process using the following command:
$ kill -s SIGUSR2 VM-process-id
The Oracle VM VirtualBox CoreDumper creates core files of the form
core.vb.
such as process-name
.process-ID
core.vb.VBoxHeadless.11321
.