Here is a simple entry for the ~/.magic file, which enables the file command to identify VDI files and print their size and uuid.
Code: Select all
# VirtualBox VDI
# Base on: http://forums.virtualbox.org/viewtopic.php?f=1&t=8046
#
0 string \x3c\x3c\x3c\ Sun VirtualBox VDI Disk Image
>64 string \x7F\x10\xDA\xBE
>68 byte x - Version %d
>70 byte x ^H.%d
>368 lequad x - Size: %lld
>392 lelong x - UUID: %lx
>396 leshort x -%x
>398 leshort x -%x
>400 beshort x -%x
>402 beshort x -%x
>404 belong x %lx
# file disk-image1.vdi
disk-image1.vdi: VirtualBox VDI Disk Image - Version 1.1 - Size: 10485760000 - UUID: 381c53ba-05ed-4de0-895c-4b47cf0bbb1e
HTH