VirtualBox

Opened 6 years ago

Closed 5 years ago

#17855 closed defect (fixed)

[5.2.14][QT 5.11] VBoxManager doesn't store correctly values in ~/.config/VirtualBox/VirtualBox.xml

Reported by: FredBezies Owned by:
Component: other Version: VirtualBox 5.2.14
Keywords: Cc:
Guest type: other Host type: Linux

Description

Hello.

There is a bug in VBoxManager when using it with QT 5.11. I can reproduce it both on a Manjaro Linux based laptop and an Archlinux based PC.

When you launch VirtualBox on a linux distribution with QT 5.11, both toolbar and statusbar are hidden.

Even if you display both of them, on shutdown, it is not stored correctly.

Here is a screenshot of this bug.

When I looked at ~/.config/pVirtualBox/VirtualBox.xml I noticed these both entries:

<ExtraDataItem name="GUI/Statusbar" value="false"/> <ExtraDataItem name="GUI/Toolbar" value="false"/>

If you change both false by true with VirtualBox closed on next start, both bars are displayed.

Attachments (1)

vbox5214.png (261.9 KB ) - added by FredBezies 6 years ago.
Missing toolbars.

Download all attachments as: .zip

Change History (19)

by FredBezies, 6 years ago

Attachment: vbox5214.png added

Missing toolbars.

comment:2 by msschabh, 6 years ago

Successfully reproduced the bug.

Workarround: Quitting VirtualBox via File -> Exit or CTRL+Q

Last edited 6 years ago by msschabh (previous) (diff)

comment:3 by faulty, 6 years ago

Just sharing additional notes:

I've tried manually editing ~/.config/VirtualBox/VirtualBox.xml and setting <ExtraDataItem name="GUI/Toolbar" value="false"/> to true. Upon running VBoxManager, the toolbar show up. But after closing it not using File -> Exit, the value in the xml reverted back to false.

If I close using File -> Exit, the whole entry disappear instead. I guess the next time when it load, it loads the default value instead.

comment:4 by msschabh, 6 years ago

@faulty: can confirm.

comment:5 by alfredo.ardito, 6 years ago

@faulty. I confirm the same issue.

comment:6 by dentar, 6 years ago

can confirm this with vbox 5.2.18 running in fedora28. Ctrl-Q (file->exit) keeps the settings, just closing the window reverts both settings to false

comment:7 by Eric Work, 6 years ago

I also see this issue on Fedora 28 running VirtualBox 5.2.18. I can right-click the menu-bar to re-enable them, but still it hides them again when I close the window using the corner "X".

comment:8 by krizb, 6 years ago

The same problem with VirtualBox-5.2-5.2.18_124319_fedora26-1.x86_64 on Fedora 28.

comment:10 by e2tux, 6 years ago

Hi, I can confirm the bug for several weeks now.

System: arch linux, kernel 4.18.9. VirtualBox: 5.2.18 r123745, Qt5.11.2

Config file VirtualBox.xml gets updated and changed every time the VirtualBox GUI is closed. I can enable the tool bar and status bar by settings "GUI/Statusbar" and "GUI/Toolbar" to "true" with an editor.

  • When application is opened and closed via "File -> Quit", the settings are kept.
  • When application is closed via windows close icon, the setting are changed to "false" and the bars are vanished next time I open VirtualBox GUI.

Any news here, any beta available that fixed the problem?

comment:11 by AlW, 6 years ago

I can also confirm this problem on Fedora 28 with VirtualBox 5.2.18 (was not present before that update).

I am now running the test build for r19, and the Toolbar and Status bar are behaving normally again, however there is still one remaining small problem - the Toolbar does not remember your selection of Snapshots or Details, and always reverts back to Snapshots.

In addition the problem with building the Guest Additions (in the guest) that arrived along with r18 is also fixed in r19.

comment:12 by kylef, 5 years ago

