Home linux VirtualBox and Linux - fitting screen size of the Guest OS

VirtualBox and Linux – fitting screen size of the Guest OS




There is a host machine with Windows 7 x64 , it runs VirtualBox 5.0.12 , in which the virtual machine Linux Mint 17.3 x64 is deployed . One fine moment stops the resolution of the Guest OS screen. Changing the screen resolution via GUI and XRANDR work, and automatic (when the window size changes or the transition to full screen mode) – no.

What is interesting – when stretching the window, the wallpaper is duplicated for a split seconds, i.e. It seems like the system is trying to change permission, but it immediately returns back.

Reinstalling helps for a short time. At some point, behavior is spoiled again. The version of the add-ons role does not play – on the latest version and on version from the repository (5.0.4), the behavior is identical. When loading with LiveDVD, everything works fine. Videlle with Windows 7 also works fine.

What could be the problem and how to overcome it?

update 1

Experimental, it turned out that the auto image of the permission ceases to work if via GUI in the display properties set something standard (1024×768, 1920×1080, etc.) and press Apply . If you save non-standard (type 1854x812) - works.

Changes using Xrandr do not break anything.

update 2

It turned out that the GUI creates the file

~ / .config / monitors.xml

and records the installed screen resolution. If this file is not either in it, which something considers incorrect, then everything works. But it is necessary to register there the standard and immediately knocked out the authors.

Answer 1

So, the research led to the following result.

Display Configurator - Appelet Display / Monitor When saving settings (pressed / apply) Creates a file

~ / .config / monitors.xml

in which is prescribed, including the saved screen resolution. When you try to change the permission by external tools, it is rereading this file and return to the values ​​installed in it. If this file is deleted, changing the resolution of the Guest OS screen when the size of the virtual machine window is changed correctly.

When rereading the saved resolution is checked. As far as I understood, Xrandr is used to set the permit, which requests a list of supported modes from the video card. If the mode is in the list, XRANDR changes the permission, if not - does not do anything. Therefore, when installing non-standard permits, everything worked - the virtual video card holds almost any resolution, but only a small list gives to the VM.

Solving Solving Problem - Prohibit Create or Changing Monitors.xml . Oddly enough, the owner's change on root and installing "empty" rights did not affect anything - the file is still overwritten. I had to do more severe - create a blank file and execute the


sudo Chattr + i ~ / .config / monitors.xml

After that, the file overwriting stopped, but the applet stopped changing the screen resolution, swearing the inability to rename the file.

however, this decision was arranged. Now this file does not interfere, it will not be able to change it to change it, and it is possible to change the resolution of the VM screen using the VirtualBox itself - either the tange of the windows / side of the window, or using the menu:

View - & gt; Virtual screen N - & gt; Request permission in XXY

Changed thus resolution when rebooting the VM is saved, since the VBOX stores it in the settings of VM.

I would like, of course, make Linux ignore monitors.xml when changing the window size, but I could not do this.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions