Jump to content











Photo
- - - - -

Virtual Disk Boot


  • Please log in to reply
15 replies to this topic

#1 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 September 2008 - 10:24 AM

A 'Standard' WB project
  • Builds a target directory
  • Creates a bootable ISO fcontaining this directory.
Is there a way to boot a PE in a virtual machine with a virtual boot drive built from outside?:
  • I have an empty formatted .VMDK disk (possible)
  • I mount this disk as e.g. drive K:(possible)
  • I copy the target directory to K: (??? 'I386' 'minint')
  • I do something to make the .VMDK bootable
  • I diskmount drive K: (possible)
  • I do some VBoxManagement work to register, ... start (possible)
Peter

#2 dog

dog

    Frequent Member

  • Expert
  • 236 posts

Posted 01 September 2008 - 12:14 PM

Sounds like Bart's peinst.cmd :whistling:

#3 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 01 September 2008 - 12:55 PM

Is there a way to boot a PE in a virtual machine with a virtual boot drive built from outside?:


Sure, why not, as long as:
1) the VM can manage VMDK files
2) the proper drivers for the VM simulated hardware are included in the build

Which is the actual question? :whistling:

of the list:
  • I have an empty formatted .VMDK disk (possible) - Yes, Qemu-img.exe
  • I mount this disk as e.g. drive K:(possible) - Yes MBRBATCH(modified if needed or other tool for the MBR) + VDK
  • I copy the target directory to K: (??? 'I386' 'minint') - Yes minint if SETUPLDR.BIN not hexedited, anything 4 to 6 characters if hexedited
  • I do something to make the .VMDK bootable (possible) - Yes, standard Windows NT/2K/XP/2003 FORMAT
  • I diskmount drive K: (possible) Yes, VDK
  • I do some VBoxManagement work to register, ... start - (possible) Cannot say
;)

jaclaz
[/list]

#4 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 01 September 2008 - 01:36 PM

Peter - it gets much easier if you work with a vmdk that is already bootable - just create it once inside a VM and only keep minimal boot-files like ntdetect.com, boot.ini and so on.
Then you can just mount the disk with vdk and copy your minint-dir or ramloading image in place.

Ulli

#5 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 September 2008 - 02:50 PM

very good idea,

boodsdi method: .img in iso

for now i can put iso in iso (like bootsdi)

but putting iso in vmdk would be very better for my timpack trials :whistling:
maybe bootsect.exe /nt52 O: /force (O: is mounted .vmdk image)
and putting required files (boot.ini, ntldr, etc) may work.

i am very new to .vmdk, you are the master peter, i support the idea ;)

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 September 2008 - 05:03 PM

Sure, why not, as long as:
1) the VM can manage VMDK files
2) the proper drivers for the VM simulated hardware are included in the build

Which is the actual question? :whistling:

of the list:

  • I have an empty formatted .VMDK disk (possible) - Yes, Qemu-img.exe
  • I mount this disk as e.g. drive K:(possible) - Yes MBRBATCH(modified if needed or other tool for the MBR) + VDK
  • I copy the target directory to K: (??? 'I386' 'minint') - Yes minint if SETUPLDR.BIN not hexedited, anything 4 to 6 characters if hexedited
  • I do something to make the .VMDK bootable (possible) - Yes, standard Windows NT/2K/XP/2003 FORMAT
  • I diskmount drive K: (possible) Yes, VDK
  • I do some VBoxManagement work to register, ... start - (possible) Cannot say
;)

jaclaz
[/list]

Thanks Jaclaz.
Tha actual question are the items w/o (possible)
The items w/ (possible) I already can perform.
But in item #2: I currently can mount / dismount with vdk. But what's the sence of MBRBATCH?
Maybe this is the the key issue?

Peter

#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 September 2008 - 05:11 PM

Peter - it gets much easier if you work with a vmdk that is already bootable - just create it once inside a VM and only keep minimal boot-files like ntdetect.com, boot.ini and so on.
Then you can just mount the disk with vdk and copy your minint-dir or ramloading image in place.

Ulli

Thanks, Ulli.
But your solution would cause that I have to distribute a bootable VMDK file with some M$ files on it. And that is out of legality.