Finally found this bug report. Can confirm as well. Been happening for several months. Running Arch linux here.

comment:13 by Black_Fox, 5 years ago

The issue remains present and unchanged on vbox 5.2.20 (on both Fedora 28 and Fedora 29).

comment:14 by Ashark, 5 years ago

ArchLinux KDE and VirtualBox 5.2.20: bug still present.

For KDE users: to prevent you from normal window closing and make you use a file-exit workaround (ctrl+q), you may disable close button for virtualbox manager window. To do this press alt+f3 -> choose more actions -> special window settings -> go to appearance & fixes tab -> check Closable -> force -> No. Close button will not be shown after next start of VirtualBox.

comment:15 by vb5135041654640, 5 years ago

still present in 5.2.22 on debian sid (qt 5.11)

comment:16 by Volkmar, 5 years ago

The problem is very likely a race condition under certain Linux derivates. After closing the VirtualBox window Qt reports the Toolbar and the Statusbar always as hidden when the settings are saved. That's why the are always hidden after closing the window.

If you are able to compile VB on your own you can fix the problem by changing code in the following two files:

  • UISelectorWindow.h
  • UISelectorWindow.cpp

You can find this two files in the source directory under:

...src/VBox/Frontends/VirtualBox/src/selector/

This should work for versions 5.2.18 - 5.2.22.


In file UISelectorWindow.h search for (around line 337)

UIToolBar *m_pToolBar;

and replace it with

UIToolBar *m_pToolBar;
bool m_fIsToolBarHidden;
bool m_fIsStatusBarHidden;

In file UISelectorWindow.cpp search for (around line 1235)

case QEvent::WindowDeactivate:
{
    /* Make sure every status bar hint is cleared when the window lost focus. */
    statusBar()->clearMessage();
           break;

and replace it with

case QEvent::WindowDeactivate:
{
	  m_fIsToolBarHidden = m_pToolBar->isHidden();  	// remember toolbar state befor saving [VOLKMAR - 2018.11.10]
    m_fIsStatusBarHidden = statusBar()->isHidden(); // remember statusbar state befor saving [VOLKMAR - 2018.11.10]
    /* Make sure every status bar hint is cleared when the window lost focus. */
    statusBar()->clearMessage();
            break;

Next search for (around line 2160)

/* Save toolbar and statusbar visibility: */
{
    gEDataManager->setSelectorWindowToolBarVisible(!m_pToolBar->isHidden());
    gEDataManager->setSelectorWindowToolBarTextVisible(m_pToolBar->toolButtonStyle() == Qt::ToolButtonTextUnderIcon);
    gEDataManager->setSelectorWindowStatusBarVisible(!statusBar()->isHidden());

and replace it with

/* Save toolbar and statusbar visibility: */
{
    // gEDataManager->setSelectorWindowToolBarVisible(!m_pToolBar->isHidden());		[VOLKMAR 2018.11.10]
    gEDataManager->setSelectorWindowToolBarVisible(!m_fIsToolBarHidden);  	//  	[VOLKMAR 2018.11.10]
    gEDataManager->setSelectorWindowToolBarTextVisible(m_pToolBar->toolButtonStyle() == Qt::ToolButtonTextUnderIcon);
    // gEDataManager->setSelectorWindowStatusBarVisible(!statusBar()->isHidden()); [VOLKMAR 2018.11.10]
    gEDataManager->setSelectorWindowStatusBarVisible(!m_fIsStatusBarHidden);		// [VOLKMAR 2018.11.10]

Finally compile and run[[BR]]

If compiled with --disable-hardening you will find a file
VirtualBox
in the directory .../out/.../bin/
Simply run this file from the command line and see if your modifications work.


Disclaimer:

This information is given without any warranty. The recommended changes are not thoroughly tested. Changing the code may break your system! I don't take any responsibility!

comment:17 by gombara, 5 years ago

The fix for this (r126668) will be available in next test release.

comment:18 by gombara, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use