Unpacking VMDK via 7z

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Unpacking VMDK via 7z

Dan Tran
Hi

I have a vmware's vmdk file with no problem to unpack using my windows 7z
command

however, common-compress error out at

    SevenZFile sevenZFile = new SevenZFile(my.vmdk.file)

with "Bad 7z signature" error message

am I missing something obvious?

Thanks

-D
Reply | Threaded
Open this post in threaded view
|

Re: Unpacking VMDK via 7z

Dan Tran
here is the stack trace

    Caused by: java.io.IOException: Bad 7z signature
        at org.apache.commons.compress.archivers.sevenz.SevenZFile.readHeaders(SevenZFile.java:326)
        at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:241)
        at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:108)
        at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:262)


Thanks

-D

On Fri, Aug 3, 2018 at 11:21 PM, Dan Tran <[hidden email]> wrote:

> Hi
>
> I have a vmware's vmdk file with no problem to unpack using my windows 7z
> command
>
> however, common-compress error out at
>
>     SevenZFile sevenZFile = new SevenZFile(my.vmdk.file)
>
> with "Bad 7z signature" error message
>
> am I missing something obvious?
>
> Thanks
>
> -D
>
Reply | Threaded
Open this post in threaded view
|

Re: Unpacking VMDK via 7z

Bernd Eckenfels
I guess the most simple explanation is that this is not a 7z Archive, have you tried the normal zip archives instead? (The 7zip program supports multiple formats)

--
https://Bernd.eckenfels.net

________________________________
Von: Dan Tran <[hidden email]>
Gesendet: Samstag, August 4, 2018 6:27 PM
An: Commons Users List
Betreff: Re: Unpacking VMDK via 7z

here is the stack trace

Caused by: java.io.IOException: Bad 7z signature
at org.apache.commons.compress.archivers.sevenz.SevenZFile.readHeaders(SevenZFile.java:326)
at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:241)
at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:108)
at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:262)


Thanks

-D

On Fri, Aug 3, 2018 at 11:21 PM, Dan Tran <[hidden email]> wrote:

> Hi
>
> I have a vmware's vmdk file with no problem to unpack using my windows 7z
> command
>
> however, common-compress error out at
>
> SevenZFile sevenZFile = new SevenZFile(my.vmdk.file)
>
> with "Bad 7z signature" error message
>
> am I missing something obvious?
>
> Thanks
>
> -D
>
Reply | Threaded
Open this post in threaded view
|

Re: Unpacking VMDK via 7z

Stefan Bodewig
In reply to this post by Dan Tran
On 2018-08-04, Dan Tran wrote:

> here is the stack trace

>     Caused by: java.io.IOException: Bad 7z signature
> at org.apache.commons.compress.archivers.sevenz.SevenZFile.readHeaders(SevenZFile.java:326)

This means Commons Compress doesn't recognize the file as a 7z
archive. A 7z archive Compress knows to deal with starts with the six
bytes

37 7A BC AF 27 1C

- the first two bytes are "7z" - and your archive doesn't seem to do so.

The 7z utility supports a lot of formats beyond 7z, maybe it does
support vmdks directly? If the vmdk format is
https://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf or
something similar then Commons VFS would look like a more natural place
for support than Compress IMHO.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unpacking VMDK via 7z

Dan Tran
Hi Stefan,

Thanks for the explanation

my vmware's vmdk file starts out with 'KDMV'.  This explains about the
stack trace.

additional info

  * 7z for windows can uncompress it,  but not 7z for linux, and winzip for
windows
  * commons-vfs does not support 7z/vmdk format.
https://commons.apache.org/proper/commons-vfs/filesystems.html

so 7z for windows is the only option which I can't use since my CI is on
Linux

Thanks

-Dan



On Sun, Aug 5, 2018 at 7:45 AM, Stefan Bodewig <[hidden email]> wrote:

> On 2018-08-04, Dan Tran wrote:
>
> > here is the stack trace
>
> >     Caused by: java.io.IOException: Bad 7z signature
> >       at org.apache.commons.compress.archivers.sevenz.SevenZFile.
> readHeaders(SevenZFile.java:326)
>
> This means Commons Compress doesn't recognize the file as a 7z
> archive. A 7z archive Compress knows to deal with starts with the six
> bytes
>
> 37 7A BC AF 27 1C
>
> - the first two bytes are "7z" - and your archive doesn't seem to do so.
>
> The 7z utility supports a lot of formats beyond 7z, maybe it does
> support vmdks directly? If the vmdk format is
> https://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf or
> something similar then Commons VFS would look like a more natural place
> for support than Compress IMHO.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Unpacking VMDK via 7z

Stefan Bodewig
On 2018-08-05, Dan Tran wrote:

> Thanks for the explanation

> my vmware's vmdk file starts out with 'KDMV'.  This explains about the
> stack trace.

> additional info

>   * 7z for windows can uncompress it,  but not 7z for linux, and winzip for
> windows
>   * commons-vfs does not support 7z/vmdk format.
> https://commons.apache.org/proper/commons-vfs/filesystems.html

I'm not an expert at all, but I think vmdk is not really related to 7z
at all, it just happens that 7z (on Windows) can read vmdks. When I
suggested VFS would be a better fit I was thinking about which Commons
component would be a good home if anybody wanted to add support for
vmdks - not that support was already there. Sorry I was misleading you.

> so 7z for windows is the only option which I can't use since my CI is on
> Linux

A quick search lead me to
http://forensicswiki.org/wiki/VMWare_Virtual_Disk_Format_(VMDK) which
again linked to https://github.com/libyal/libvmdk/ which contains a tool
to mount vmdks as FUSE file systems on Linux (among ither things). So I
think there are more options if you dig deeper.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unpacking VMDK via 7z

Dan Tran
you are right,  the following command:

  7z i

shows all supported archive formats

will look into FUSE filesystem

Thanks

-D

On Sun, Aug 5, 2018 at 9:01 PM, Stefan Bodewig <[hidden email]> wrote:

> On 2018-08-05, Dan Tran wrote:
>
> > Thanks for the explanation
>
> > my vmware's vmdk file starts out with 'KDMV'.  This explains about the
> > stack trace.
>
> > additional info
>
> >   * 7z for windows can uncompress it,  but not 7z for linux, and winzip
> for
> > windows
> >   * commons-vfs does not support 7z/vmdk format.
> > https://commons.apache.org/proper/commons-vfs/filesystems.html
>
> I'm not an expert at all, but I think vmdk is not really related to 7z
> at all, it just happens that 7z (on Windows) can read vmdks. When I
> suggested VFS would be a better fit I was thinking about which Commons
> component would be a good home if anybody wanted to add support for
> vmdks - not that support was already there. Sorry I was misleading you.
>
> > so 7z for windows is the only option which I can't use since my CI is on
> > Linux
>
> A quick search lead me to
> http://forensicswiki.org/wiki/VMWare_Virtual_Disk_Format_(VMDK) which
> again linked to https://github.com/libyal/libvmdk/ which contains a tool
> to mount vmdks as FUSE file systems on Linux (among ither things). So I
> think there are more options if you dig deeper.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>