# X won't use vboxvideo driver in VirtualBox



## Son of a Beastie (Feb 20, 2020)

Hi everyone, this is my first post.

I'm new to BSDs and am running 12.1 RELEASE but having some difficulty getting FreeBSD to run under VirtualBox. For some reason, the vboxvideo driver is not used in X.

I reviewed and followed the handbook regarding VirtualBox guests:









						Chapter 23. Virtualization
					

Virtualization software allows multiple operating systems to run simultaneously on the same computer




					www.freebsd.org
				




But it seems to be outdated as it references /etc/X11/xorg.conf. My understanding is that 1) xorg.conf files are deprecated in general (though with some specific exceptions) and that 2) one is supposed to put such files in /usr/local/etc/X11/xorg.conf.d/

I reviewed the instructions on this page:









						Chapter 5. The X Window System
					

This chapter describes how to install and configure Xorg on FreeBSD, which provides the open source X Window System used to provide a graphical environment




					www.freebsd.org
				




And it says if you want to force a video driver to be used then it should be placed in 
/usr/local/etc/X11/xorg.conf.d

I placed the following information in a file named driver-vboxvideo.conf which I copied from the Handbook section on VirtualBox guests:

```
Section "Device"
    Identifier "Card0"
    Driver "vboxvideo"
    VendorName "InnoTek Systemberatung GmbH"
    BoardName "VirtualBox Graphics Adapter"
EndSection
```

Unfortunately, when that file exists, X will not load. If I move the file elsewhere then X will load but I will not be able to use seamless mode or have the display resize to the window size.

I experimented a bit with 11.X Release and did not have these issues. Is it possibly related to python 2.7? I had to manually edit the Makefile to get virtualbox-ose-additions to build at all.

Any idea what is happening?

Here is the output of kldstat:

```
Id Refs Address         Size Name
1 18 0xffffffff80200000 2448ef8 kernel
2 1 0xffffffff82649000 3a99a8 zfs.ko
3 2 0xffffffff829f3000 a5b8 opensolaris.ko
4 1 0xffffffff82c19000 2ef63 vboxguest.ko
5 1 0xffffffff82c48000 2668 intpm.ko
6 1 0xffffffff82c4b000 b50 smbus.ko
7 1 0xffffffff82c4c000 88d8 tmpfs.ko
```


----------



## Emrion (Feb 20, 2020)

Normaly, there is no .conf file to add to use the vbox video driver provided the vboxguest module is loaded.
Have you loaded vboxservice?

`sysrc vboxservice_enable=YES
service vboxservice start`



> I experimented a bit with 11.X Release and did not have these issues. Is it possibly related to python 2.7? I had to manually edit the Makefile to get virtualbox-ose-additions to build at all.


Try to install virtualbox-ose-additions with `pkg`. I have a 12.1-RELEASE under virtualbox and I have no trouble at all.


----------



## Son of a Beastie (Feb 20, 2020)

Thank you. Yes, I had already inserted that line in my /etc/rc.conf.

The services was running as well. I restarted it to no avail.

Here is my rc.conf:


```
clear_tmp_enable="YES"
hostname="freebsd"
ifconfig_em0="DHCP"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
sshd_enable="YES"
zfs_enable="YES"
sddm_enable="NO"
dbus_enable="YES"
hald_enable="YES"
vboxguest_enable="YES"
vboxservice_enable="YES"
vboxservice_flags="--disable-timesync"
```


Is vboxvideo supposed to be loaded if X is not running? Just curious.

I did use a test xorg config just to force it to use vboxvideo. I'm wondering if the ose-additions build did not fully complete even though it did not generate failure messages.

Here is the relevant output of /var/log/Xorg.0.log:


