8000 Issue when trying to read a XVA virtual disk · Issue #261 · DiscUtils/DiscUtils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Issue when trying to read a XVA virtual disk #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TH3xACE opened this issue Sep 5, 2022 · 9 comments
Open

Issue when trying to read a XVA virtual disk #261

TH3xACE opened this issue Sep 5, 2022 · 9 comments

Comments

@TH3xACE
Copy link
TH3xACE commented Sep 5, 2022

image

Any idea ? Everything is working fine with vmdk, vdi, vhd.... only having issue with XVA disks

@TH3xACE TH3xACE closed this as completed Sep 6, 2022
@TH3xACE TH3xACE reopened this Sep 6, 2022
@LTRData
Copy link
LTRData commented Sep 6, 2022

Looks like the XVA archive has an invalid timestamp for one of the files in the archive. If you open the XVA file in for example 7-zip or with tar -tlf file.xva, do you see anything strange with the date and time for any of the files?

@TH3xACE
Copy link
Author
TH3xACE commented Sep 7, 2022

Thanks for replying :) and btw great project :) really helpful... I think there was an issue since the file format of my file was qcow but the file extension .xva ... so I tried to use the .xva provided here > http://downloadns.citrix.com.edgesuite.net/11655/XenServer-7.0.0-dlvm.xva but it is also not working...

@zivillian
Copy link
Contributor

I've looked into this and can reproduce the issue. After digging a bit deeper, I can say that the example XVA is a gzipped tar file. After removing the additional gzip layer (by just decompressing it) it can successfully be read by discutils:
grafik

I don't know if the specification for XVA files changed or if the current implementation is just wrong. Is there an official specification for this format?

@TH3xACE
Copy link
Author
TH3xACE commented Sep 7, 2022

I think that this might give us an insight https://github.com/eriklax/xva-img

@zivillian
Copy link
Contributor

If I'm correct, this tool only works on the content of the XVA file - so you need to manually decompress and unpack the gzip and tar file before it will do anything useful. So it doesn't give us any hint regarding the initial file format.

@TH3xACE
Copy link
Author
TH3xACE commented Sep 7, 2022

I tried decompress the xva file then try to read it with discutil… the ova.xml is not the content of the disk… I wanted to list the parent directory of the disk

@TH3xACE
Copy link
Author
TH3xACE commented Sep 7, 2022

A file on the initial file gives this
image

@LTRData
Copy link
LTRData commented Sep 7, 2022

I just tried to decompress the gzip compressed file. I then renamed the resulting file .xva too, just in case. Then tried the following in PowerShell.

add-type -path .\DiscUtils.FileSystems.dll
add-type -path .\DiscUtils.Containers.dll
[DiscUtils.FileSystems.SetupHelper]::SetupFileSystems()
[DiscUtils.Containers.SetupHelper]::SetupContainers()
$xvafile = [IO.File]::OpenRead('XenServer-7.0.0-dlvm.xva')
$xva = [DiscUtils.Xva.VirtualMachine]::new($xvafile)
$disk = [System.Linq.Enumerable]::First($xva.Disks)
$volmgr = [DiscUtils.VolumeManager]::new($disk)
$volmgr.GetLogicalVolumes() | foreach { $fs = [DiscUtils.FileSystemManager]::DetectFileSystems($_)[0].Open($_); $fs.Root.GetFileSystemInfos() | foreach { $_.Name } }

Result:

lost+found
.vmlinuz-3.10.0-327.13.1.el7.x86_64.hmac
System.map-3.10.0-327.13.1.el7.x86_64
vmlinuz-3.10.0-327.13.1.el7.x86_64
initramfs-3.10.0-327.13.1.el7.x86_64.img
config-3.10.0-327.13.1.el7.x86_64
grub
symvers-3.10.0-327.13.1.el7.x86_64.gz
grub2
lost+found
mnt
bin
var
usr
.initialized
etc
root
tmp
lib64
lib
media
opt
home
builddir
sbin
completion_flag_file2
srv
sys
run
proc
dev

@TH3xACE
Copy link
Author
TH3xACE commented Sep 7, 2022

thanks will give it a try...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0