balena-os / balena-image-flasher-unwrap

Tool for unwrapping balena-image from a balena-image-flasher
https://balena.io
Apache License 2.0
9 stars 2 forks source link

Add additional options to help with using images in virtualisation platforms #6

Closed richbayliss closed 4 years ago

richbayliss commented 5 years ago

Additional Options

--format [vdi/vhd/vmdk] For creating images suitable for various VM platforms.

--image-size xxG Set the block device image size, which will be expanded into when booting the image.

Auto-build Docker image

There is now no need to build the tool first, it will be built whenever the docker-run script is executed. This doesn't impact performance on subsequent runs.

Infer output image name from os-release in the image

The output image name is now dynamically pulled from the os-release file in the image being extracted.

Change-type: patch Signed-off-by: Rich Bayliss rich@balena.io

wngr commented 5 years ago

Just for the record, this is not working anymore with the recent version of balenaOS:

➜  resin-image-flasher-unwrap git:(add-extra-conversion-options) ✗ sudo ./resin-image-flasher-unwrap -f /tmp/balena-cloud-CTA-amd64-intel-nuc-2.38.2+rev1-v9.15.7.img -s 32G -F vmdk
[LOG]Unwraping resin image from the provided resin image flasher...
[LOG]Converting output image to target format: vmdk...
[LOG]Setting target disk image size...
qemu-img: Could not open '': The 'file' block driver requires a file name
➜  resin-image-flasher-unwrap git:(add-extra-conversion-options) ✗ sudo rm -rf /tmp/resin-image-flasher-unwrap*

But it does work with an older one.

➜  resin-image-flasher-unwrap git:(add-extra-conversion-options) ✗ sudo ./resin-image-flasher-unwrap -f /tmp/balena-cloud-CTA-amd64-intel-nuc-2.31.2+rev1-v9.11.1.img -s 32G -F vmdk
[LOG]Unwraping resin image from the provided resin image flasher...
[LOG]Migrating configuration from resin image flasher to resin-image...
[LOG]Unwrapping complete.
[LOG]Converting output image to target format: vmdk...
[LOG]Setting target disk image size...
Image resized.
Done.
agherzan commented 5 years ago

@richbayliss can you check what @wngr is reporting above?

odyslam commented 4 years ago

@richbayliss Followed the instructions using qemu-img to convert the extracted image to vhd and booted it successfully into hyper-v for windows 10.