Jump to content











Photo
- - - - -

VirtualBox image (VDI) proxy for ImDisk

vdi imdisk proxy

  • Please log in to reply
3 replies to this topic

#1 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1914 posts
  • Location:Nantes - France
  •  
    France

Posted 06 January 2017 - 02:03 PM

Hi,

 

I had done a few proxies for ImDisk in the past based on the libyal libraries (vmdk, qcow, vhd, ewf).

This time, as the VDI image format is quite simple, I made my own proxy for VDI images.

Imdisk + Discutils could achieve the same except that discutils requires .Net 4.0 which is not always available.

 

It is an early version (no error handling) and I was able to test dynamic images only.

 

It supports only "read only" for now but it should easy enough to implement "read write" if requested.

 

As always the command line :

"server" -> devio --dll=proxy.dll;dllopen shm:test_proxy c:\temp\freedos.vdi
"client" -> imdisk -a -t proxy -o shm -o ro -f test_proxy -m x:
Use the start command in front of devio if you want to stuff it all in one batch.
 

Regards,

Erwan

 

PS: Devio should output something similar to the below.

File to open: c:\temp\freedos.vdi
szFileInfo:<<< Oracle VM VirtualBox Disk Image >>>

u32Signature:BEDA107F
u32Version:65537
cbHeader:400
u32Type:1
fFlags:0
szComment:
offBlocks:4096
offData:8192
cCylinders:0
cHeads:0
cSectors:0
cbSector:512
cbSector:0
cbDisk:524288000
cbBlock:1048576
cbBlockExtra:0
cBlocks:500
cBlocksAllocated:108
Successfully opened 'c:\temp\freedos.vdi'.
Read request - size:1536 offset:0
vdi_read_buffer_at_offset - size:1536 offset:8192
Image size used: 524288000 bytes.
Read request - size:512 offset:0
vdi_read_buffer_at_offset - size:512 offset:8192
Detected a master boot record at sector 0.
Using partition 1.
Total size: 524288000 bytes. Using 523805184 bytes from offset 32256.
Required alignment: 1 bytes.
Buffer size: 2097152 bytes.
Shared memory operation.
Waiting for connection on object test_proxy. Press Ctrl+C to cancel.
Connection on object test_proxy.
Read request - size:512 offset:32256
vdi_read_buffer_at_offset - size:512 offset:40448
Read request - size:8192 offset:32256
vdi_read_buffer_at_offset - size:8192 offset:40448
Read request - size:126976 offset:36352
vdi_read_buffer_at_offset - size:126976 offset:44544
Read request - size:4096 offset:288768
vdi_read_buffer_at_offset - size:4096 offset:296960
Connection closed.
Close request
Image close result: 0

Attached Files


  • Olof Lagerkvist and Biatu like this

#2 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1914 posts
  • Location:Nantes - France
  •  
    France

Posted 06 January 2017 - 04:05 PM

Version 0.2

 

Read write support : the proxy will allocate new 1MB blocks on the fly, if needed

Attached Files


  • Olof Lagerkvist and Biatu like this

#3 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 06 January 2017 - 10:55 PM

Great work! Thanks! :good:



#4 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1914 posts
  • Location:Nantes - France
  •  
    France

Posted 08 January 2017 - 04:41 PM

Version 0.3

 

Some basic error checking.

 

The proxy now uses an external library (libvdi.dll) which could be used for other purposes (such as a provider for Arsenal Mounter or else).

 

The zip file also includes the delphi source file of the imdisk proxy to eventually help others use libvdi.dll.

Attached Files


  • Biatu likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users