5.7. Linux Hosts

5.7.1. Linux Kernel Module Refuses to Load

If the Oracle VM VirtualBox kernel module, vboxdrv, refuses to load you may see an Error inserting vboxdrv: Invalid argument message. As root, check the output of the dmesg command to find out why the load failed. Most probably the kernel disagrees with the version of gcc used to compile the module. Make sure that you use the same compiler that was used to build the kernel.

5.7.2. Linux Host CD or DVD Drive Not Found

If you have configured a virtual machine to use the host's CD or DVD drive, but this does not appear to work, make sure that the current user has permission to access the corresponding Linux device file. This is /dev/hdc, /dev/scd0, /dev/cdrom or similar. On most distributions, the user must be added to a corresponding group, usually called cdrom or cdrw.

5.7.3. Linux Host CD or DVD Drive Not Found (Older Distributions)

On older Linux distributions, if your CD or DVD device has a different name, Oracle VM VirtualBox may be unable to find it. On older Linux hosts, Oracle VM VirtualBox performs the following steps to locate your CD or DVD drives:

  1. Oracle VM VirtualBox checks if the environment variable VBOX_CDROM is defined. If so, Oracle VM VirtualBox omits all the following checks.

  2. Oracle VM VirtualBox tests if /dev/cdrom works.

  3. Oracle VM VirtualBox checks if any CD or DVD drives are currently mounted by checking /etc/mtab.

  4. Oracle VM VirtualBox checks if any of the entries in /etc/fstab point to CD or DVD devices.

You can set the VBOX_CDROM environment variable to contain a list of your CD or DVD devices, separated by colons. For example:

export VBOX_CDROM='/dev/cdrom0:/dev/cdrom1'

On modern Linux distributions, Oracle VM VirtualBox uses the hardware abstraction layer (HAL) to locate CD and DVD hardware.

5.7.4. Linux Host Floppy Not Found

Section 5.7.3, “Linux Host CD or DVD Drive Not Found (Older Distributions)” appplies also to floppy disks, except that on older distributions Oracle VM VirtualBox tests for /dev/fd* devices by default. This can be overridden with the VBOX_FLOPPY environment variable.

5.7.5. Strange Guest IDE Error Messages When Writing to CD or DVD

If the experimental CD or DVD writer support is enabled with an incorrect Oracle VM VirtualBox, host or guest configuration, it is possible that any attempt to access the CD or DVD writer fails and simply results in guest kernel error messages for Linux guests or application error messages for Windows guests. Oracle VM 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 or DVD writer is not writable by the user starting the VM. But Oracle VM VirtualBox cannot detect all misconfigurations. The necessary host and guest OS configuration is not specific for Oracle VM VirtualBox, but a few frequent problems are listed here which occurred in connection with Oracle VM VirtualBox.

Special care must be taken to use the correct device. The configured host CD or DVD device file name, in most cases /dev/cdrom, must point to the device that allows writing to the CD or DVD unit. For CD or 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, such as /dev/scd0. Even for IDE CD or DVD writer units this must refer to the appropriate SCSI CD-ROM device node, such as /dev/scd0, if the ide-scsi kernel module is loaded. This module is required for CD or DVD writer support with some early 2.6 kernels. Many Linux distributions load this module whenever a CD or DVD writer is detected in the system, even if the kernel would support CD or DVD writers without the module. Oracle VM VirtualBox supports the use of IDE device files, such as /dev/hdc, provided the kernel supports this and the ide-scsi module is not loaded.

Similar rules, except that within the guest the CD or 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.

5.7.6. VBoxSVC IPC Issues

On Linux, Oracle VM VirtualBox makes use of a custom version of Mozilla XPCOM (cross platform component object model) for interprocess and intraprocess communication (IPC). The process VBoxSVC serves as a communication hub between different Oracle VM VirtualBox processes and maintains the global configuration, such as the XML database. When starting an Oracle VM VirtualBox component, the processes VBoxSVC and VBoxXPCOMIPCD are started automatically. They are only accessible from the user account they are running under. VBoxSVC owns the Oracle VM VirtualBox configuration database which normally resides in ~/.config/VirtualBox, or the appropriate configuration directory for your operating system. While it is running, the configuration files are locked. Communication between the various Oracle VM VirtualBox components and VBoxSVC is performed through a local domain socket residing in /tmp/.vbox-username-ipc. In case there are communication problems, such as an Oracle VM VirtualBox application cannot communicate with VBoxSVC, terminate the daemons and remove the local domain socket directory.

5.7.7. USB Not Working

If USB is not working on your Linux host, make sure that the current user is a member of the vboxusers group. Please keep in mind that group membership does not take effect immediately but rather at the next login. If available, the newgrp command may avoid the need for a logout and login.

5.7.8. PAX/grsec Kernels

Linux kernels including the grsec patch, see http://www.grsecurity.net/, and derivates have to disable PAX_MPROTECT for the VBox binaries to be able to start a VM. The reason is that Oracle VM VirtualBox has to create executable code on anonymous memory.

5.7.9. Linux Kernel vmalloc Pool Exhausted

When running a large number of VMs with a lot of RAM on a Linux system, say 20 VMs with 1 GB of RAM each, additional VMs might fail to start with a kernel error saying that the vmalloc pool is exhausted and should be extended. The error message also tells you to specify vmalloc=256MB in your kernel parameter list. If adding this parameter to your GRUB or LILO configuration makes the kernel fail to boot, with an error message such as failed to mount the root partition, then you have probably run into a memory conflict of your kernel and initial RAM disk. This can be solved by adding the following parameter to your GRUB configuration:

uppermem 524288