FS#45748 - [virtualbox] Multi-monitor support broken

Attached to Project: Community Packages
Opened by Sven-Hendrik Haase (Svenstaro) - Thursday, 23 July 2015, 04:07 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 23 December 2015, 14:55 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 17
Private No

Details

My 4.3 multi-screen setup stopped working in 5.0 using the Arch guest modules. Using the official binary modules, multi-monitor support is working. Therefore, I must be something in the patches we currently use.

Xorg.0.log seems relevant: http://pastie.org/private/vfdkrkdsziscfhtdrpdjg
That log is only reporting a single screen.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Wednesday, 23 December 2015, 14:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  5.0.12
Comment by Tony Milne (tonymilne) - Thursday, 23 July 2015, 12:23 GMT
I am having the same issue, but with version 5.0.0 r101573 of virtual box. My Xorg.0.log is much the same (if not identical) to the one posted by Sven-Hendrik.

Edit: I think I have miss read the ticket. In that case, I, too, have moved from 4.3 to 5.0 and multi monitor support has been broken.
Comment by Sébastien Luttringer (seblu) - Thursday, 23 July 2015, 12:51 GMT
works fine with windows XP guests.
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 23 July 2015, 13:38 GMT
Yes, as I said, the binary modules work fine even for Arch guests. It must be a downstream problem with our packages.
Comment by Sébastien Luttringer (seblu) - Thursday, 23 July 2015, 14:32 GMT
Yes, I know. That underline the issue should be in virtualbox-guest-* subpackages not in our host modules.
Comment by Yuan Lin (lsyoyom) - Friday, 24 July 2015, 16:02 GMT
At the same time, as a workaround, you can just roll the virtualbox-guest-* related back to 4.3.28. It works for me. Though I only use multiple display and clipboard.
Comment by Lorenz Leitner (LoLei) - Saturday, 25 July 2015, 12:37 GMT
Same problem here, fresh install of Arch Linux but apparently my VB is 4.3 even though I updated it.

Comment by Matt Warner (coolpyrofreak) - Saturday, 25 July 2015, 20:56 GMT
I can confirm that rolling back virtualbox-guest-* restores multi-monitor support.
Comment by David Sankel (sankeld) - Tuesday, 28 July 2015, 18:07 GMT
Adding related packages for searchability:

virtualbox-guest-utils
virtualbox-guest-modules
Comment by Lorenz Leitner (LoLei) - Tuesday, 28 July 2015, 19:43 GMT
Rolling back virtualbox-guest-* to 4.3.28 worked for me too.

Now I have the issue that the second monitor appears as "disconnected" in xrandr, before the downgrade it did not appear at all.
Comment by Daniel Selinger (sLite) - Monday, 10 August 2015, 08:02 GMT
Got the same issue with on a Windows 7 host, with Arch Linux guest.
Sticking with the old guest-modules for now, i hope they don't stop working until we got this fixed.
Comment by Bruno Santos (bms) - Thursday, 13 August 2015, 08:16 GMT
Mind you that fileshares may be broken if using VB 5 and guest-* 4.3, you may want to roll back the host as well.

Also, on top of multi monitor being broken, when selecting USB3.0, USB devices stopped working correctly despite being identified by the host.
I wonder if someone can test USB 3.0 on a windows and linux guest and confirm the issue and source?
Comment by Sébastien Luttringer (seblu) - Wednesday, 19 August 2015, 16:34 GMT
I tested with both 5.0.0 and 5.0.2 and I'm not able to have multiple screen works, even when rollbacking to 4.3.28...
Comment by Yuan Lin (lsyoyom) - Wednesday, 19 August 2015, 21:24 GMT
seblu: According to my test, the rollback workaround stopped working at linux-4.1.5, rollback the kernel as well to see if it works.
Comment by J.M. Lapilainen (skry) - Thursday, 20 August 2015, 08:11 GMT
Doesn't work with either 5.0 or 5.0.2 for me, only one monitor is found.
Comment by Daniel Selinger (sLite) - Thursday, 20 August 2015, 15:17 GMT
is there some progress on this issue, since the last kernel upgrade the old kernel modules fail to load.
i use virtualbox for my work setup, so this is becoming quite urgent for me...
Comment by Sébastien Luttringer (seblu) - Thursday, 20 August 2015, 15:48 GMT
nop. Use dkms to compile a version for a specific working kernel.

If it's urgent, please provide a fix.
Comment by Daniel Selinger (sLite) - Thursday, 20 August 2015, 15:51 GMT
so the modules built by virtualbox-guest-dkms work? haven't seen this mentioned anywhere, will try.
that would be ok for me :>
Comment by Daniel Selinger (sLite) - Thursday, 20 August 2015, 15:59 GMT
doesn't work either, what should i compile with dkms? you mean the last 4.x version of the modules?
Comment by Matt Warner (coolpyrofreak) - Thursday, 20 August 2015, 16:04 GMT
If you uninstall virtualbox-guest-modules and virtualbox-guest-utils, install virtualbox-guest-iso, and run the Linux shell script, dual monitor support should work. The only downside I've discovered is having to re-run the script with every kernel update.
Comment by Sébastien Luttringer (seblu) - Thursday, 20 August 2015, 16:31 GMT
Or, you can use the old dkms package. It will rebuild automatically at boot the old kernel driver, with a recent arch kernel

https://seblu.net/a/archive/packages/v/virtualbox-guest-dkms/
Comment by Bruno Santos (bms) - Monday, 24 August 2015, 10:36 GMT
I can only test this in my work machine and I've been away / unable to test more until now, so I appologize if these are old news.
The binary modules do restore multi-monitor support with VB 5, but I get no 3D acceleration.

This doesn't actually bother me, but this being my work machine, I choose not to find out what else might be wrong with it, so I'll stick with 4.3.

tonymilne, seblu, Svenstaru:
It appears you tested the binary modules, did you check if 3D accel worked at all in your setups?
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 24 August 2015, 18:34 GMT
@bms, I did test that and it doesn't, but that should be an easy fix because the paths are simply wrong for the binary modules.
Comment by Bruno Santos (bms) - Monday, 24 August 2015, 22:47 GMT
Svenstaro: Nice to know, first time I tried the binary modules and I didn't really look into it to be honest.
Comment by Dobroslaw Kijowski (dobo) - Wednesday, 16 September 2015, 21:13 GMT
Something is broken in vboxvideo X11 driver. If you use that one from binary guest additions multi monitor support is working fine. It might be hard to find out what's wrong in our library compiled from source. I'll try to look into it in spare time.

To temporarily fix dual monitor support you can do following steps:
sudo pacman -S virtualbox-guest-iso
sudo pacman -S fuseiso
mkdir /tmp/vb_iso && mkdir /tmp/vb_unp
fuseiso /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /tmp/vb_iso
cd /tmp/vb_iso
./VBoxLinuxAdditions.run --noexec --target /tmp/vb_unp
cd /tmp/vb_unp
tar -xf VBoxGuestAdditions-amd64.tar.bz2 # or x86 one if using 32-bit
sudo cp lib/VBoxGuestAdditions/vboxvideo_drv_117.so /usr/lib/xorg/modules/drivers/vboxvideo.so # in the future check X11 version by invoking "sudo X -version"
# and restart X11 session, enable second monitor in menu and it should work now
Comment by Bruno Santos (bms) - Wednesday, 07 October 2015, 08:44 GMT
After a long overdue system update... is there any reason why this is still open?
I gave it a try and packages in repository seem ok.

Everything's working on my machine on stable repositories.
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 07 October 2015, 09:03 GMT
Well for me it isn't. I don't get multi-monitors in an Arch guest.
Comment by Bruno Santos (bms) - Wednesday, 07 October 2015, 09:59 GMT
My bad, you're right.
I was only using the compiled module unknowingly...

