-
Notifications
You must be signed in to change notification settings - Fork 179
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
mount vdi vhd files #268
Comments
Not through the DiscUtils library itself. It is possible though for example Arsenal Image Mounter where we use DiscUtils library as backend when you mount certain image file formats. |
Yes I tried with Arsenal Imager. However, I think it does not support the file belonging to applications such as virtualbox. |
It should support all image formats supported by DiscUtils. Did you see any issues with some format? |
Yeah. virtual box does not open image files (.vdi) and bluestacks (.vhdx) |
I am not sure I follow. I regularly use AIM to mount vdi, vhdx, vmdk etc images myself. It uses DiscUtils library to parse such image files and then another driver to expose them as virtual disks to the system. |
you misunderstood me. I can read with DiscUtils but not mount with Arsenal |
Yes and that is what surprised me. Arsenal Image Mounter should support all image formats supported by DiscUtils, because it uses DiscUtils to parse the image files. Did you get any error messages when you tried? Or what more exactly happened? |
https://ibb.co/xCMfG78 https://ibb.co/C63d6rk Yes, it shows as added, even in disk manager, but I can't see it on my computer. |
Is it really a partition scheme and file system that is supported by Windows? I mean, if you would have attached a physical disk with the same contents to a Windows machine, would it have been possible to browse the file systems in Windows in that case? If it is not a Windows compatible file system in your images, you cannot directly mount the images as virtual disks in this way in Windows. You would need some kind of file system emulation layer as well. I have a project like that over at my fork of dokan-dotnet. It uses DiscUtils libraries not only to parse disk contents but also to access the file systems in the disk images and then it uses Dokan virtual file system driver to mount them as virtual file systems. They will not show up as disks in Disk Management and not accessible to applications looking for physical disks in any way, but it is possible to browse such file systems in Explorer in Windows. |
Thank you very much for writing so descriptively. Also, thank you for your interest. I think I understood where the problem is. As you said yes, if windows is a drive, it can display it as a disk. Since my vhdx is in Ext4 format, this is how I see it. I did some research in it and found the SharpExt4 library, but I'm not sure it will work. Sorry for my bad english. |
While Vhdx can be read with DiscUtils, shouldn't I export the contents? |
If you build DiscUtilsFs from that dokan-dotnet fork, you can do: You need to install Dokan first: |
Dokan is actually quite simple. The DiscUtilsFs project I linked to shows how to do it. You basically wrap a DiscUtils On the other hand, if all that you are looking for here is to copy files from a file system recognized by DiscUtils libraries, you do not really need a virtual file system or a drive letter visible in Windows Explorer. You could simply open each file in your |
Change
To
You don't need Dokan for this. It does not mount as virtual disk or file system in any way. It just reads and copies data directly. |
dude you are amazing thank you for helping me patiently. Finally, I have one more question to ask var disk = new DiscUtils.Xva.Disk(secilen.Text, System.IO.FileAccess.Read); When I make DiscUtils.Xva here, I see that the code is not working, where do you think I am going wrong? Also I need to do this in iso and img. |
You should really avoid specifying class of virtual disk in this way in your use case. Use the methods described here to use all available format support: Then, |
I want to display the structure I read in the treeview content. But I found that it doesn't read folder by folder in the loop. How can I do that.I can't thank you enough. |
There are other methods like |
I am using Xaml. How can I number each directory, can you show me on my sample code above? It returns a directory instead of a folder in the loop. I guess my logic wasn't enough :( |
Sorry, I cannot write the entire program for you. I think you need to ask someone more familiar with XAML/WPF etc for such questions. It is a bit out-of-scope for DiscUtils. |
Hello, with the method you have shown, I can easily copy a virtual machine image in windows structure to windows. The problem is that when I want to copy the contents of an image with a linux image to windows, I encounter errors due to filenames (* ? | < > :) how can I solve this? |
Search for those illegal Characters and replace them on the new name |
yes i tried that. 'replace' I guess it can't read because I read it on windows |
Ext? Install a driver for ext and then mount it normally and things should just work to copy from what I recall |
You're right, but to speed things up, I want to get around this problem without mounting. |
I even took the risk of incomplete copying. fs.OpenFile(name.Replace('*', '_'), FileMode.Open, FileAccess.Read); I tried 'catch (FileNotFoundException)' but the result did not change. It seems to be working without any errors but I've checked that it's not copying. the problem persists. |
Can I copy the image without decompressing? |
We have made lots of changes in the LTRData fork of DiscUtils regarding file name and symbolic link compatibility. Have you tried it and it does not work there either for some reason, I can take a look at why and how it happens and make a fix for it. |
Thanks for the fix, I really need it. How soon will you fix it? Also, if you have the opportunity to try, can you try to read an image with .vmdk extension, is there a problem with my vmdk? |
No, I meant that you could try first with the LTRData.DiscUtils fork of this repository. That will probably help because I recognize this kind of issues as something we had when we developed File system bypass mount mode in Arsenal Image Mounter. We managed to fix most of it by emulating slightly changed file names etc to make it work on Windows systems. But then if you see similar issues when using that fork too, then I can try to fix it. |
sourceStream.CopyTo(targetStream); > System.IO.IOException: 'Unable to find extent for block 0' |
Yes I've seen LTRData fix special characters. Strangely, I found it stuck on a file with the .version extension, and when I told it to skip it, it worked fine. |
That looks interesting. Do you know what kind of file that was? Anything special with it? Is it an image that you could share somewhere? |
https://ibb.co/wsTW9fM Of course... I guess it has something to do with null content. |
Then DiscUtils.Vmdk.Disk(textbox.Text, System.IO.FileAccess.Read); I detected that it is not reading the vmdk image. |
Sorry for the confusion! I meant, the image file that you are trying to read files from, is that an image that you could share somewhere? |
If I can reach you privately, this could be it. |
Yes no problem. E-mail me at olof@ltr-data.se |
okey. I sent an e-mail. |
Hi I am using Discutils library.
I can read the contents of my files with .vdi-.vdh-.vdhx extensions.
However, I want to copy these files or add them to the computer as a drive and copy them, is it possible?
The text was updated successfully, but these errors were encountered: