10. Troubleshooting
10.4. Linux hosts
10.4.1. Linux kernel module refuses to load
If the VirtualBox kernel module (vboxdrv) refuses to load, i.e. you get an "Error inserting vboxdrv: Invalid argument", check (as root) the output of thedmesgcommand.
In 90% of all cases, this will exhibit a problem with Linux 2.6.19 and higher, and the message will be: "NMI watchdog active -- refused to load the kernel module! Please disable the NMI watchdog by specifying 'nmi_watchdog=0' at kernel command line."
Add this option to your grub configuration, reboot, and the module should load. Troubleshooting
10.4.2. Linux host's CD/DVD drive not found
If you have configured a virtual machine to use the host's CD/DVD drive, but this does not appear to work, make sure that the current user has permission to access the corresponding Linux device file (usually/dev/cdromor similar). On most distributions, the user must be added to a corresponding group (usually calledcdromorcdrw).
Also, if your CD/DVD device has a different name, VirtualBox may be unable to find it. On Linux hosts, VirtualBox performs the following steps to locate your CD/DVD drives:
1. VirtualBox examines if the environment variable VBOX_CDROM is defined (see below). If so, VirtualBox omits all the following checks.
2. VirtualBox tests if/dev/cdromworks.
3. In addition, VirtualBox checks if any CD/DVD drives are currently mounted by checking / etc/mtab.
4. In addition, VirtualBox checks if any of the entries in/etc/fstabpoint to CD/DVD devices. In other words, you can try to set VBOX_CDROM to contain a list of your CD/DVD devices, separ- ated by colons, for example as follows:
export VBOX_CDROM='/dev/cdrom0:/dev/cdrom1'
10.4.3. Linux host's floppy not found
The previous instructions (for CD/DVD drives) apply accordingly to floppy disks, except that Virtu- alBox tests for/dev/fd*devices by default. This can be overridden with theVBOX_FLOPPYenvir- onment variable.
10.4.4. Strange guest IDE error messages when writing to CD/
DVD
If the experimental CD/DVD writer support is enabled with an incorrect VirtualBox, host or guest configuration, it is possible that any attempt to access the CD/DVD writer fails and simply results in guest kernel error messages (for Linux guests) or application error messages (for Windows guests). VirtualBox performs the usual consistency checks when a VM is powered up (in particular it aborts with an error message if the device for the CD/DVD writer is not writable by the user starting the VM), but it cannot detect all misconfigurations. The necessary host and guest OS configuration is not specific for VirtualBox, but a few frequent problems are listed here which occurred in connec- tion with VirtualBox.
Special care must be taken to use the correct device. The configured host CD/DVD device file name (in most cases/dev/cdrom) must point to the device that allows writing to the CD/DVD unit. For CD/DVD writer units connected to a SCSI controller or to a IDE controller that interfaces to the Linux SCSI subsystem (common for some SATA controllers), this must refer to the SCSI device node (e.g./dev/scd0). Even for IDE CD/DVD writer units this must refer to the appropriate SCSI CD-ROM device node (e.g./dev/scd0) if theide-scsikernel module is loaded. This module is required for CD/DVD writer support with all Linux 2.4 kernels and some early 2.6 kernels. Many Linux distributions load this module whenever a CD/DVD writer is detected in the system, even if the kernel would support CD/DVD writers without the module. VirtualBox supports the use of IDE device files (e.g. /dev/hdc), provided the kernel supports this and the ide-scsimodule is not loaded.
Similar rules (except that within the guest the CD/DVD writer is always an IDE device) apply to the guest configuration. Since this setup is very common, it is likely that the default configuration of the guest works as expected.
10.4.5. VBoxSVC IPC issues
On Linux, VirtualBox makes use of a custom version of Mozilla XPCOM (cross platform compon- ent object model) for inter and intra process communication. The processVBoxSVCserves as a com- munication hub between different VirtualBox processes and maintains the global configuration, i.e. the XML database. When starting a VirtualBox component, the processesVBoxSVCandVirtual- BoxXPCOMIPCDare started automatically. They are only accessible from the user account they are running under. VBoxSVC owns the VirtualBox configuration database which normally resides in
~/.VirtualBox and while it is running, the configuration files are locked. Communication between the various VirtualBox components and VBoxSVC is performed through a local domain socket residing in/tmp/.vbox-<username>-ipc. In case there are communication problems (i.e. a VirtualBox application cannot communicate withVBoxSVC), terminate the daemons and remove the local domain socket directory.
10.4.6. USB not working
If USB is not working on your Linux host, make sure that the current user has permission to access the USB filesystem (usbfs), which VirtualBox relies on to retrieve valid information about your host's USB devices.
Asusbfsis a virtual filesystem, achmod on/proc/bus/usbhas no effect. The permissions for
usbfscan therefore only be changed by editing the/etc/fstabfile.
For example, most Linux distributions have a user group calledusbor similar, of which the current user must be a member. To give all users of that group access to usbfs, make sure the following line is present:
# 85 is the USB group
none /proc/bus/usb usbfs devgid=85,devmode=664 0 0
Replace 85 with the group ID that matches your system (search/etc/groupfor "usb" or similar). Alternatively, if you don't mind the security hole, give all users access to USB by changing "664" to "666".
The various distributions are very creative from which script the usbfs filesystem is mounted. Sometimes the command is hidden in unexpected places. For SuSE 10.0 the mount command is part of the udev configuration file/etc/udev/rules.d/50-udev.rules. As this distribution has no user group calledusb, you may e.g. use thevboxusersgroup which was created by the VirtualBox installer. Since group numbers are allocated dynamically, the following example uses 85 as a place- holder. Modify the line containing (a linebreak has been inserted to improve readability)
DEVPATH="/module/usbcore", ACTION=="add",
RUN+="/bin/mount -t usbfs usbfs /proc/bus/usb"
and add the necessary options (make sure that everything is in a single line):
DEVPATH="/module/usbcore", ACTION=="add",
RUN+="/bin/mount -t usbfs usbfs /proc/bus/usb -o devgid=85,devmode=664"
Debian Etch has the mount command in/etc/init.d/mountkernfs.sh. Since that distribution has no group usb, it is also the easiest solution to allow all members of the group vboxusers. Modify the line
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev
so that it contains
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=85,devmode=664
As usual, replace the 85 with the actual group number which should get access to USB devices. Other distributions do similar operations in scripts stored in the/etc/init.ddirectory.