Virtualbox, Multiple Monitors, Hot-plugging Screens

16 October 2015 by Lincoln Ramsay

At work I have 2 big screens. They used to be run from a Linux desktop but I got upgraded to a laptop running Windows with my Linux desktop moved into a VM. I use Virtualbox which lets me use the 2 big screens as monitors for my Linux system. With Virtualbox set to “full screen” things are pretty much the way they were on the desktop, with an extra Windows screen to the right (that I pretty much don’t use).

One big change though is that I sometimes have to take my laptop away from my desk and when it undocks, strange things happen. I had previously suspended or shut down the VM but today I figured all the things out.

Problem 1: The number Windows puts on your screen may not match the number Virtualbox puts on your screen.

Here’s what my desktops look like.

windows_monitors_small

The laptop is on the right and according to Windows, the screens are numbered 3, 2, 1 (left to right). But what Windows calls screen 2, virtualbox calls screen 3 and Windows screen 3 is virtualbox screen 2. Why? I dunno.

Problem 2: Linux and Virtualbox disagree on where the monitors are.

The mouse is handled by Virtualbox so it tracks according to the Windows screen layout, not the Linux monitor layout. Virtualbox decides which Linux monitor goes on which screen, not the Linux monitor layout. I did set the Linux monitor layout so that it was “correct” but I’m not really sure it is having any effect.

Problem 3: Due to the desktop legacy, the monitors were reversed.

Rather than moving the monitors when I setup the desktop, I had all my “primary” desktop stuff on monitor 2 with monitor 1 as the “secondary” display. I had to drag my desktop icons from one monitor to the other. Moving the MATE panel was a bit harder. You have to right-click, preferences and uncheck Expand. Then you can use the tabs at the side of the panel to move it to the other monitor. Then you can make it expand again. Now my “primary” stuff is on monitor 1 (screen 2) and my “secondary” screen is monitor 2 (screen 3).

Problem 4: Virtualbox hides full-screen VM monitors if there is no physical screen to locate them on.

This is what was getting me when I undocked the laptop. Before I’d fixed everything up, my “primary” display would disappear. Virtualbox allows monitor 1 to display on the laptop and it simply hides monitor 2. Virtualbox does not tell the guest that it’s hiding monitor 2 either. After fixing things, my “secondary” display disappears, which is better. I also find out you can un-full-screen in order to see both monitors (they become 2 windows).