Auto resize guest display causes virtual screen 2 to crash

Discussions about using Linux guests in VirtualBox.
Post Reply
keenan
Posts: 5
Joined: 9. Oct 2021, 04:45

Auto resize guest display causes virtual screen 2 to crash

Post by keenan »

 Edit: I probably should've mentioned this before, but I installed this Ubuntu virtual machine through my school. It came pre-installed with OMPL and OMPL.app, a software developed by my professor for Algorithmic Robotics (hence the name of my VM), as well as Python bindings. I don't think they did anything weird to it, just included the software we needed for the class, which can be found separately by googling OMPL and clicking the first link (I'm not allowed to post URLs here yet) 
I am running an Ubuntu (x64) virtual machine on a Windows 10 (x64) host, and guest additions are installed. I set the monitor count to 2 in the VirtualBox Manager settings for this VM. When I turn on Auto Resize Guest Display under 'View', everything seems to work fine at first. I can use both virtual monitors until I try to resize Virtual Screen 2 (by clicking and dragging on the edge of its window). If I do that, Screen 2 flickers a bit then closes on its own. I can re-enable it under View -> Virtual Screen 2 -> Enable, but I always get the same problem when I try to resize the window.

Some more details about the problem:
If I instead click minimize or maximize, it works fine. It's only when I click and drag the edges.
I can resize the main window (Virtual Screen 1) without a problem.
If I go into the virtual machine's settings -> Devices -> Displays, it sees both virtual screens at first. When Screen 2 crashes after I try to resize it, the virtual machine switches to single display mode. But if I then go to Join Displays, it still sees that there is another display hooked up but not enabled, and if I click 'Apply', Virtual Screen 2 will open back up. See attached screenshot. (Note that in the screenshot, Virtual Screen 2 is labeled as display 1, and Virtual Screen 1 is labeled as display 2 but still correctly recognized as the primary display.) Also, if I adjust the resolution using the Ubuntu VM's displays settings, it works fine.

Host machine:
Acer Aspire VN7-592G
OS: Windows 10 x64 with everything up to date including all drivers.
CPU: Intel Core i7-6700HQ @2.6GHz (4 physical cores + 4 virtual/hyperthreaded cores)
Integrated GPU: Intel HD Graphics 530
Dedicated GPU: NVidia GeForce GTX 960m
RAM: 32GB

Virtual Machine settings:
OS: Ubuntu (x64) version 18.04.6 LTS
Base Memory: 20GB
Processors: 4
Processor Execution Cap: 100%
Video Memory: 128MB
Graphics Controller: VMSVGA
Graphics Acceleration: 3D

VirtualBox version: 6.1.26 r145957 (Qt5.6.2)
Guest additions are the same version as VirtualBox and I installed them by simply going to devices -> Insert Guest Additions CD Image
In Windows graphics settings (on the host), I've made sure to tell it to use my NVidia GPU for VirtualBox.

Things I've tried:
Disabling 3D acceleration - no effect.
Changing the graphics controller to VboxVGA. Instead of Virtual Screen 2 crashing, it just goes black and unresponsive, but everything else is the same. The Ubuntu virtual machine switches to Single Display mode just like before etc etc.
Going into graphics settings in the Windows host machine and telling it to use the integrated GPU for VirtualBox. No effect.
Going into VirtualBox -> File -> Preferences -> Display, then changing the Maximum Guest Screen Size. I tried all three options. For Hint, I tried a couple different things, including the values the log file happened to be saying it was sending at that time (see below). None of this had any effect.

I tried to upload the log files but they were too big and it wouldn't let me, so I copy/pasted part of VBox.log below. It starts with me clicking View -> Virtual Screen 2 -> Enable, then immediately trying to resize it. I only did it once, so I think the lines saying "Guest-screen count changed" correspond to the flickering before the crash.
00:55:55.479740 VMMDev: SetVideoModeHint: Got a video mode hint (1175x960x32)@(0x0),(1;0) at 1
00:55:55.481202 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=1920 h=975 bpp=0 cbLine=0x0 flags=0x2 origin=0,0
00:55:55.510149 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000013da4000 w=1920 h=975 bpp=32 cbLine=0x1E00 flags=0x1 origin=0,0
00:55:55.511880 GUI: UIMachineLogic: Guest-screen count changed
00:55:55.530135 Display::i_handleDisplayResize: uScreenId=1 pvVRAM=000000001869e000 w=1175 h=960 bpp=32 cbLine=0x125C flags=0x1 origin=1920,0
00:55:55.534088 GUI: UIMachineLogic: Guest-screen count changed
00:55:58.742973 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.788710 VMMDev: SetVideoModeHint: Got a video mode hint (1512x960x32)@(0x0),(1;0) at 1
00:55:58.788982 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.792599 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=1920 h=975 bpp=0 cbLine=0x0 flags=0x2 origin=0,0
00:55:58.792650 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.799651 Display::i_handleDisplayResize: uScreenId=1 pvVRAM=0000000000000000 w=1175 h=960 bpp=0 cbLine=0x0 flags=0x2 origin=1920,0
00:55:58.802140 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.804682 VMMDev: SetVideoModeHint: Got a video mode hint (1512x960x0)@(0x0),(1;0) at 1
00:55:58.804903 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:55:58.811152 GUI: UIMachineLogic: Guest-screen count changed
00:55:58.819548 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.821642 VMMDev: SetVideoModeHint: Got a video mode hint (1512x960x0)@(0x0),(0;0) at 1
00:55:58.835434 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.836686 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=000000001869e000 w=1920 h=975 bpp=32 cbLine=0x1E00 flags=0x1 origin=0,0
00:55:58.838472 VMMDev: SetVideoModeHint: Got a video mode hint (1512x960x0)@(0x0),(0;0) at 1
00:55:58.840427 GUI: UIMachineLogic: Guest-screen count changed
00:55:58.863242 Display::i_handleDisplayResize: uScreenId=1 pvVRAM=000000001673e000 w=1512 h=960 bpp=32 cbLine=0x17A0 flags=0x1 origin=1920,0
00:55:58.872990 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.878903 VMMDev: SetVideoModeHint: Got a video mode hint (1512x960x32)@(0x0),(0;0) at 1
00:55:58.884518 GUI: UIMachineLogic: Guest-screen count changed
00:55:58.894494 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=1920 h=975 bpp=0 cbLine=0x0 flags=0x2 origin=0,0
00:55:58.898777 Display::i_handleDisplayResize: uScreenId=1 pvVRAM=0000000000000000 w=1512 h=960 bpp=0 cbLine=0x0 flags=0x2 origin=1920,0
00:55:58.931358 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=000000001869e000 w=1920 h=975 bpp=32 cbLine=0x1E00 flags=0x1 origin=0,0
00:55:58.934962 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.940007 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=1920 h=975 bpp=0 cbLine=0x0 flags=0x2 origin=0,0
00:55:58.953095 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=000000001869e000 w=1920 h=975 bpp=32 cbLine=0x1E00 flags=0x1 origin=0,0
00:55:58.963918 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.974865 GUI: UIMachineLogic: Guest-screen count changed
00:55:58.983203 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:58.989892 GUI: UIMachineLogic: Guest-screen count changed
00:55:59.021944 GUI: UIMachineLogic: Guest-screen count changed
00:55:59.055327 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:59.187838 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
00:55:59.231498 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 1 as 1512x960 if necessary
Attachments
AlgorithmicRobotics2-2021-10-08-23-39-37.zip
Log files
(65.53 KiB) Downloaded 10 times
Ubuntu display settings (after Screen 2 crashes, and I then click Join Displays)
Ubuntu display settings (after Screen 2 crashes, and I then click Join Displays)
JoinDisplays.JPG (121.89 KiB) Viewed 9683 times
Last edited by keenan on 9. Oct 2021, 23:16, edited 2 times in total.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Auto resize guest display causes virtual screen 2 to crash

Post by mpack »

Zip and attach your log.
keenan
Posts: 5
Joined: 9. Oct 2021, 04:45

Re: Auto resize guest display causes virtual screen 2 to crash

Post by keenan »

mpack wrote:Zip and attach your log.
I don't know how I didn't think of that... anyway this time I just booted up and tried to resize Screen 2. For some reason it just moved from my second physical monitor to my main one, which is the first time that has happened. Then I tried to resize again and it crashed like usual.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Auto resize guest display causes virtual screen 2 to crash

Post by mpack »

I would:
  1. Reduce VM to 2 CPU cores.
  2. Reduce VM RAM to 16GB (16384MB).
  3. Increase graphics RAM to 256MB.
  4. If you still get a crash, update the host graphics drivers.
keenan
Posts: 5
Joined: 9. Oct 2021, 04:45

Re: Auto resize guest display causes virtual screen 2 to crash

Post by keenan »

I tried all of those things and it's still happening
keenan
Posts: 5
Joined: 9. Oct 2021, 04:45

Re: Auto resize guest display causes virtual screen 2 to crash

Post by keenan »

I found a bit of a workaround. I can turn off auto-resize guest display and put it in scaled mode, then resize Virtual Screen 2 as needed (by dragging the corners/edges of the window), then turn on auto-resize just so it fixes the resolution, and then turn it off again. I lose the ability to have it automatically adjust the resolution if I resize the window again, but at least it stays open and I get to use two virtual screens.

Also, since decreasing the VM RAM and increasing the graphics RAM, the problem isn't as bad (I put the CPUs back to 4 since it wasn't making a difference). Screen 2 doesn't usually crash anymore, but the window itself doesn't stay the size that I put it at. The resolution adjusts just fine, but the window itself is very very stubborn.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Auto resize guest display causes virtual screen 2 to crash

