Solved VirtualBox Guest Additions won't work with Xorg: "Number of created screens does not match..."

I've successfully set up FreeBSD in VirtualBox and have installed Xorg and the XFCE desktop environment in the past (Gnome2 also). This time, I'm trying to do the same but also install the VirtualBox guest additions so I can set my resolution properly and maybe get graphics hardware acceleration to work. So I started with a fresh installation.

I followed the instructions here before installing Xorg: https://wiki.freebsd.org/VirtualBox#Installing_Guest_Additions_for_FreeBSD_guests

When I run Xorg -configure as the instructions say, I see vboxvideo in my list of video drivers, as it should be, but then it says Number of created screens does not match number of detected devices. Configuration failed.

8yyykp.jpg


And when I try to run startx, it fails and goes back to the Xorg console (well, I can't type anything or ctrl+C or use ctrl+alt+F1, so I have to reboot).

10znsjm.jpg


I've tried going into /root/xorg.conf.new. There are two "monitor" and two "screen" devices in there that aren't normally there when I set up Xorg without VirtualBox guest additions. Why are those there? So I've tried straying from the tutorial and removing the second entries ("monitor1" and "screen1") then copying the file to /etc/X11/xorg.conf and running startx, but then it still fails with the same errors. I have almost no idea what I'm doing.

How do I resolve this so I can start my X window server?
 
Delete or rename xorg.conf and run without it. Xorg will autoconfigure.
I tried that just now (removed /etc/X11/xorg.conf (already didn't exist) and /root/xorg.conf.new), and I get the same errors I got before when trying to run startx after Xorg -configure then get stuck in the Xorg console like before. Isn't this essentially the same as running Xorg -configure then startx?
 
Oh, that's right, the AIGLX thing... here, this is the entire file:
/usr/local/etc/X11/xorg.conf:
Code:
Section "ServerLayout"
  Identifier "xfce"
  InputDevice "Mouse1"
  Option "AIGLX" "Off" # disable AIGLX for VirtualBox Additions
EndSection

Section "InputDevice"
  Identifier "Mouse1"
  Driver "vboxmouse"
EndSection
 
Oh, that's right, the AIGLX thing... here, this is the entire file:
/usr/local/etc/X11/xorg.conf:
Code:
Section "ServerLayout"
  Identifier "xfce"
  InputDevice "Mouse1"
  Option "AIGLX" "Off" # disable AIGLX for VirtualBox Additions
EndSection

Section "InputDevice"
  Identifier "Mouse1"
  Driver "vboxmouse"
EndSection
That AIGLX option line is exactly what fixed it! I can start the X window system now. Thanks! It should mention this on the wiki page for VirtualBox.
 
By default, there is no xorg.conf, and usually none is needed. Several locations will work, but the correct one on FreeBSD is /usr/local/etc/X11/xorg.conf.
 
By default, there is no xorg.conf, and usually none is needed. Several locations will work, but the correct one on FreeBSD is /usr/local/etc/X11/xorg.conf.
In my case, it was at /etc/X11/xorg.conf. Editing that file worked for me.
 
All,
I'm in the process of installing FreeBSD 10.1 in VirtualBox and despite the fact that normally Xorg 1.14 should work without xorg.conf out of the box, it is still necessary to create it in a VirtualBox environment if you want mouse integration and if you want to use a correct resolution for your screen.
In my case the host is running Arch Linux (thinking of swapping to FreeBSD, that's why I experimenting VirtualBox right now) and I'm not using HAL (since Xorg 1.14 is integrated with devd I understood).
My xorg.conf (placed in /etc/X11/) is the following :
Code:
Section "ServerLayout"
   Identifier  "VirtBox Config"
   Screen    "Screen0"
   InputDevice  "Mouse0" "CorePointer"
   InputDevice  "Keyboard0" "CoreKeyboard"
   Option    "AIGLX" "Off" #disable AIGLX for VirtBox Additions
EndSection

Section "InputDevice"
   Identifier  "Keyboard0"
   Driver  "kbd"
EndSection

Section "InputDevice"
   Identifier  "Mouse0"
   Driver  "vboxmouse"
EndSection

Section "Monitor"
   Identifier  "Monitor0"
   VendorName  "Monitor Vendor"
   ModelName  "Monitor Model"
EndSection

Section "Device"
  ### Available Driver options are:-
  ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
  ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
  ### <percent>: "<f>%"
  ### [arg]: arg optional
   Identifier  "Card0"
   Driver  "vboxvideo"
   BusID  "PCI:0:2:0"
EndSection

Section "Screen"
   Identifier "Screen0"
   Device  "Card0"
   Monitor  "Monitor0"
   DefaultDepth 24
   SubSection "Display"
     Depth 24
     Modes "1440x1050"
   EndSubSection
EndSection
 
strider, as far as I know you shouldn't need the Screen section in the xorg.conf file. As a matter of fact I believe while your VM may run fine at full screen, you may have some problems with scale mode as your forcing the resolution. The VirtualBox driver should be able to handle the resolution correctly.
 
To repeat, the entire xorg.conf needed is shown in post #4 above. Mouse integration works with it, video works with it, in fact you can even arbitrarily resize the VirtualBox window to create resolutions not found in nature.
 
Back
Top