Preference File (VirtualBox.xml) Empty Problem

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Alex T
Posts: 2
Joined: 28. Aug 2023, 07:04

Preference File (VirtualBox.xml) Empty Problem

Post by Alex T »

Hi all,

I'm going to do my best to describe this with the limited system information I have at this hour.

I have a friend that I provide tech support for and whom I set up with an install of VirtualBox on his 2017 Intel iMac (I think still on Big Sur) so he can run Cubase VST 32 in Windows XP and convert his old sheet music files to PDF as needed.

We are running into a frequent problem where his VirtualBox.xml preferences file will be empty when he next goes to use it, causing VirtualBox to refuse to launch. (See attached screenshot)
The only solution I've found online is to delete the empty file, then duplicate and rename the prev version and this gets everything running again -- for a time.

I just remoted into his machine yesterday to make this fix for him again and I just got a message that today it's already broken again. I had updated him to the latest version of VirtualBox maybe a month ago when I had previously tried to fix this, hoping it was a known bug that may had been fixed since the last time I'd worked on it for him.

Any ideas would be welcome, and please let me know if any additional information or log files would be helpful.
Attachments
vberror.jpg
vberror.jpg (122.12 KiB) Viewed 3039 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Preference File (VirtualBox.xml) Empty Problem

Post by scottgus1 »

This sort of thing has happened throughout the several years (a decade?) that I have been reading the forums. It isn't common to certain versions, so an upgrade won't solve it. (Further, upgrades, especially to 7.0, may not be compatible with earlier Mac OS versions, so going down that rabbit hole may cause more trouble.)

The Virtualbox service, on startup, reads Virtualbox.XML (and all the VMs' .vbox files) into memory, then over the time of running Virtualbox writes these files back to disk. Most likely, something on the host OS is preventing the Virtualbox service from writing Virtualbox.XML back to disk, which causes this empty file business.

It could be possible there's a glitch in the Virtualbox installation, a reinstall of the same version could solve it. There is definitely something wrong somewhere: this doesn't happen nearly as often as it is happening here.

A workaround is to put the fix steps in a batch file so your friend could run the batch file and have the problem fix itself when it happens. A robust batch file would query whether the VboxSVC service was still running, wait in a one-second-delay loop until the service has stopped, then do the delete/copy/rename process, then restart Virtualbox.

If your friend's Virtualbox is not going to change configuration, as in this XP VM, this setup only, nothing ever changes, you could make a further backup copy of Virtualbox.xml, just in case the prev copy also gets corrupted one day.
Alex T
Posts: 2
Joined: 28. Aug 2023, 07:04

Re: Preference File (VirtualBox.xml) Empty Problem

Post by Alex T »

Thanks for the response!

I'd come to the same conclusion, that somehow the OS was not allowing the file to be written. I'm just not sure why or when that's happening. Before I got off the screen share the other day, we opened and closed it multiple times. I also had him do it several times and made sure he would properly quit VirtualBox. Previously he'd force end the VM, and maybe leave the VirtualBox manager running until he eventually shut down the computer, so I showed him again the proper steps to shut down the VM and quit the manager.
My thought was that maybe some kind of improper shutdown was causing the file not to write/write properly. Since I wasn't able to reproduce the problem I'm not really sure when/how it is happening.

I don't think another reinstallation will help. I had reinstalled it when I was last there in person a month ago.

As for a batch file or script, I did think of that after making this post, at least as a workaround. Thank you for the suggestion about the service query as well -- I wouldn't have thought of that!

Overall, I think we'll try a batch file for now as a workaround, but I think we're just going to have to look at a backup and reinstall of the OS to rule out anything else going forward. I'd been thinking about doing it anyway because he could use a drive replacement. He has one of those Fusion drives installed -- the performance isn't great and I don't trust it to last too much longer. It's just an involved process removing the screen on this particular iMac so we've been putting it off!
Post Reply