My final solution has to build everything from scratch, only using an Install CD, (maybe the user's system) and some freeware tools.

Peter

#8 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 01 September 2008 - 05:47 PM

@psc
May I first ask you why you want to use a .vmdk format instead of a RAW image?

Personally I would prepare a normal RAW image and then convert it to .vmdk (or to .vdi).

The problem with VDK is that an image mounted through it, though it is "seen" as \\.\Physicaldriven, it is not seen by Disk Manager, in other words you cannot partition it, i.e. write to it the MBR (at least the partition table and "magic bytes" 55AA are needed - no need to write to it the booting code).

So you need to write a MBR with some other method (like MBRBATCH/MKIMG do) and then mount the image, this time VDK will mount properly the partition(s) even if not yet formatted.

Then you simply run FORMAT on the partition(s) and, if you did not write the whole MBR, use an utility like MBRFIX to write the code, and, if needed the disk signature.

At this point you can copy whatever you need to to the image and unmount it.

This RAW image can be converted with qemu-img.exe from RAW to:
vpc (Virtual PC)
vmdk (VMware)
qcow (Qemu format)
+ a few more

Using Vboxmanage you can use the convertdd directive to convert to .vdi (static) if I am not mistaken.

jaclaz

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 September 2008 - 06:05 PM

@psc
May I first ask you why you want to use a .vmdk format instead of a RAW image?

Personally I would prepare a normal RAW image and then convert it to .vmdk (or to .vdi).

The problem with VDK is that an image mounted through it, though it is "seen" as \\.\Physicaldriven, it is not seen by Disk Manager, in other words you cannot partition it, i.e. write to it the MBR (at least the partition table and "magic bytes" 55AA are needed - no need to write to it the booting code).

So you need to write a MBR with some other method (like MBRBATCH/MKIMG do) and then mount the image, this time VDK will mount properly the partition(s) even if not yet formatted.

Then you simply run FORMAT on the partition(s) and, if you did not write the whole MBR, use an utility like MBRFIX to write the code, and, if needed the disk signature.

At this point you can copy whatever you need to to the image and unmount it.

This RAW image can be converted with qemu-img.exe from RAW to:
vpc (Virtual PC)
vmdk (VMware)
qcow (Qemu format)
+ a few more

Using Vboxmanage you can use the convertdd directive to convert to .vdi (static) if I am not mistaken.

jaclaz

Thanks, Jaclaz, for your expert questions.
  • To make the future easier, let me explain
    • first: (As you know) my knowledge about booting: "It sometimes works"
    • second: The history:
      I'M working on the nativeEx_trackWBInstall project.
      Here you boot into a minimized PE system (no explorer, no network, only cmd):
      You do the setup of a new program, and my program trackWBInstal generates a complete WB script including reg entries, directories to create, files to copy etc.
      In order to be complete the PE is minimized. A full PE will not detect 'changes' wich are already in the system.
  • Now the issue:
    To install apps, the PE of course has to be writable.
    The solutions BootSDI and FBWF demand some licensed files which cannot be distributed with the script.
    And some users do not have access to those files and cannot use BootSDI or FBWF.
    Therefore my idea:
    I already have a .VMDK to transfer the trackWBInstall results to the host.
    Why not use the VMDK as the PE OS?
I'm not fixed in VMDK. If the same result is possible with a raw image, why not?

Peter

BTW: I forgot to say: For nativeEx_trackWBInstall I use VBox and want to use VBox in the future.
It gives me 'all' posiibilities to manage from within a WB script.

Edited by psc, 01 September 2008 - 06:12 PM.


#10 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 01 September 2008 - 06:05 PM

But your solution would cause that I have to distribute a bootable VMDK file with some M$ files on it. And that is out of legality.


Yes - i agree - so what about using a partitioned vmdk instead ? - this would work around the problems Jaclaz mentioned.

Ulli

#11 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 01 September 2008 - 06:31 PM

peter,
I am still missing the point. :whistling:

Where will the result of your work expected to run?

I mean in a VM of some kind or on "real hardware"?

For the first, as seen images formats are convertible, and for small images, there is no need for some of the features of the "Virtual Machine" formats, like multiple parts, etc.

For the second we are back to square one, see my semi-rant here:
http://www.boot-land...topic=5512&st=9

@sanbarrow
Is the .vmdk format "Free" ?
And what if one needs an image slightly bigger or smaller than the given one?

I think that the approach of building the image "on the spot" is anyway the better one, it may not be the most practical or the easiest one, but is without any doubt the most elegant.

jaclaz

#12 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 September 2008 - 06:56 PM

I am still missing the point. :whistling:

Where will the result of your work expected to run?

I mean in a VM of some kind or on "real hardware"?

Sorry, I'm not a good 'explainer'

'My work' is a WB project which will run on VBox only (and I hope, with your help by booting a PE from a VMDK disk)

'My Work' produces a WinBuilder Script which
  • In the host is copied from th mounted VMDK into an external WinBuilder project
  • Is processed there w/o any realtionship to the VMDK OS where it has been created.
  • And the Winbuilder project creates an ISO / USB boot etc, ...
    Which contains the above script w/o any realtionship to the VMDK OS where it has been created.
Peter

#13 cdob

cdob

    Gold Member

  • Expert
  • 1440 posts

Posted 01 September 2008 - 07:05 PM

What about a RAW image as a .vmdk?

VDK and VMware can mount the same image.

hd50.pln
DRIVETYPE ide

CYLINDERS 101

HEADS 16

SECTORS 63

ACCESS "..\CD\hd50_PE.img" 0 102400

hd50.vmdk
# Disk DescriptorFile

version=1

CID=ade2d977

parentCID=ffffffff

createType="monolithicFlat"



# Extent description

RW 102400 FLAT "..\CD\hd50_PE.img" 0



# The Disk Data Base 

#DDB



ddb.adapterType = "ide"

ddb.geometry.sectors = "63"

ddb.geometry.heads = "16"

ddb.geometry.cylinders = "101"

ddb.virtualHWVersion = "3"

ddb.toolsVersion = "0"


#14 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 01 September 2008 - 07:18 PM

Is the .vmdk format "Free" ?


Oh dear - ask a lawyer :whistling:

VMware has published specifications of the format and encourages everyone to create pre-build-VMs and share them.
The preallocated disktypes can be created with fsz.exe or contig.exe from scratch.

In the internet you can find thousands of prebuilt VMs ...

In my book this means vmdks can be freely distributed as long as they do not contain any copyrighted files.

Of course you are right - creating a vmdk from scratch is the most elegant way - but it is not easy for those of us that don't have 3 or 4 MBRs for breakfast like you ;)

If I understand Peter right he wants to offer something like a developement VM for the user.
If that is what he wants size doesn't matter much. In case he uses the sparse-growing type he just can make them large enough.
With latest MOA I also provide a developement VM with a 12 Gb vmdk - starts small and by the time it gets really big it should have done its work as a developement VM.

By the way - I posted that I provide a developement VM with a vmdk at VMware-forum. If they send their lawyers I guess I still have some hours to warn Peter in advance ;)