Post by mpack »

keenan wrote:I put the CPUs back to 4 since it wasn't making a difference
Your CPU has 4 cores total, so assigning all 4 to a VM leaving none for the host - is always wrong and can lead to instability (e.g. higher interrupt latency in either host or VM).
keenan
Posts: 5
Joined: 9. Oct 2021, 04:45

Re: Auto resize guest display causes virtual screen 2 to crash

Post by keenan »

mpack wrote:
keenan wrote:I put the CPUs back to 4 since it wasn't making a difference
Your CPU has 4 cores total, so assigning all 4 to a VM leaving none for the host - is always wrong and can lead to instability (e.g. higher interrupt latency in either host or VM).
I didn't realize that. I figured the host would still be able to make use of the virtual cores but I guess that wouldn't really make sense. Thanks for the help.
Greylock
Posts: 1
Joined: 23. Sep 2020, 23:14

Re: Auto resize guest display causes virtual screen 2 to crash

Post by Greylock »

I am having this problem with an Arch linux client as well.

My current workaround is to never use the drag-to-resize option, but only use the View -> Virtual Screen X -> (resolution) to resize. That is unfortunate since it doesn't offer optimal resolutions, but at least it doesn't crash. Also sometimes I accidentally click on a window border (on the windows host) and drag it, so I pretty much have to disable auto-resize.