```
[  1352.214] (II) LoadModule: "vboxvideo"
[  1352.215] (II) Loading /usr/local/lib/xorg/modules/drivers/vboxvideo_drv.so
[  1352.215] (II) Module vboxvideo: vendor="Oracle Corporation"
[  1352.215]    compiled for 1.18.4, module version = 1.0.1
[  1352.215]    Module class: X.Org Video Driver
[  1352.215]    ABI class: X.Org Video Driver, version 20.0
[  1352.215] (**) Load address of symbol "VBOXVIDEO" is 0x801af8020
[  1352.215] (II) VBoxVideo: guest driver for VirtualBox: vbox
[  1352.215] (--) Using syscons driver with X support (version 2.0)
[  1352.215] (--) using VT number 9

[  1352.215] (EE) No devices detected.
[  1352.215] (EE)
Fatal server error:
[  1352.215] (EE) no screens found(EE)
[  1352.215] (EE)
```


----------



## Son of a Beastie (Feb 26, 2020)

Any ideas on this issue? I would love to get more into FreeBSD if I could get this figured out.


----------



## razrx (Mar 15, 2020)

Son of a Beastie said:


> Any ideas on this issue? I would love to get more into FreeBSD if I could get this figured out.



Some more info:
- what vbox version
- what host OS
- which graphics controller is selected for your VM in vbox?
I also had issues with X not starting on 13.0-CURRENT when VMSVGA was selected.
When I switched to VBOXSVGA (not entirely sure on the controller name) X started fine.

HTH


----------



## Menilmontant (Mar 29, 2020)

Hi,
Thank you *razrx *for the tip. 
In my case it works very well with the *VboxVGA *graphic controller. 
VirtualBox displays a warning at the bottom of the screen "_Invalid settings detected_", but it can be ignored.

Regards


----------



## grahamperrin@ (Dec 19, 2020)

Menilmontant said:


> … In my case it works very well with the *VboxVGA *graphic controller. …



With that, can you get seamless mode?


----------



## Emrion (Dec 19, 2020)

Menilmontant said:


> Hi,
> Thank you *razrx *for the tip.
> In my case it works very well with the *VboxVGA *graphic controller.
> VirtualBox displays a warning at the bottom of the screen "_Invalid settings detected_", but it can be ignored.
> ...


That's a solution for the OP problem. It's the one I use.

The other one is to leave the default graphic controler in VirtualBox which is VMVGA and install xf86-video-vmware.
Don't keep any .conf file for X (unless you know what you're doing).


----------



## Samuel Venable (Dec 19, 2020)

iirc the manual says you don't need this:


```
Section "Device"
    Identifier "Card0"
    Driver "vboxvideo"
    VendorName "InnoTek Systemberatung GmbH"
    BoardName "VirtualBox Graphics Adapter"
EndSection
```

It should be recognized automatically without giving that information explicitly.

Edit:

I did remember correctly:








						Chapter 23. Virtualization
					

Virtualization software allows multiple operating systems to run simultaneously on the same computer




					www.freebsd.org
				




"Xorg will automatically recognize the vboxvideo driver. It can also be manually entered in /etc/X11/xorg.conf:"


----------



## fyfe (Feb 26, 2021)

Samuel Venable said:


> It should be recognized automatically without giving that information explicitly.


Only if you install the right port for the selected graphics controller . For anybody else that stumbles upon this thread.



*Graphics Controller**Port**Driver*VMSVGA (default)x11-drivers/xf86-video-vmwarevmware_drv.soVBoxVGAemulators/virtualbox-ose-additionsvboxvideo_drv.soVBoxSVGAemulators/virtualbox-ose-additionsvboxvideo_drv.so


*Host:*
Windows 10
VirtualBox 6.1.18
*Guest:*
FreeBSD 12.2 (UEFI)
*Graphics Controller:* VMSVGA
*3D Acceleration:* Enabled
No xorg.conf required.


----------



## kpedersen (Feb 26, 2021)

fyfe Is there any reason to prefer VMSVGA rather than VBoxVGA or VBoxSVGA? Or is it just because it defaults to that? i.e do both have auto scaling of the guest?


----------



## fyfe (Feb 26, 2021)

There's a good answer on superuser.com explaining the difference between the three options. Other than which driver is used I haven't seen any difference between them but I've only been playing with it for a couple of hours.

I currently haven't got scaling to work yet, in UEFI mode my resolution seems to be stuck at 1920x1080 (possibly because I have `efi_max_resolution="1080p"` in loader.conf), and in legacy mode my resolution is stuck at 1024x768.


