Fullscreen on wrong monitor

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Sleris
Posts: 2
Joined: 17. Jan 2023, 19:10

Fullscreen on wrong monitor

Post by Sleris »

Hello,

I have been using VirtualBox on various laptops with Windows 10 / Windows 11 hosts and external screens for quite a long time (at least 5-6 years) and always had the following issue: sometimes when I put the VM into fullscreen, it goes on the wrong monitor.
Despite the non-fullscreen window being on one monitor, the fullscreen one goes on the other one.
Sometimes I am able to solve this getting out of fullscreen, resizing the window and putting it back to the correct monitor, but most of the time it does not change anything and when I go back to fullscreen it goes again on the other monitor.
It seems to happen a lot more often after Windows went into screensaving/lock but occasionally even happen when I just booted the VM. Rebooting the VM soemtimes help, sometimes not.
I have never been able to spot any specific condition triggering this behaviour, it really seems to be random.

I have tried searching for this issue in the forum and googles but all I can find are very old posts that are clearly related to the issue but with outdated proposed solution (the best one being viewtopic.php?f=6&t=38514).
In the View / Virtual Screen menu, I do not have "Use Host Screen N" entries, only things related to the resolution of the VM, so that does not help.

Is there a way to tell virtual box to stay on a specific monitor?

Information about setup:
* Has been happening with all versions of VB in the last few years, but currently using 6.1.40
* Same extension on both the host and guest (6.1.40)
* Guest is currently Arch Linux but have had this problem with other linux and non-linux guests too

Many thanks for any help.

Sincerely,
Sleris
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Fullscreen on wrong monitor

Post by mpack »

Sleris wrote: Is there a way to tell virtual box to stay on a specific monitor?
Perhaps not, at least not without a lot of work. I know from a recent project of my own that Windows indentification of monitors is pretty unreliable. In fact Windows doesn't really want apps to identify monitors at all, instead it wants windows to be positioned over a single "virtual screen" that encompasses all monitors (the same screen you get when you press PrtScn and then paste into an image editor). Great until you want to do things on one monitor only.

I also find (preliminary finding) that the order you power up the monitors can make a difference to how they are numbered, and "friendly name" is useless since it isn't guaranteed to be unique or persistent. I can imagine that going into screen lock and resume might have similar issues to powering up the monitors.

And my monitors are directly connected to a desktop PC. I don't have the complication of docking stations et al.

In my case I ended up identifying monitors by inference (e.g. fullhd dimensions, to left of primary monitor). But I'm not happy with this solution.

Unlike me, the devs are not wholly focused on Windows Hosts, so I'm not sure how much work has gone into solving problems such as this. It was so much simpler in the old days when there was one monitor running at one known DPI! If you can pin down an easily reproducable test case and raise a BugTracker ticket to describe it, then it has a better chance of being looked at.
Sleris
Posts: 2
Joined: 17. Jan 2023, 19:10

Re: Fullscreen on wrong monitor

Post by Sleris »

Hello,

Thanks for replying mpack, I thought this post would indeed not gather much attention which is why I never posted despite being bothered by this issue for so long.
I was mostly looking to confirm that there was no feature I would not be aware of before eventually opening a bug / request for feature.

Yes, Windows way of working with windows and monitors sucks a lot, and as you I believe the issue likely comes from the identification which varies with powering order sometimes when getting out of screen lock.
However I do believe this can be addressed in some way as if we look at presentation software (think powerpoint or libreoffice), they are a bit more stable with this to place the presenter and main windows on the adequate screen.
Most importantly, when they fail to place it adequately, they all have an option / shortcut which allows to switch the screens (this kind of remove the issue of having to identify screens reliably).

I believe something like that would be great in VirtualBox, and it might be worth looking at how such software are dealing with this to maybe identify a quick fix (I know of an open source one with a relatively light source base, so should be easy to find the relevant bit).
I would be happy to hear more about people opinion on this before I create the bug / request for feature.

Sincerely,
Sleris
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Fullscreen on wrong monitor

Post by fth0 »

Sleris wrote:I was mostly looking to confirm that there was no feature I would not be aware of
Well, there is an undocumented feature that you're perhaps not aware of, but I cannot promise that it will help you in any way:

While the VM is in the Powered Off state, open a Command Prompt with normal user privileges and enter the following command(s):

Code: Select all

cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage setextradata "VM Name" "GUI/AutomountGuestScreens" "1"
To remove the setting again, repeat the command without the value at the end.
Post Reply