Page 1 of 1

How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 14. Jul 2016, 21:12
by djsumdog
I recently upgraded to Virtualbox 5.1 on Gentoo (installed from Gentoo portage) and suddenly my VirtualBox manager and the guests are scaled to double. I don't have a UHD/4k screen; just a standard 1920x1080 screen. I have the correct DPI set in xrandr:

Code: Select all

xdpyinfo  | grep dots
resolution:    96x96 dots per inch
I did copy some dot files from a machine that did have a 4k display, but I thought I switched all the various DPI settings back. My GTK scaling factor is set to 1 as well:

Code: Select all

$gsettings get org.gnome.desktop.interface text-scaling-factor
1.0
I must be missing a DPI setting. Where does VirtualBox get it's information for DPI scaling from?
VirtualBox Manager
VirtualBox Manager
vbox_manager.jpg (125.79 KiB) Viewed 3248 times
Screenshot of Windows 10 VM
Screenshot of Windows 10 VM
vbox_winguest.jpg (127.27 KiB) Viewed 3248 times

Re: How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 14. Jul 2016, 21:26
by Ben.Hahlen
I use Fedora 24, with a hiDPi screen, and I have the exact opposite issue: everything is scaled down.
Have tried looking in the options, but can't find anything to set it.
Would be good to actually be able to read stuff without squinting...

Re: How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 17. Jul 2016, 07:50
by WFV
If you click on Display, you get a popup with some configurable options, one is Scale Factor.
Also look in the /home/user/.VirtualBox/VirtualBox.xml file?

Re: How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 19. Jul 2016, 15:38
by 3vi1
I'm also seeing the reverse scaling issues on my 4k screen.

5.0 worked fine, on the same machine, but with 5.1 no matter what I set for the guest window size, the guest's screen only uses the top left 1/4 of the window. Something was definitely broken with scaling between 5.0 and 5.1.

I'm going to go back to 5.0 for now, 5.1 is unusable in this state.

Re: How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 19. Jul 2016, 18:35
by djsumdog
If you click on Display, you get a popup with some configurable options, one is Scale Factor.
Also look in the /home/user/.VirtualBox/VirtualBox.xml file?
My scale factor is set to 100%. There is no scaling information in my

Code: Select all

~/.VirtualBox/VirtualBox.xml
file either.

I reverted to 5.0.24, but then when I booted Windows, it would start in a super low resolution which made it impossible to login:
Screen shot of Windows 10 in low resoluition
Screen shot of Windows 10 in low resoluition
low-res.jpg (68.67 KiB) Viewed 3149 times
I tried deleting all size and positioning information from the

Code: Select all

VirtualBox.xml
file, but no dice. I had to start Windows in safe mode (F8 boot) and then restart it in low-res mode.

I think 5.1 has a DPI/resolution identification bug on Linux hosts.

Re: How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 2. Aug 2017, 16:42
by Jamon
I also have this problem.

With a 4k monitor and a host running linux, if I run a windows guest (haven't tried other guests) with 3d acceleration on, the guest takes up exactly 25% of the total size of the virtualbox window, no matter what scaling or window size you set. Mouse input is relative to the whole window, not the visual pixels of the guest OS. (I.e. clicking the start button requires you to click in the black area at the bottom left of the virtualbox window). This is clearly a scaling issue when 3d acceleration is enabled.

If virtualbox pops a menu in front of the machine (like the on prompting whether you want to turn it off or save state), it scales properly for the duration that the window is up.

Turning off 3d Acceleration fixes it, but that's an awful solution, considering it makes the guest incredibly slow and breaks many applications.

Re: How does VirtualBox 5.1 on Linux determine its DPI for scaling?

Posted: 26. Jan 2018, 19:46
by Gary018
Ok. i've been having this issue and realized that an auto update put the new 5.1 on my system. ... Days of aggravation trying to figure out what I was doing differently, only to find out that it was an update.

I am trying to install 5.0.? back onto my installation, Yast tells me that I need libvpx.so.1 but it doesn't know where to get it.

Can anyone help with that?

Thanks,