I assumed there was still some problem so I was playing with the iso files, but in the process of trying to understand why my shared folder was not working I installed the packages from the repository.
After installing the packages from the repos, the graphics driver was not overwritten, which I assumed it was (shouldn't it do so? or throw a warning, something?).

Anyway, regreatably, stable repositories still have an issue with multi monitor support.
Comment by J.M. Lapilainen (skry) - Wednesday, 07 October 2015, 10:07 GMT
Still broken for me as well, with both virtualbox 5.0.4 and 5.0.6 and 5.0.4 guest modules.
Comment by Jaroslav Stepanek (jarda-wien) - Tuesday, 20 October 2015, 13:02 GMT
I can confirm this on a windows 5.0.6 host and arch guest modules/utils 5.0.6.
Comment by Lukas Klingsbo (spydon) - Friday, 23 October 2015, 09:32 GMT
I can confirm this on a windows 5.0.8 r103449 host and arch guest modules/utils 5.0.6.
I can also confirm that dobo's temporary fix still works.
Comment by Dmytro Seliukhov (noop127) - Sunday, 25 October 2015, 14:02 GMT
dobo's fix worked for me, but I also had to run the following on the host:
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe controlvm arch setvideomodehint 1920 1080 24 1 yes

VirtualBox on the host: 5.0.8.103449, virtualbox-guest-iso: 5.0.8-1, virtualbox-guest-utils: 5.0.8-1

Comment by Lukas Klingsbo (spydon) - Monday, 23 November 2015, 16:02 GMT
This is still a problem in 5.0.10 with 5.0.10 virtualbox-guest-utils.
Also X11 has been updated now so the last command in dobo's fix needs to be vboxvideo_drv_118 for it to work.
Comment by Benjamin Robin (benjarobin) - Thursday, 17 December 2015, 16:17 GMT
I did start to investigate...
The function : VBoxQueryConfHGSMI(..., VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays)
Called by VBoxHGSMIGetMonitorCount(&pVBox->guestCtx) return : 4294967295 (all bit to 1)
Comment by Benjamin Robin (benjarobin) - Thursday, 17 December 2015, 22:15 GMT
Ok... I did found a workaround... This is very ugly, I patched the file HGSMIBase.cpp.
I did add "usleep(1000)" inside VBoxHGSMIBufferSubmit(), just before line VBoxVideoCmnPortWriteUlong()
I do not have time to investigate further...
Comment by Benjamin Robin (benjarobin) - Thursday, 17 December 2015, 22:27 GMT
Hum... Instead of the usleep, I just put a basic memory barrier : asm volatile("" : : : "memory");
And this is working perfectly...
Comment by Benjamin Robin (benjarobin) - Thursday, 17 December 2015, 23:01 GMT
Ok, this is pretty obvious now ...

The instruction "*pulValue = p->u32Value;" inside the function VBoxQueryConfHGSMIDef() is not executed.
In fact the compiler do not see that the memory had changed after the call of VBoxVideoCmnPortWriteUlong().
The reason are :
* VBoxVideoCmnPortWriteUlong() is an inline function
* An offset of the pointer is passed to VBoxVideoCmnPortWriteUlong() and not the pointer itself
=> The optimizer (of gcc) has no reason to reload the p->u32Value

The pointer may be declared volatile, or the ASMCompilerBarrier could be added

See https://www.virtualbox.org/ticket/14497
Comment by Benjamin Robin (benjarobin) - Thursday, 17 December 2015, 23:01 GMT
Attached the assembly code of the VBoxQueryConfHGSMIDef() function
Comment by Benjamin Robin (benjarobin) - Friday, 18 December 2015, 10:43 GMT Comment by Sébastien Luttringer (seblu) - Friday, 18 December 2015, 19:22 GMT
patch is shipped with virtualbox-5.0.10-3, could you confirm it's ok now?
Comment by Balló György (City-busz) - Saturday, 19 December 2015, 05:29 GMT
virtualbox-guest-utils 5.0.10-3 is broken for me, Xorg driver does not load. I had to downgrade to version 5.0.10-2.
Comment by Sébastien Luttringer (seblu) - Saturday, 19 December 2015, 13:51 GMT
Ok György, I'm cooking a new package for 5.0.12 release. The fix is included[1][2].

Each person affected by this bug should have a thought for Benjamin for Christmas.

[1] http://www.virtualbox.org/wiki/Changelog
[2] https://www.virtualbox.org/ticket/14497

Loading...