docker-archive/communitytools-image2docker-linux

Display a proper error message when guestfish can't read the VMDK file

Opened this issue · 5 comments

When running image2docker against a clean VM created in VMware or VirtualBox, I get the following error:

Current Result

$ i2d build ../vmware-test.vmdk
Running image transformation.
Creating container for v2c/guestfish-export:1
The packager failed with code: 1

Expected Result

Successfully created Dockerfile

Repro Steps

  1. Setup ubuntu 16.04 VM in VirtualBox or VMware Fusion
  2. Shutdown VM
  3. Run I2D against .vmdk file

It looks like the VMDK file was unreadable. We tried to load it into Fusion and it didn't like it.

We should also be more explicit in our docs about how to generate the VMDK files correctly.

@brandonroyal it looks like you didn't convert the VMDK file into a single, growable virtual disk. You can make this work with the vmware-vdiskmanager tool which is shipped with VMware Fusion and Workstation (although it looks like it's not shipped along w/ VMware Player unfortunately).

To run it, use the command vmware-vdiskmanager -r <source virtual disk> -t 0 <target virtual disk>. That will combine any split virtual disk files into one big shiny one.

@pdevine no luck :-(

$ vmware-vdiskmanager -r "Virtual Disk.vmdk" -t 0 mta-lab.vmdk
Creating disk 'mta-lab.vmdk'
  Convert: 100% done.
Virtual disk conversion successful.
$ i2d build ~/mta-lab.vmdk
Running image transformation.
Creating container for v2c/guestfish-export:1
The packager failed with code: 1

@pdevine The images have to be monolithic flat and not monolithic sparse. @brandonroyal the command you used was almost correct. Instead try:

vmware-vdiskmanager -r "Virtual Disk.vmdk" -t 2 mta-lab-flat.vmdk

@allingeek @pdevine unfortunately that doesn't seem to have done it either.

$ vmware-vdiskmanager -r "Virtual Disk.vmdk" -t 2 mta-lab.vmdk
Creating disk 'mta-lab.vmdk'
  Convert: 100% done.
Virtual disk conversion successful.
$ i2d build ~/mta-lab.vmdk
Running image transformation.
Creating container for v2c/guestfish-export:1
The packager failed with code: 1