LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Trying to convert VMWare image to raw using Qemu: error - "image open" (https://www.linuxquestions.org/questions/linux-software-2/trying-to-convert-vmware-image-to-raw-using-qemu-error-image-open-657295/)

JamesHall 07-21-2008 06:31 PM

Trying to convert VMWare image to raw using Qemu: error - "image open"
 
Hi all,

I'm trying to convert a VMWare virtual machine image (WinXP Home) to VirtualBox format. I found this article which explains how to do it:

http://blog.linuxconfig.org/convert-...virtualboxvdi/

... but I've hit a problem.

When I try and run the command "qemu-img convert -f vmdk Windows\ XP\ Home\ Edition.vmdk -O raw WinXPHome.bin", I get the following error message:

(VMDK) image open: flags=0x2 filename=Windows XP Home Edition.vmdk
qemu-img: Could not open 'Windows XP Home Edition.vmdk'

Does anyone know what this means, and what I can do about it?

The other thing is that when I set up the original virtual machine in VMWare, I used the option to create the hard disk as a number of smaller files, which are on my machine as Windows XP Home Edition-f001.vmdk through Windows XP Home Edition-f001.vmdk through Windows XP Home Edition-f005.vmdk inclusive. Assuming I can get the qemu-img convert command to work, the obvious thing to do would seem to be to convert all of these .vmdk images to .vdi format, but will this actually work?

Any advice or assistance would be greatly appreciated.

Hamidaddin 07-22-2008 04:59 AM

I don't know how to resolve the first issue I tried using "double quotes" around the file name and it worked for me. I am sure you are running the command in the right directory so that shouldn't be the problem...

For the second problem, you can use cat to combine the raw files into one file.

Check this link out. It explains how to do this in two simple commands:
(blog dot xwings dot net post number 47. I can't put the URL since it is my first post :( )

Anyway these are the commands:
Code:

    $ cd /path/to/vmware/guestos
    $ for i in `ls *[0-9].vmdk`; do qemu-img convert -f vmdk $i -O raw  {i/vmdk/raw} ; done
    $ cat *.raw >> guestos.img

If you go to the link you will have more alternatives to the second command since it did not work for some people.


All times are GMT -5. The time now is 12:41 PM.