VirtualBox

Opened 4 years ago

Last modified 2 years ago

#20155 new defect

"VBoxManage convertfromraw --format=vdi" silently fails?

Reported by: ebo Owned by:
Component: other Version: VirtualBox 6.1.18
Keywords: Cc:
Guest type: Linux Host type: Linux

Description

I have a raw image that perfectly runs with qemu-kvm, obtained with a Ubuntu Server headless install.

I'm trying to convert this raw image to VDI using VBoxManage, but it appears to fail while not providing any error message.

More precisely, here is what happens:

1) I run this command :

$ VBoxManage convertfromraw --format vdi output/mini-ubuntu-base.img output/mini-ubuntu-base.vdi

2) It prints what follows and appears to be running (and my CPU load does tell it is running):

Converting from raw image file="output/mini-ubuntu-base.img" to file="output/mini-ubuntu-base.vdi"...
Creating dynamic image with size 21474836480 bytes (20480MB)...

3) *While* it is running, using a second terminal, I can see that a VDI file is being created :

$ ls -lah output | grep vdi
-rw-------. 1 ebo ebo 6,5G 26 janv. 10:28 mini-ubuntu-base.vdi

4) But then, when the 'VBoxManage' command returns… the VDI file has disappeared!

$ ls -lah output | grep vdi
<nothing>

Which means something went wrong somewhere I suppose, but I tend to believe that some output should tell so?

Additional note: I have other raw images obtained through a similar process that I manage to convert into VDI using VBoxManage without problem using my current environment.

Change History (3)

comment:1 by ebo, 4 years ago

I just had the idea to try the same but with "qemu-img convert", and here is the result:

$ qemu-img convert -f raw -O vdi output/mini-ubuntu-base.img output/mini-ubuntu-base.vdi
qemu-img: error while reading at byte 14918090752: Input/output error

So it appears something is wrong with this file (even though it is runnable with qemu-kvm, strangely), but at least qemu-img does give me an error message, while "VBoxManage" had not given me any.

comment:2 by igntec, 4 years ago

VBoxManage indeed just exits without printing error message. If it was pedantic and print it, it would be the same "Input/output error". This error is returned by OS itself (VBoxManage just expects that everything will run smooth).

As message suggests, OS fails to read file at specific offset. Both, VBoxManage and qemu-img has to read through all img file to create vdi file. On the other hand, when you use img file in guest OS, qemu doesn't need to sweep through all image, it just reads some chunks on demand.

So it is the problem either with your img file, or most likely with your underlying file system. Try to run check disk utility, there might be bad sectors.

Last edited 4 years ago by igntec (previous) (diff)

comment:3 by Ralf Bergs, 2 years ago

Just to mention: This is still an issue in 7.0.6.

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette