Page 1 of 1
[Solved, qt5 bug] VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xfce
Posted: 31. Jan 2020, 15:42
by juozas
Hello,
While running VirtualBox 6.0 installed from official repository on Ubuntu 18.04 with Xfce desktop, the scaling of UI elements (menu, buttons, status bar, etc.) is too large and some dialogs are almost unusable. Setting Qt scaling factor to 1 (QT_SCALE_FACTOR=1) doesn't help, also after setting QT_SCALE_FACTOR to 0.5 the fonts are too small.
The screen resolution is 1366x768, DPI setting is set to 96 in Xfce settings, other programs appear normally. Btw the monitor is Samsung UE19ES4000 (oled tv), connected via hdmi cable.
Screenshots below
Edit: it appears setting QT_AUTO_SCREEN_SCALE_FACTOR to 0 fixes this problem, as it is apparently not virtualbox but qt5 bug. Also I'm using qt5ct so setting QT_QPA_PLATFORMTHEME to qt5ct is needed for it to work.
Edit2: For xubuntu session, the variables are defined in /etc/X11/Xsession.d/56xubuntu-session, I modified it to set the env. variable permanently while running this session by adding export QT_AUTO_SCREEN_SCALE_FACTOR=0 to it.
Re: VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xfce
Posted: 2. Feb 2020, 16:56
by scottgus1
juozas wrote:VirtualBox 6.0 installed from official repository on Ubuntu
Regrettably, the official repositories are forks of Virtualbox, with possible changes introduced, so the Virtualbox forums don't support the Linux distro repositories' copies of Virtualbox. You would need to uninstall the repository version and get the official version from
https://www.virtualbox.org/wiki/Linux_Downloads, then we could help.
That said, you can try an experiment: Reboot your host so no Virtualbox guests, windows, or processes are running. Find the folder /home/{username}/.config/VirtualBox, check to see that there is a file inside called Virtualbox.xml. If so, move the whole 'Virtualbox' folder to your desktop. This folder contains all File menu Preferences settings and the guest list. Moving the folder will temporarily reset Virtualbox. Don't worry, all your guests and settings will still be available.
Start Virtualbox. The main Virtualbox window will appear with an empty guest list. Is the font size good again? If so, then there is a spurious setting in the old Virtualbox.xml that is causing the graphics glitch in your present Virtualbox. Zip and post the Virtualbox.xml from the Virtualbox folder on your desktop, and the Virtualbox.xml found in the newly-generated /home/{username}/.config/VirtualBox folder. Note in the name which is which. We'll see if we can find what the problem is.
After the experiment, reboot your host again, delete the new /home/{username}/.config/VirtualBox folder, and move the desktop Vitualbox folder back to /home/{username}/.config. This will restore your whole setup with Preferences and your guest list, and the font glitch.
Re: VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xfce
Posted: 2. Feb 2020, 17:12
by juozas
scottgus1 wrote:juozas wrote:VirtualBox 6.0 installed from official repository on Ubuntu
Regrettably, the official repositories are forks of Virtualbox, with possible changes introduced, so the Virtualbox forums don't support the Linux distro repositories' copies of Virtualbox. You would need to uninstall the repository version and get the official version from
https://www.virtualbox.org/wiki/Linux_Downloads, then we could help.
I don't use third party virtualbox build or fork. I use official build. What I mean "oficial repository" I meen the repository provided by the virtualbox developers from the repository pointing to this particular domain where forum is also hosted. The build is installed from repository the that were added to sources.list as below:
Code: Select all
deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bionic contrib
Like described in section "Debian-based Linux distributions" of Linux downloads page (
https://www.virtualbox.org/wiki/Linux_Downloads) Also below is a proof that this build is official, as it comes from repository above.
Code: Select all
juozas@xubuntu:~$ LANG=C apt-cache policy virtualbox-6.1
virtualbox-6.1:
Installed: 6.1.2-135662~Ubuntu~bionic
Candidate: 6.1.2-135662~Ubuntu~bionic
Version table:
*** 6.1.2-135662~Ubuntu~bionic 500
500 https://download.virtualbox.org/virtualbox/debian bionic/contrib amd64 Packages
100 /var/lib/dpkg/status
Edit: I renamed
.config/VirtualBox and
VirtualBox VMs folders, didn't help much, also I didn't run VirtualBox before I did that. Menus, buttons are too large, the buttons are still off screen
Re: [Solved, qt5 bug] VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xf
Posted: 4. Feb 2020, 04:26
by scottgus1
juozas wrote:What I mean "oficial repository" I meen the repository provided by the virtualbox developers
Ah, OK, I understand now. "official repository on Ubuntu" sort of sounds to me like, 'Ubuntu's official repository', not 'Virtualbox's official repository'.
I see that in your first post you found a solution. Where does "QT_AUTO_SCREEN_SCALE_FACTOR = 0" get entered?
Re: [Solved, qt5 bug] VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xf
Posted: 4. Feb 2020, 07:02
by juozas
I modified
/etc/X11/Xsession.d/56xubuntu-session while using root (super-user) account (e.g by using program named sudo, which runs programs as root as long you're in group named sudo) to permanently add the environment variable to the system for xfce (xubuntu session). Also you can test this by running VirtualBox while in terminal and adding the variable right before
VirtualBox command. Or you can edit .desktop file and add
env and the variable before command line for VirtualBox or include it while running from quick launcher (
Alt+F2). E.g. add this as shown below:
Code: Select all
QT_AUTO_SCREEN_SCALE_FACTOR=0 VirtualBox
If running while in terminal emulator, or
Code: Select all
env QT_AUTO_SCREEN_SCALE_FACTOR=0 VirtualBox
If running from elsewhere, e.g. using a .desktop file or a quick laucher (
Alt+F2)
To set variable permanentlly for xfce (xubuntu session), add
Code: Select all
export QT_AUTO_SCREEN_SCALE_FACTOR=0
to
/etc/X11/Xsession.d/56xubuntu-session inside block beginning with
Code: Select all
if [ "$DESKTOP_SESSION" = xubuntu ]; then
Edit: The contents of
/etc/X11/Xsession.d/56xubuntu-session are as follows, notice I commented out line with
export QT_QPA_PLATFORMTHEME=gtk2 and added
export QT_QPA_PLATFORMTHEME=qt5ct as
qt5ct program is installed and is used to configure QT5 settings for local user. It wouldn't work w/o such modification and would even exit with error on older versions.
Code: Select all
# Set default environment vars in Xubuntu
if [ "$DESKTOP_SESSION" = xubuntu ]; then
# Disable GTK 3.16 overlay scrollbars
export GTK_OVERLAY_SCROLLING=0
# QT5 apps to use GTK style (disabled)
#export QT_QPA_PLATFORMTHEME=gtk2
# Use qt5ct for QT5 Apps
export QT_QPA_PLATFORMTHEME=qt5ct
# Fix wrong scaling of QT5 Apps
export QT_AUTO_SCREEN_SCALE_FACTOR=0
# Workaround clutter issue (LP: #1462445)
export CLUTTER_BACKEND=x11
fi
Re: [Solved, qt5 bug] VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xf
Posted: 4. Feb 2020, 23:59
by scottgus1
Thanks for that information, Juozas!
Re: [Solved, qt5 bug] VirtualBox 6.0 UI element scaling is too large while running on Ubuntu with Xf
Posted: 23. May 2020, 12:08
by jasonked
Thank you so much Juozas! This has been a problem I've had for ages on numerous distros using xfce!