= How to create a core dump on Linux = A core dump is very useful for helping us tracking down crashes of !VirtualBox. The procedure is similar on most Linux systems, but on Ubuntu it is slightly different due to the Ubuntu crash reporting tool (Apport). == To create a core dump on an Ubuntu system == create a file called ".config/apport/settings" in your home directory with the contents {{{ [main] unpackaged=true }}} and run !VirtualBox. Any crashes of !VirtualBox after you have created the file will cause a crash report to be created in /var/crash with a name like "_usr_lib_virtualbox_VirtualBox.1000.crash". Do not accept the offer to "send a crash report to Launchpad". You can access the core file using the "apport-unpack" tool, or just send us the full crash report file. To stop crash files being created for non-system applications delete the file that you created again. == To create a core dump on non-Ubuntu systems == start !VirtualBox from a command line (e.g. xterm): {{{ $ ulimit -c unlimited $ sudo su # echo -n 1 > /proc/sys/kernel/core_uses_pid # echo -n 1 > /proc/sys/fs/suid_dumpable # exit $ VirtualBox }}} or better start the VM directly: {{{ $ ulimit -c unlimited $ sudo su # echo -n 1 > /proc/sys/kernel/core_uses_pid # echo -n 1 > /proc/sys/fs/suid_dumpable # exit $ /usr/lib/virtualbox/VirtualBox -startvm VM_NAME }}} Ensure that '''no''' startup script (`~/.bashrc`, `~/.bash_profile`, `~/.profile`) contains an instruction like `ulimit -c 0` as the limit cannot be increased once it was set to zero. Starting with version 2.0.0, the !VirtualBox processes are started `suid root`, that is, with permissions to do things that "normal" applications cannot. This is the reason for the {{{ $ sudo su $ echo -n 1 > /proc/sys/fs/suid_dumpable $ exit }}} before starting the VM/GUI (note that `sudo echo` will not do what we want here). When !VirtualBox or one of its processes crashes, a file core. is created in the current directory. Be aware that core dumps can be very huge. Please compress the file before submitting it to a bug report. Or better don't attach the file to a report. Note that this core dump can contain a memory dump of your guest which can include sensitive information. Send it to frank _dot_ mehnert _at_ oracle _dot_ com if the compressed file is smaller than 5MB. Upload it to ftp.oracle.com:/appsdev/incoming and contact me directly otherwise to tell me the file name of the uploaded core dump. If several core files are created, you can check which process created them using the command {{{ $ file core. }}} to be sure of the right one to send. = How to create dumps on Mac OS X = To create a core dump on Mac OS X, start !VirtualBox from a command line: {{{ $ ulimit -c unlimited $ VirtualBox }}} or better start the VM directly: {{{ $ ulimit -c unlimited $ /Applications/VirtualBox.app/Contents/MacOS/VirtualBox -startvm VM_NAME }}} Ensure that '''no''' startup script (`~/.bashrc`, `~/.bash_profile`, `~/.profile`) contains an instruction like `ulimit -c 0` as the limit cannot be increased once it was set to zero. Alternatively (for Finder & launchpad) {{{ $ launchctl limit core unlimited }}} or for permanent effect the same could be specified in $HOME/.launchd.conf or /etc/launchd.conf. The core files can be found in the /cores folder. = How to create dumps on Solaris = To get core on Solaris host run the following command as root {{{ # coreadm -g /var/cores/core.%f.%p -i core.%f.%p \ -e global -e process -e global-setid -e proc-setid -e log }}} The cores will now be placed in /var/cores/ folder with the global dumps will go into /var/crash/ System core dumps need to be enabled via dumpadm. The important thing is to have "Savecore enabled" to "yes" (use `dumpadm -y`). The config. should look something like this: {{{ # dumpadm Dump content: kernel pages Dump device: /dev/zvol/dsk/rpool/dump (dedicated) Savecore directory: /var/crash/myhostname Savecore enabled: yes Save compressed: on }}} = Forcing !VirtualBox to terminate with a core dump = Sometimes it is required to force a !VirtualBox process to terminate, for example, a VM hangs for some unknown reason. On Linux, this can be done as follows: {{{ $ ulimit -c unlimited $ sudo echo -n 1 > /proc/sys/fs/suid_dumpable $ /usr/lib/virtualbox/VirtualBox -startvm VM_NAME & $ pidof VirtualBox 7145 $ kill -4 7145 }}} As an alternative to ''kill'' you can do {{{ $ pidof VirtualBox 7145 $ gcore 7145 }}} On Mac OS X: {{{ $ ulimit -c unlimited $ /Applications/VirtualBox.app/Contents/MacOS/VirtualBox -startvm VM_NAME & $ ps aux|grep VirtualBox ... 7145 ... VirtualBox ... $ kill -4 7145 }}} On Solaris: {{{ # ulimit -c unlimited # /opt/VirtualBox/amd64/bin/VirtualBox -startvm VM_NAME & # ps -ef|grep VirtualBox ... 7145 ... VirtualBox ... # kill -4 7145 }}} You can find result core file according location specified in coreadm {{{ # coreadm }}} Passing the signal number 4 (`SIGILL`) is essential! The same applies to the alternative frontends `VBoxHeadless` and `VBoxSDL`. = Minidumps on Windows = Please visit this [http://support.microsoft.com/kb/315263 Microsoft site] for more details about minidumps[[BR]] Please visit the [http://blogs.technet.com/askperf/archive/2007/06/15/capturing-application-crash-dumps.aspx Microsoft Performance Team blog] for more details about Application crash dumps = User mode crash dumps on Windows Vista and Windows 7 = The section '''To collect user-mode dumps''' of the [http://support.microsoft.com/kb/315263 Microsoft site] explains how to enable user mode dumps on Windows Vista and Windows 7[[BR]] More detailed information about collecting user-mode dumps is available on the [http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx MSDN site]