Jump to content











Photo
- - - - -

DiscUtils with .NET 2.0?


  • Please log in to reply
14 replies to this topic

#1 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 May 2013 - 05:13 AM

"It works on Windows XP (32 bits), Vista, 7 and 8 (32 and 64 bits).
You also need .NET Framework 4 to use the DiscUtils library and related tools (if you don't have it, the installer redirects you to a web page where you can download it)."

 

Not good :-(. I use WinXP (32 bits). Is possible change .NET Framework 4 to .NET Framework 2.0 for DiscUtils ?



#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 05 May 2013 - 09:23 AM

"It works on Windows XP (32 bits), Vista, 7 and 8 (32 and 64 bits).
You also need .NET Framework 4 to use the DiscUtils library and related tools (if you don't have it, the installer redirects you to a web page where you can download it)."

 

Not good :-(. I use WinXP (32 bits). Is possible change .NET Framework 4 to .NET Framework 2.0 for DiscUtils ?

 

Not directly. DevioNet.dll is basically designed in such a way that it requires shared memory and a few other features not available in .NET 2.0. But there are other ways to avoid .NET 4.0.

 

There is native devio.exe that can use DiscUtils built for .NET 2.0 through mixed mode dll files. Unfortunately, this has never been "packaged" in any useful way and it may be a little bit complicated to get it running. But I could of course make a simple zip file with all necessary components if that sounds like something of interest.



#3 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 May 2013 - 09:41 AM

I care mainly for connecting the VHD and VMDK images in WinXP SP2 Host OS. At the moment I'm using for this purpose:

 

For mount VHD images: vhdmount command line tool from MS Virtual Server 2005 R2 SP1 like this: http://www.vista.pl/...w_systemie.html

 

For mount VMDK images: VMware Workstation 8 menu tool: Map Virtual Disks...



#4 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 05 May 2013 - 11:36 AM

"It works on Windows XP (32 bits), Vista, 7 and 8 (32 and 64 bits).
You also need .NET Framework 4 to use the DiscUtils library and related tools (if you don't have it, the installer redirects you to a web page where you can download it)."

 

Not good :-(. I use WinXP (32 bits). Is possible change .NET Framework 4 to .NET Framework 2.0 for DiscUtils ?

 

.NET Framework 4 can be installed on XP SP3. If you can update, this would be probably the better solution.

But it seems some users have found a way to install it on XP SP2:

http://social.msdn.m...f5-2416980826e3

http://nowfromhome.c...windows-xp-sp2/



#5 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 May 2013 - 12:39 PM

Install .NET Framework 4 is not problem of course but I no want use this. I want mount VHD and VMDK images in WinXP SP2 with ImDisk :-)



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 May 2013 - 12:50 PM

@reboot12

Which KIND of .vhd's and vmdk's are you using? :dubbio:

If you are using only "monolithic" images drivers like Total Mounter or VDK can do that (as well as "plain" IMDISK), each at a "different" level of "integration" in the XP.

"Monolithic" images are RAW images with an "external descriptor file" in the case of vmdk's and with a single sector appended in the case of .vhd's, thus they can be treated as "plain", RAW, images.

 

:cheers:

Wonko



#7 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 May 2013 - 01:32 PM

I use default type disks from MS VPC 2007 and VMware Workstation 8



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 May 2013 - 02:01 PM

I use default type disks from MS VPC 2007 and VMware Workstation 8

They should be "monolithic".

i.e. being the same "full" size of the disk they represent.

 

Try simply mounting the .vhd file with IMDISK.

 

Check for the .vmdk, you should have two files, one is the actual image, the other one is the descriptor file, the descriptor will be very small, under 1 Kb.

 If you open it in Notepad, you will find in it the string "monolithicflat", the real image file often has the suffix -flat, but cannot say specifically for VMWare Workstation 8, if the descriptor file contains that string, try mounting the .vmdk file with IMDISK directly.

 

:cheers:

Wonko 



#9 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 May 2013 - 02:39 PM

VHD mount not working. String 'monolithicFlat' is in VMDK file but this also not mount in ImDisk :-(

 

In both cases, when try open mounted image VHD or VMDK appears message that the disk is not formatted.



#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 May 2013 - 02:53 PM

VHD mount not working. String 'monolithicFlat' is in VMDK file but this also not mount in ImDisk :-(

 

In both cases, when try open mounted image VHD or VMDK appears message that the disk is not formatted.

There is something that doesn't make sense (maybe an issue with language?)

 

Let's first understand the issue with the .vmdk.

 

EACH .vmdk is made of TWO files, BOTH with extension .vmdk.

The first (very small, under 1 kb) is a descriptor file, it's contents will be similar to (open in Wordpad):

 

test.vmdk

 

# Disk DescriptorFile
version=1
CID=90e5df4c
parentCID=ffffffff
createType="monolithicFlat"

# Extent description
RW 204800 FLAT "test-flat.vmdk" 0

# The Disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "203"
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"
ddb.adapterType = "ide"

in this example the descriptor file is named test.vmdk and the "real image file" is called "test-flat.vmdk".

You should try to mount with IMDISK the "large" file called "test-flat.vmdk".

IMDISK can mount that type of file.

 

Which version of IMDISK are you using?

How EXACTLY are you using it?

 

Post the contents of your .vmdk descriptor file.

 

:cheers:

Wonko



#11 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 May 2013 - 03:50 PM

1. In VMware Workstation 8 descriptor file is combined with main .vmdk disk image (please open .vmdk file e.g. in HEX editor)

2. I use ImDisk Version 1.7.1 - (Compiled Mar 28 2013)

3. Right click on vmdk image file and select Mount as ImDisk Virtual Disk with default options


Edited by reboot12, 05 May 2013 - 03:52 PM.


#12 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 05 May 2013 - 09:22 PM

This will mount first partition of C:\path\to\file.vmdk as drive R:. It runs on .NET 2.0.

 

devio --dll=iobridge.dll;dllopen shm:shmobj1 DiscUtilsStreamer.dll::DiscUtilsStreamer.ClassFactory::OpenDiskStream::C:\path\to\file.vmdk

imdisk -a -t proxy -o shm -f shmobj1 -m R:

 

It requires devio.exe, iobridge.dll, DiscUtilsStreamer.dll and DiscUtils.dll. I have now put together a 7-zip file with these:

http://www.ltr-data....tilsStreamer.7z

 

Hope this helps. To mount other partitions in image, use syntax for selecting partition number to devio.exe. For example for second partition, add 2 to the end of the devio.exe command line.



#13 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 06 May 2013 - 02:14 AM

This will mount first partition of C:\path\to\file.vmdk as drive R:. It runs on .NET 2.0.

 

devio --dll=iobridge.dll;dllopen shm:shmobj1 DiscUtilsStreamer.dll::DiscUtilsStreamer.ClassFactory::OpenDiskStream::C:\path\to\file.vmdk

imdisk -a -t proxy -o shm -f shmobj1 -m R:

 

It requires devio.exe, iobridge.dll, DiscUtilsStreamer.dll and DiscUtils.dll. I have now put together a 7-zip file with these:

http://www.ltr-data....tilsStreamer.7z

 

Hope this helps. To mount other partitions in image, use syntax for selecting partition number to devio.exe. For example for second partition, add 2 to the end of the devio.exe command line.

 

I found something weird: there is no version information in this DiscUtils.dll. The modification date let think it is more recent than a 0.11 you have provided before, but how to be sure?

By the way, I don't know how, but I have also a ImDiskNet.dll 1.0.7, and the one on your webpage is 1.0.6...

 

But, more important: it seems that devio does not support unicode file names. :(

Without this limitation, I would be able to include it in the toolkit and to remove the dependency to .NET 4...



#14 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 06 May 2013 - 04:54 AM

The version of DiscUtils.dll here is slightly modified to be compatible with .NET 2.0. You cannot use DiscUtils.dll directly from their website with this method. Also, this method lacks the entire concept of having DiscUtils.dll do the partition detection. This means a lot more limitations, like incompatibility with other than standard 4 partition MBR. As you have seen, Unicode is also not supported. Additionally, it needs more memory copying back and forth between natively handled shared memory and .NET managed buffers, since .NET 2.0 does not have support for shared memory built-in. So, in short, see this as a possible workaround if .NET 4.0 cannot be used. Otherwise, use DiscUtilsDevio as usual. :cheers:

#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 May 2013 - 06:50 AM

Due to one of the strange quirks the reply to  reboot12 could not be moved in this new thread, I am re-posting it here and removing it from the original thread:

 

1. In VMware Workstation 8 descriptor file is combined with main .vmdk disk image (please open .vmdk file e.g. in HEX editor)
2. I use ImDisk Version 1.7.1 - (Compiled Mar 28 2013)
3. Right click on vmdk image file and select Mount as ImDisk Virtual Disk with default options


Well, then the dual - file mode does not apply to VmWare Workstation 8. :(
 
You can still mount that kind of .vmdk by selecting in IMDISK the right offset for the Volume(s) inside it.
In that type of image the MBR can be at various offsets, checking one of those .vmdk I have handy it is at offset 327680, but this can vary:
http://reboot.pro/to...k-disk-volumes/
to which you (again "normally") you have to add 63 hidden sectors, thus the offset to the first volume is 359936 bytes (if the disk was partitioned under Windows Vista :ph34r: or later, the hidden sectors will be 2048 instead of 63, so the offset will be most probably 1376256).
It is not difficult to get the data from the image itself, I seem to remember that adding this kind of check to IMDISK has been talked about but never implemented by Olof:
http://reboot.pro/in...?showtopic=2220
But VDK normally works fine with these.
 
Now the .vhd, maybe it is one of the non-monolithic types? :unsure:
Which size is it (the file on disk) when compared to size into the VM?
 
:cheers:
Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users