VirtualBox errors - (sh*t happens)

VirtualBox only shows 1 virtual monitor for my dual-screen VM

Situation :

Here's my setup :

Details :

Let's see what happens in the VM :

I forgot to capture the exact output at that time, but it said something like :
(some Xrandr chitchat)
screen1Name					not the usual / expected VGA-0 (or DVI-0)
	(list of supported resolutions)
	
	
	
						no 2nd screen is listed : only 1 "virtual" monitor is connected to the VM
Looks like this is related / caused by VirtualBox itself.

VM display settings in VirtualBox :

  • In the VM configuration, the Display page complains :
    Invalid parameter detected
  • If I switch the Graphic controller select box from VBoxVGA to VMSVGA, the error message disappears but at the next boot, the VM still has only 1 monitor.
  • Looks like the "good" value is VBoxVGA anyway.

Solution :

Round 1 :
select VBoxVGA
after clicking "ok", the value was silently changed back to VMSVGA
to workaround this, select VBoxVGA, then select another settings page, then "ok"

https://forums.virtualbox.org/viewtopic.php?t=93941

==========================================8<=========================================================
Round 2 :
Had the problem again, and the "solution" above did not fix it. But I've learnt some new things :
 - if Virtualbox displays only 1 virtual monitor (instead of 2), it's still possible to "force" it to display the 2nd monitor : in the 1st virtual monitor window, select Monitor in the top menu, then "Virtual screen 2 | Enable"
	==> at least both displays are back
 - I've tried other values for the Graphic controller :
	- I confirm no specific value fixes the "only 1 screen" issue (I must have been lucky in the round 1)
	- no idea whether VBoxVGA is better or not than any other value (needs further tests ;-). So whatever value worked before : keep it ;-)

Linux guest additions installer not found --try to start them manually. while trying to install Guest Additions

Situation :

Solution :

I tried different commands which finally worked, don't know which one was THE solution (or maybe it's a combination...) :

VirtualBox + LightDM : Failed to use bus name org.freedesktop.DisplayManager, do you have appropriate permissions ?

Situation :

On my usual setup : Windows 7 host + Debian Buster guest (having 2 screens working fine so far) :
  1. Debian boots normally, the login screen appears
  2. I type my login + password
  3. both screens turn black, there's nothing I can do to interact with the machine anymore. I have to turn it off from VirtualBox's VM manager

Details :

  1. boot until the login screen appears
  2. using VirtualBox's host (right CTRL here) : host-F6 to open a login console
  3. log in as standard user, then test stuff as root
  4. (unclear in which order I did this...)
    lightdm
    DBus.Error:org.freedesktop.DBus.error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
    Failed to use bus name org.freedesktop.DisplayManager, do you have appropriate permissions ?
    journalctl -xe
    pam_unix(lightdm:auth): authentication failure; logname= uid=
    journalctl -u lightdm
    -- Reboot --
    Sep 11 09:37:59 myWorkstation systemd[1]: Starting Light Display Manager...
    Sep 11 09:38:04 myWorkstation systemd[1]: Started Light Display Manager.
    Sep 11 09:38:05 myWorkstation lightdm[889]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
    Sep 11 09:42:08 myWorkstation lightdm[1037]: pam_unix(lightdm:auth): check pass; user unknown
    Sep 11 09:42:08 myWorkstation lightdm[1037]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=
    Sep 11 09:42:16 myWorkstation lightdm[1074]: pam_unix(lightdm:auth): check pass; user unknown
    Sep 11 09:42:16 myWorkstation lightdm[1074]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=
    Sep 11 09:43:51 myWorkstation lightdm[1103]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=  user=sys
  5. some of the links I visited / things I tried while debugging this (and that did not solve the problem, kept for future reference...) :
    https://bugzilla.redhat.com/show_bug.cgi?id=1428379#c8
    	/etc/systemd/system/lightdm.service.d/fixes.conf
    ==========================================8<=========================================================
    https://askubuntu.com/questions/346738/13-04-lightdm-crashing-black-screen-flashing-cursor
    
    /var/lib/lightdm/.Xauthority
    	600 lightdm:lightdm
    
    chmod 664 ...
    ==========================================8<=========================================================
    https://askubuntu.com/questions/346738/13-04-lightdm-crashing-black-screen-flashing-cursor#answer-346994
    apt install xdm
    at config, select xdm
    apt remove lightdm* --purge
    reboot
    apt install lightdm
    + select lightdm
    reboot
  6. change the VM configuration in VirtualBox's VM manager so that it uses a single screen instead of 2, it works fine : I can log in graphically, see my desktop & al. and a desktop notification :
    Failed to connect to the VirtualBox kernel service

Solution :

No idea what was the actual root cause. Below is what I did, and the problem disappeared
  1. install the kernel headers (that were missing for an unknown reason)
  2. re-install the VirtualBox Guest Additions
  3. reboot, enjoy.

Error opening current controlling terminal for the process (`/dev/tty'): No such device or address.

Situation :

Here's what I did :
  1. upgrade my workstation to Debian Buster (10)
  2. upgrade VirtualBox from version 5.2.xx to 6.0 with this method
  3. start VirtualBox as a non-root user from a graphical session
  4. VirtualBox detects that the Extension Pack is outdated and offers to download + upgrade
  5. the upgrade fails with the error :
    Failed to install the Extension Pack /home/stuart/.VirtualBox/Oracle_VM_VirtualBox_Extension_Pack-6.0.10.vbox-extpack.
    
    The installer failed with exit code 127: Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address.
    
    Result Code: NS_ERROR_FAILURE (0x80004005)
    Component: ExtPackManagerWrap
    Interface: IExtPackManager {70401eef-c8e9-466b-9660-45cb3e9979e4}

Solution :

  1. close the current VirtualBox instance
  2. start VirtualBox again as root. No need to open a graphical session for root, sudo virtualbox will do the job
  3. if you're not prompted to update the Extension Pack, force the update with File | Check for updates
  4. follow the on-screen instructions and proceed with the update
  5. close this VirtualBox instance
  6. re-start VirtualBox as a non-root user
  7. confirm everything is going extremely well with File | Check for updates again

VirtualBox misplaces VM screens on monitors for a dual-screen Debian + XFCE guest

Situation :

I just _HATE_ when simple things waste my time !!! Today's joke was Windows 7 + VirtualBox + Debian/XFCE not able to go fullscreen the way I expected it. It already worked thousands of times, but no luck today ...

For the context, here's my setup. I have :

Upon starting my Debian guest within VirtualBox, 2 windows appear, 1 for each "virtual" screen. At first, they are in "windowed" mode (i.e. not fullscreen). One of these windows is my primary window (it has the XFCE taskbar), the other is the secondary window. Because of my physical setup, desk, personal preferences, I'd like to have :

While still in windowed mode, I can freely move windows wherever I want, so I place each one on its "destination" monitor. Right Ctrl-f toggles windows fullscreen. This _should_ be something very basic and _not spectacular at all_. But for some unknown reason, at this very moment, the windows contents switch, and I get the exact opposite of what I expect. This is sadly pretty usual, so Right Ctrl-f + move windows around / resize windows / ... + Right Ctrl-f again usually does the job. But today, nothing worked. I even rebooted the VM and the host operating system : no change .

Solution :

Not sure yet this is a solution or only a workaround. Wait & see
Update XFCE's display properties :
  1. Start menu | Settings | Display
  2. Identify displays (optional, but helps a lot : understanding who's who is priceless )
  3. then 2 solutions :
    • either monitors 1 and 2 are misplaced relative to each other (in XFCE settings). In such case, drag one around.
    • or XFCE insists on having the wrong monitor to be the Primary display. Tick the checkbox accordingly.

VirtualBox on a Debian host, Kernel driver not installed (rc=-1908) when starting a VM

Situation :

With VirtualBox running on a Debian host, I get this error message when trying to start a VM :
Kernel driver not installed (rc=-1098)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded
or there is a permission problem with /dev/vboxdrv. Please
reinstall virtualbox-dkms package and load the kernel module
by executing

'modprobe vboxdrv'

as root.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED
(-1908) - The support driver is not installed. On linux, open
returned ENOENT.

Solution :

  1. apt install --reinstall linux-headers-$(uname -r) virtualbox-dkms dkms
  2. modprobe vboxdrv
  3. retry starting the VM

Alternate solution :

I wrote an article for a pretty similar error in 2017. I guess it is now outdated. For the sake of completeness, here it is.

Can not start VirtualBox on Debian Stretch : Kernel driver not installed (rc=-1908) (source)

Situation

When trying to start a VM, I get the error message :
Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

Details

This happened after upgrading Debian from Jessie (8) (where everything worked fine) to Stretch (9).

Solution

Basically, all you have to do is to install an updated version of VirtualBox. To do so, as root :
  1. Define a new software source :
    echo 'deb http://download.virtualbox.org/virtualbox/debian stretch contrib' >> /etc/apt/sources.list.d/virtualbox.list
  2. Get the Oracle VirtualBox public key :
    curl -O https://www.virtualbox.org/download/oracle_vbox_2016.asc
  3. Register it :
    apt-key add oracle_vbox_2016.asc
  4. Install the new version :
    apt update && apt install virtualbox-5.1
After this, when trying to start one of my VMs, I got an error message saying it couldn't be started because of the "USB 2 subsystem" which was part of the snapshot, but currently not available and blah blah blah (can't remember the full error message and didn't note it).
What I did (now it works) :
  1. start the VirtualBox manager (the GUI listing existing VMs, not a VM)
  2. it offered to download + install an upgrade of the "VirtualBox guest additions" (4.3.x to 5.1.x). Accept + install
  3. now the VMs can start \o/

The VirtualBox kernel service is not running

Situation :

When booting my Debian virtual machine, I get a desktop notification :
VBoxClient
The VirtualBox kernel service is not running. Exiting.

Details :

Not sure if / how this is related, but I had a kernel update lately...

Solution :

This can be fixed by upgrading the VirtualBox Guest Additions on the virtual machine.
For an unknown reason, I've observed that when booting the VM with the VirtualBox Guest Additions inserted, the error message doesn't appear.

Mouse click lost in guest

Situation :

Details :

Solution :

Details :
  1. ps aux | grep [d]raganddrop
    kevin    31488  0.0  0.0  50364   332 ?        S    08:53   0:00 /usr/bin/VBoxClient --draganddrop
    kevin    31489  0.1  0.0 117064  2184 ?        Sl   08:53   0:15 /usr/bin/VBoxClient --draganddrop
  2. kill -1 31489
    • I don't know which one of both should be killed : the first or the other ?
    • Anyway, after that, both processes disappeared.
  3. The mouse click is back

Can't mount shared directories + modprobe vboxsf failed

Situation :

This is a weird situation where, after starting my guest Debian VM, I don't have access to the shared directories anymore. I've not been able to find the root cause, but in the process of trying to fix this, I ended up upgrading
  1. VirtualBox itself
  2. the Extension Pack
  3. the Guest Additions. This is where I got this modprobe vboxsf failed error message.

Solution :

Long story short, if you've upgraded everything, you've already done most of the work. The modprobe vboxsf failed error message is said to be mostly cosmetic, and can be ignored and "solved" by a reboot.

intel_rapl: no valid rapl domains found in package 0 while booting a Debian VM

Situation :

While booting a Debian VM, I get intel_rapl: no valid rapl domains found in package 0 messages and the boot process stalls.

Details :

RAPL is related to power management. It makes sense that it is not available on a virtual machine (source).

Solution :

Many different solutions are available on the Internet :
Disable 3D acceleration in VM configuration
No effect
Enable PAE/NX in VM configuration
No effect
echo 'blacklist intel_rapl' > /etc/modprobe.d/modprobe.conf, then reboot (source)
OK so far.

Read only file system when trying to create a symlink in a shared directory

Situation :

A Windows 7 host, running a Debian guest. A directory is shared between both and works fine : I can read and write there from both operating systems. But if, on the Debian side, I try to create a symlink within the shared directory, I get a Read only file system error. Which obviously is NOT read only since I can touch and rm there. So what's going on ?

Solution :

Well, I forgot the shared directory actually lives on the host operating system side, on a NTFS filesystem, which doesn't support ext4 symbolic links...

Can't log in my guest Debian despite having the right password

Situation :

A Windows 7 host, running a Debian guest. Debian boots normally, then displays the graphical login window. After I've input my login and password :
  1. I get no Wrong password message
  2. The screen turns black and flickers as if the graphical session was being opened normally
  3. Then I get the login window again

Solution :

There are several causes to this behavior. In my case, ~/.Xauthority was owned by root (), so I just had to delete it. And enjoy .

It's even possible that this has nothing to do with VirtualBox...

Permission denied on a shared directory

Situation :

VirtualBox is installed on a Windows host box, and runs a Debian guest machine. Shared directories are configured and mounted as expected, except that only root is allowed in there .

Solution :

Add the non-root user willing to gain access to the share into the vboxsf group :
adduser bob vboxsf

New permissions will be effective only after opening a new shell (for CLI access) or after a new login (for GUI access).

USB unavailable, VirtualBox complains : Failed to access the USB subsystem; Could not load the Host USB Proxy Service

Situation :

VirtualBox complains :
Failed to access the USB subsystem
Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND).
The service might not be installed on the host computer
Or :
Erreur d'accès au sous-système USB.
Le service de relais de périphériques USB n'a pas pû être activé (erreur VERR_FILE_NOT_FOUND).
Il se peut que le service ne soit pas installé sur l'ordinateur hôte.

Solution :

  1. as root :
    usermod -aG vboxusers bob
  2. log out and in again to reload groups data