----------



## grahamperrin@ (Apr 24, 2021)

kpedersen said:


> … any reason to prefer VMSVGA rather than VBoxVGA or VBoxSVGA? …



I find reasons to prefer VBoxSVGA (to avoid VMSVGA) ▶ https://forums.virtualbox.org/viewtopic.php?p=498570#p498570



fyfe said:


> … haven't got scaling …



Works for me; see for example the screenshot in the VirtualBox forum.


----------



## scottro (Apr 24, 2021)

In my case, I had to install the vmware driver, rather than the vbox video driver. (This was for a FreeBSD guest).


----------



## grahamperrin@ (Apr 24, 2021)

scottro said:


> … had to install the vmware driver …



Re: the other topics, please try `VBoxSVGA` *without* x11-drivers/xf86-video-vmware.


----------



## scottro (Apr 24, 2021)

Next time, I'll give it a shot, thanks.


----------



## scottro (Apr 24, 2021)

Ok, that worked. Thank you. I installed virtual-ose-additions, changed the video to VBoxSVGA and X works without having to install vmware drivers.


----------



## Frenchy_SG (Aug 23, 2021)

razrx said:


> Some more info:
> - what vbox version
> - what host OS
> - which graphics controller is selected for your VM in vbox?
> ...


I had very similar behaviour as well, and switching from the standard VMSVGA to VBOXSVGA made the trick as well.

I'm using:
vbox 6.1.26
host: macOS 10.15.6
guest OS is FreeBSD 13.0p3


----------



## t8dds (Feb 8, 2022)

I got the same similar issue and I made it by VboxVGA and VboxSVGA does not help.
My env is like:
win 10
vbox: 6.1.28
freebsd:13.0


----------



## grahamperrin@ (Feb 9, 2022)

t8dds said:


> similar



Please, what are the symptoms in your case?


----------



## t8dds (Feb 11, 2022)

grahamperrin said:


> Please, what are the symptoms in your case?


The resolution is only at 1024x768 but my host monitor is 1080p.  So I need a full screen after I boot up the X.


----------



## mendenlama (Feb 11, 2022)

Here is my config for a FreeBSD guest:

freebsd-version: 13.0-RELEASE-p7

installed pkg:
virtualbox-ose-additions-6.1.32 VirtualBox additions for FreeBSD guests

settings in /etc/rc.conf:
vboxguest_enable="YES"
vboxservice_enable="YES"

On the host side:
FreeBSD 13.0 p7
Virtualbox version: 6.1.30
Starting the FreeBSD guest with legacy bios (not with efi boot)
vbox display setting: VBoxSVGA

I have access to a whole range of screen resolutions.


----------



## grahamperrin@ (Feb 11, 2022)

Thanks,  



t8dds said:


> The resolution is only at 1024x768 but my host monitor is 1080p.



Please share outputs from these guest commands:

`freebsd-version -kru ; uname -aKU`
`service -e`
`kldstat`
`xrandr`
`pkg -vv | grep -e url -e latest`
`pkg update`


----------



## t8dds (Feb 11, 2022)

Oh, 


grahamperrin said:


> Thanks,
> 
> 
> 
> ...


Thanks for your reply. I guess you missed my words. I have made it. So no problem now.
Thanks anyway.

"I got the same similar issue and* I made it by VboxVGA* and VboxSVGA does not help."


----------



## grahamperrin@ (Feb 11, 2022)

Thanks, 



t8dds said:


> "I got the same similar issue and* I made it by VboxVGA* and VboxSVGA does not help."



Do you mean that VBoxVGA worked around the video issue?


----------



## t8dds (Feb 11, 2022)

yep, my first try is this case. But before my reply here, I tested with VboxSVGA and it is good too.


----------



## grahamperrin@ (Feb 12, 2022)

Sorry, I'm still confused: 



t8dds said:


> VboxSVGA does not help.





t8dds said:


> yep, my first try is this case. But before my reply here, I tested with VboxSVGA and it is good too.



Do you mean that things were (first) good with VBoxSVGA, then (later) _not_ good with VBoxSVGA?


----------

