Opened 7 years ago
Last modified 5 years ago
#17477 new defect
Compacting VDI file resulting in corrupt file system on High Sierra (APFS) — at Version 4
| Reported by: | DanielH | Owned by: | |
|---|---|---|---|
| Component: | VM control | Version: | VirtualBox 5.2.6 |
| Keywords: | compact, corrupt, file, vdi, mac, high sierra | Cc: | |
| Guest type: | Windows | Host type: | Mac OS X |
Description (last modified by )
I tried to compact a VirtualBox VDI file (Windows 10 Guest) with this commands on High Sierra 10.13.2 (17C205):
- VBoxManage modifymedium disk XXX.vdi --compact
- VBoxManage modifyhd XXX.vdi --compact
Both commands won´t finish and resulting in an corrupt file system (APFS) on the host.
After that I´m not able to show the VDI file or navigate to the VM folder which contains the VDI file. Finder crashes if I want to do that, Terminal also crahses and Time Machine Backups can´t finish if Time Machine passes that folder for backups...
I had to boot into recovery mode to repair the filesystem of my main Macintosh HD, after that I was able to remove the corrupt VDI file...
This is the second time I had that issue, fortunately I was able to repair my file system this time, the last time with macOS High Sierra 10.13.0 and VirtualBox 5.1.30 I ending with and corrupt file system and was not able to repair it, this means I completely had to restore my Mac...
Change History (4)
comment:1 by , 7 years ago
comment:2 by , 6 years ago
FWIW, I'm also getting this problem regularly. I'm on a laptop with limited SSD drive space, and not being able to shrink is causing real problems.
I acknowledge that AFPS bugs are not your problem, but I suspect the problem may be triggered by the VBoxManage tool 'not finishing' due to it's taking a very long time to complete.
For example, on my main VM, I have three VDI files. The smallest (10GB) one shrunk in a few minutes. The next largest (40GB) got to 90% on the command line output in about 4 minutes, but then stayed there for about an hour before actually completing. I'm currently trying to shrink the main VDI (150GB). It got to 90% in about 10 minutes, and it's been sitting there for around 8 hours now. I'm just hoping that it does eventually complete, because I know that if it doesn't reformatting my drive and recovering off time machine is the next step, and that's going to take about 4 hours and there goes most of my working day :-(
Realistically I can't dedicate more than about 12 hours to this process.
comment:3 by , 6 years ago
This problem still exists in VirtualBox 6.0.4 running on macOS Mojave 10.14.4. While I agree that the VirtualBox development team are not responsible for APFS bugs I do think they need to take ownership of this, report it to Apple and work on a solution with Apple. It's very annoying to repeatedly corrupt ones boot disk (necessitating a format and full restore more often then not) when trying to shrink a VDI file and most users will blame this on VirtualBox not Apple regardless of where the problem really lies.
comment:4 by , 5 years ago
| Description: | modified (diff) |
|---|


I don't see how we can be made responsible for bugs in APFS. The filesystem should never get into an inconsistent state by operations done through the standard file APIs which we use here. You should blame Apple for forcing APFS down the users throats...