Using: XFCE on Arch, VMSGVA driver, Windows 10 host.

Symptoms:
  • I have two screens defined. I typically run them side by side on a single 4K monitor. That does not seem to be the problem, it also occurs if I put them on different monitors.
  • View > Virtual Screen X > Resize to WxH always works.
  • xrandr to set a resolution does not work. (It works with VBoxSVGA.)
  • Resizing by dragging causes both windows to rapidly flicker on and off. If I am resizing window 1, it is an annoying visual glitch but doesn't result in a problem. If I am resizing window 2, it almost invariable closes and the View > Virtual Screen 2 > Enabled menu item becomes unchecked. Checking it again restores the window.
  • When dragging I can see that that both windows flickers OFF and then back ON, as if they were closed and reopened. Sometimes it is a single flicker. Sometimes it appears to re-draw the window half a dozen times at various sizes.
  • When dragging window 1, there are draw artifacts where the entire window is not being re-drawn. I might see a dozen taskbars at the bottom due to this glitch. After I stop dragging there is about a 5-second pause and then everything is re-drawn correctly. During this artifact phase, I can see both window 1 and window 2 visible in window 1, as well as an empty area that is not part of window 1 or window 2. I am wondering if this bug is related to both windows sharing the same virtual screen area: Window 1 always has its origin at (0,0) but window 2 is always relative to the right edge or window 1. Resizing either means the backing buffer has to be resized, and in most cases window 2 also has to be moved relative to the origin.
  • Dragging any of four edges of window 2, sometimes it closes, sometimes it works, and sometimes snaps back to the original position. In any case if it does not close, the mouse is no longer in drag-mode, even though I have not let up on the mouse button.
  • Once I was drag-resizing window 2 and it flickered off and then back on without becoming disabled. But when it came back on the window was in a different position, slightly offset from when it was off. The mouse was no longer in drag mode.
  • Once when drag-resizing window 1, the entire window jumped to a different vertical location on the screen, maybe 100-200 pixels. Then as I continue dragging it snapped back to its original position and continued to size normally.
  • This problem started happening when I switched from VBoxSVGA to VMSVGA. It does not happen on VboxSVGA.
Post Reply