What about this ? - you name the size of vmdk you want - including the wanted partition-type. I host them on my site and tell VMware about it.
I am pretty sure there will be no objections

Ulli


@ Peter
just an idea ...
ask your users to run the first stage of a regular windows-installation against your vmdk. This makes the disk bootable and gets you around any redistributions problems.
Just create a VirtualBox or VMware VM and configure the Windows-CD for first boot. Then shutdown and exit the VM. Mount with vdk and feed your files into it ...

#15 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 01 September 2008 - 07:20 PM

You want to create "offline" an image containing a PE build that can be booted by VirtualBox, right?

Have you ever tried MBRBATCH/MKIMG to create a RAW image? :whistling:

Try now, use a geometry of 255/63, choose any filesystem you like, if creatng on a NTFS volume use mksparse, if not use fsz.

The image will be bootable (invoking NTLDR) and formatted by the batch, just copy to it any files you need (for tests NTLDR+BOOT.INI will be enough) before closing the Explorer window, VDK will be automatically removed.

Use qemu-img to convert to .vmdk.

Re-mount the converted image with VDK to check.

Try booting it in VMware or Qemu.

Try converting it to .vdi with Vboxmanage or "import" it on Virtualbox, it should work, though there are reports of failure in the conversion. ;)

In case, try again starting from the RAW image and compare the two .vdi's.....

jaclaz

P.S.: the batches already create a .pln file, changing them to create instead a .vmdk descriptor as cdob suggested is trivial, I also wrote a batch to create a .pln from RAW:
http://www.forensicf...m...89&start=30
modifying it should also pose no problem. I am sure you can get the needed parts from my "rude" batches and maybe write a "real" application, if you need help in explaining anything, just let me know.

#16 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 01 September 2008 - 07:52 PM

http://sanbarrow.com...opic.php?t=1162

an autoit-script that creates a descriptor-file for a *-flat.vmdk - can be any raw-image as well. Uses scsi-geometry




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users