Multiple Monitors not fully working with Xubuntu 22.04

Discussions about using Linux guests in VirtualBox.
Post Reply
IainMcC
Posts: 6
Joined: 11. Jan 2019, 21:52

Multiple Monitors not fully working with Xubuntu 22.04

Post by IainMcC »

I have a Windows 11 laptop, VirtualBox 7.0.14, and a couple of Xubuntu 22.04 guests (one is older and has kernel 5.15, and the other is newer and has kernel 6.5).

I have a Xebec screen extender, which is basically two monitors that mount on your laptop.

The screen on the left is 3 according to Windows, and the screen on the right is 2 according to Windows. (The laptop screen is 1).

Windows lets me arrange monitors in the settings app so that the screen on the left is, well, on the left, etc. Windows drag across properly.

The Xubuntu guests, on the other hand, do not let me arrange the monitors properly.

The VM settings have three monitors, and 256 Mb assigned to the video. Monitors 2 and 3 have scale factor set to 150% (they are 10" and 1920x1200 -- microscope required without scaling). Controller is VMSVGA and 3D is disabled. I have read somewhere that VBoxSVGA is contraindicated.

I enable the monitors in a running VM with the View menu. The VM MUST be in NON fullscreen mode. If the VM is in fullscreen mode VirtualBox randomly fails silently to enable monitors.

When I go full screen, virtual monitor 2 is on the left and virtual monitor 3 is on the right. (So the "use host monitor X" menu items in the VBox view menu are clearly ignored).

The xfce4-display-settings app won't let me rearrange the monitors. The physical arrangement of monitors is 2,1,3 (Virtual Monitor 2 is the left monitor, Virtual Monitor 1 is the laptop screen, Virtual Monitor 3 is the right monitor). Xfce thinks the monitors are arranged 1,2,3.

If I drag the icons around to match the physical layout and click Apply, a dialog pops up asking if I want to keep the settings or revert. Clicking on the keep button does nothing and it times out and reverts to the incorrect monitor arrangement.

So, I have to go through contortions if I want to drag windows to other monitors.

Is there any way of making Xubuntu work properly with VirtualBox and multiple monitors?
Poil
Posts: 33
Joined: 4. Nov 2016, 11:35

Re: Multiple Monitors not fully working with Xubuntu 22.04

Post by Poil »

I have the same setup as you and I have no problem except I have the same scale factor (3* 27" in 2K)

Do you try to play with Xrandr ? Before when I dock/undock my laptop I had this script

Code: Select all

#!/bin/bash
xrandr --newmode "1920x1170_60.00"  187.25  1920 2048 2248 2576  1170 1173 1183 1214 -hsync +vsync
xrandr --addmode VGA-2 "1920x1170_60.00"
xrandr --newmode "2560x1440_60.00"  312.25  2560 2752 3024 3488  1440 1443 1448 1493 -hsync +vsync
xrandr --addmode VGA-1 "2560x1440_60.00"
sudo systemctl restart vboxadd
xrandr --output VGA-1 --mode "2560x1440_60.00" --pos 0x0 --rotate normal --output VGA-2 --mode "1920x1170_60.00" --pos 2560x0 --rotate normal
IainMcC
Posts: 6
Joined: 11. Jan 2019, 21:52

Re: Multiple Monitors not fully working with Xubuntu 22.04

Post by IainMcC »

Thanks, I'll need to do something like that, I think.

I have VirtualBox set the scaling of the two side monitors to %150. So the 1920x1200 monitors run at 1280x800.

Whenever I turn full-screen off and on, (or just start the VM) they get set to random resolutions, maybe an xrandr script I can run would solve that automatically instead of many clicks on the VB view menu to get the proper resolutions back.

Will try and report back.
IainMcC
Posts: 6
Joined: 11. Jan 2019, 21:52

Re: Multiple Monitors not fully working with Xubuntu 22.04

Post by IainMcC »

As for moving windows between monitors, I found https://github.com/calandoa/movescreen which works so long as a window does not spill over into another monitor. Faster than dragging a window all over hell's half acre to get from the center monitor to the right monitor.

Still can't rearrange the monitors as xfce4-display-settings and VirtualBox interfere with each other. Same problem with Gnome.
IainMcC
Posts: 6
Joined: 11. Jan 2019, 21:52

Re: Multiple Monitors not fully working with Xubuntu 22.04

Post by IainMcC »

Sigh. Xrandr and VirtualBox just fight with each other over the display's settings. I end up with either postage stamps on the side monitors, or the main monitor set to an insane resolution like 4096x4096 (where the only recourse is to completely shut down the VM -- rebooting Linux in it doesn't reset the monitor).

Resetting vboxadd doesn't help.

I'll settle for fiddling with the VB view menu to force the side monitors to the correct resolution and active area.

Bleh
Post Reply