Jump to content











Photo
- - - - -

Hyper-V


  • Please log in to reply
64 replies to this topic

#1 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2009 - 07:09 AM

Hi,

I have tried to start LiveXP in Hyper-V.

grub4dos loads OK, however when you select LiveXP the following is reported

Booting LiveXP
Will boot NTLDR from drive 0xef, partition=0xff(hidden sectors=0x0)

That's as far as it goes. I believe that the issue is because grub is looking for ntldr rather than setupldr.bin.

How might I resolve this error?

I am interested in using LiveXP because I am hoping that I can load the Integration Services (Hyper-V optimised drivers) into the LiveXP environment.

Thanks,
VW

#2 was_jaclaz

was_jaclaz

    Finder

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

Posted 22 November 2009 - 09:20 AM

I believe that the issue is because grub is looking for ntldr rather than setupldr.bin.


Veedub, rest assured that the "will boot NTLDR" is a "conventional" string, if you have
chainloader /setupldr.bin
in menu.lst or on command line, the actual chainloaded file will be setupldr.bin, grub4dos "recognizes" a NT loader, that can be either NTLDR or SETUPLDR.BIN (or one of them renamed to, say, goofy.wdc, the printed string on screen will anyway be "will boot NTLDR")

0xef is however (hd31) which commands/menu.lst entry are you using?

:cheers:

jaclaz

#3 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2009 - 09:43 AM

0xef is however (hd31) which commands/menu.lst entry are you using?

Extract from menu.lst in root of LiveXP.iso

color white/blue  black/light-gray

timeout 10

default 0



[[hook1]]



title LiveXP

chainloader /I386/SETUPLDR.BIN

I guess I could try entering the commands manually instead. But as you know I experienced a similar issue with grub4dos calling BartPE, in a Hyper-V environment just recently.

However I'm not familiar with the the LiveXP configuration and how to modify the configuration to call setupldr.bin directly for instance.

At this stage I would like to see if I can get LiveXP started with the minimum amount of effort so that I can see whether or not I can load the Integration Services drivers. If not I think I will try VistaPE as there is a post here that indicates that I ought to be able to get the drivers loaded in that environment. However the Integration Services drivers do load under XP-SP2 so I am hopeful that they will work in a PE environment that I am more familiar with.

#4 was_jaclaz

was_jaclaz

    Finder

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

Posted 22 November 2009 - 09:59 AM

We have a problem here.

I am not at all familiar with Hyper-V (whatever it is, I presume some kind of VM) and you seem like not familiar enough with grub4dos to attempt using alternate mappings/command line. :cheers:

And still I have my crystal ball in the shop. :dubbio:

Can you try to describe what you are doing and what you are using?

The fact that you are using a .iso comes in your second post, by pure chance. :w00t:

Is it a "normal" liveXp.iso?
Is it a BootSDi one (please read Ramdisk)?
How it is "mounted" or mapped" in Hyper-V?

Just boot grub4dos in your setup, press "c" to get to command line, do:
root (
[TAB]

which devices you have available?

jaclaz

#5 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2009 - 11:21 AM

I am not at all familiar with Hyper-V (whatever it is, I presume some kind of VM)

Yes, you're correct.

you seem like not familiar enough with grub4dos to attempt using alternate mappings/command line

Sadly that is true as well. grub4dos seems very powerful, but not always that easy to understand.



Can you try to describe what you are doing and what you are using?

I will do my best. :dubbio:

Hyper-V does not recognise USB devices. So to load a PE environment you either need to use a virtual hard disk or ISO image. My experience is with BartPE (my own build) mainly using USB, which I normally launch via grub4dos.

My first attempt at loading PE into Hyper-V, was using my Bart build on a virtual hard disk. Could not get grub4dos to start Bart, so ditched grub4dos. Having got BartPE running have tried to load the Integration Services (optimised virtual drivers) into the Bart environment. This has not worked, so I thought I would try LiveXP instead.

The fact that you are using a .iso comes in your second post, by pure chance. :w00t:

Sorry about that. I have started using LiveXP for the first time earlier today, I was under the impression that the only way it worked was as an ISO. I know even less about LiveXP at this point than grub4dos. I have worked through Lancelot's tutorial - I am using the recommended build with no modifications at this point.

I would like to get LiveXP to start, see whether I have more luck with the Integration Services drivers, if I do, then I will need to learn more about LiveXP - if not - I will have to try VistaPE I suspect.

Is it a "normal" liveXp.iso?

I believe so.

Is it a BootSDi one (please read Ramdisk)?

How it is "mounted" or mapped" in Hyper-V?

Loaded as an ISO image.

Just boot grub4dos in your setup, press "c" to get to command line, do:

root (
[TAB]

which devices you have available?

Possible disks are: fd0, hd0, rd, cd

Appreciate your patience, and your assistance.

Thanks!
VW

#6 was_jaclaz

was_jaclaz

    Finder

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

Posted 22 November 2009 - 11:36 AM

Possible disks are: fd0, hd0, rd, cd


Try:
root (cd)
[ENTER]

Should give you somethng like "accessing ISO9660 image ....." please post EXACT feedback.

chainloader /
[TAB]

chainloader /I386/
[TAB]

chainloader /I386/SETUPLDR.BIN
[ENTER]
"Will boot NTLDR...." please post EXACT feedback.

boot
[ENTER]

Loaded as a .iso image means "mapped to a virtual CD-ROM", right? :dubbio:

jaclaz

#7 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2009 - 11:48 AM

Try:

root (cd)
[ENTER]

Should give you somethng like "accessing ISO9660 image ....." please post EXACT feedback.

Filesystem type is iso9660, using whole disk

chainloader /I386/SETUPLDR.BIN
[ENTER]

Yes
Will boot NTLDR from drive=0xef, partition=0xff(hidden sectors=0x0)

boot
[ENTER]

Just sits there

Loaded as a .iso image means "mapped to a virtual CD-ROM", right?

Yes

#8 was_jaclaz

was_jaclaz

    Finder

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

Posted 22 November 2009 - 11:57 AM

Try another way.
Copy the LiveXP.iso to the virtual hard disk also. (I am presuming it is actually a file named "livexp.iso" and assuming that the file is put on first partition of the virtual hard disk)

In grub4dos (one line at the time):
root (h
[TAB]
coplete up to:
root (hd0,0)
[ENTER]
map /livexp.iso (hd32)
[ENTER]
map --hook
[ENTER]
root (hd32)
[ENTER]

chainloader /I

[TAB]
until:
chainloader /I386/SETUPLDR.BIN
[ENTER]
boot
[ENTER]

what happens?

The try again as above using "map --mem /livexp.iso (hd32)" instead of "map /livexp.iso (hd32)".

If you are "lucky", you should get a nice 0x0000007b BSOD. :dubbio:

jaclaz

#9 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2009 - 12:47 PM

In both cases, the chainloader command autocompletes OK and then all I get is a flashing cursor after boot.

If you need all the responses for each command I'll get you that tomorrow.

I am thinking that the rename approach perhaps might be easier in the short-term :dubbio: although it would be useful to have access to grub4dos. However as you indicated yesterday, it may be that grub & Hyper-V will not work together.

Thanks,
VW

#10 was_jaclaz

was_jaclaz

    Finder

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

Posted 22 November 2009 - 01:11 PM

Try with memdisk...:dubbio:

http://www.boot-land...?...ic=8258&hl=

root (hd0,0)

kernel /memdisk iso

append /livexp.iso

jaclaz

#11 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 24 November 2009 - 12:57 AM

I'd like to ditch using the ISO.

I can see that there is a Target\LiveXP directory under WinBuilder that appears to be the source for the ISO.

If I want to run LiveXP off a hard disk (or USB for that matter) without the ISO is there some type of peinst.cmd procedure?

I have tried formatting a partition and copying the contents of Target\LiveXP across but that does not appear to work.

#12 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 24 November 2009 - 01:33 AM

If I want to run LiveXP off a hard disk (or USB for that matter) without the ISO is there some type of peinst.cmd procedure?


there are good tutorials for this around (A heavy rain of links may come, besides i strongly advice to google first )

not my favorite method (And i do not advice this around), but it is simple and i guess this is what you are looking for:
* connect your ufd (usb flash disk) to your pc, ufd will be formatted so take your files away.
* Make a LiveXP build with create iso
* Apps\Supplementary\PeToUsb --> click launch button
* make settings something like that :
Posted Image

:dubbio:

#13 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 24 November 2009 - 12:20 PM

@Lancelot

I can see that there is a distinction between USB and HDD, I should not have mentioned USB.

Anyway I've since done some reading, but so far am unable to get LiveXP to start in the VM.

This is what I have tried:
- format 1GB partition using Disk Director (as I have it). I have also tried using Disk Mgt in XP with same outcome.
- set partition as Primary/Active within DD
- copy across all the files from WinBuilder Target directory
- to keep things simple at the moment I don't care about grub, so have tried to get LiveXP to start without using grub (I have been able to do this with BartPE)
- copy setupldr.bin from \I386 to root
- rename setupldr.bin NTLDR (is case significant?)
- copy modified NTDETECT.com from my Bart build

Here is my boot.ini
[Boot Loader]

Timeout=5

Default=C:\ntldr

[Operating Systems]

c:\ntldr="LiveXP"

When I start the VM all I get is a flashing cursor.

How to troubleshoot?

#14 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 November 2009 - 03:55 PM

How to troubleshoot?


Doing things in a given order?

NOT introducing any possible variations that come into your mind?

Doing one step at the time?

The list of things you last listed seems to me like a mishmash of bits and pieces put together without apparent reason. :)

WRONG things at first sight :thumbup::
  • Flashing cursor has NOTHING to do with the loader, it is a sign of a WRONGLY partitioned/formatted hard disk
  • If the loader is SETUPLDR.BIN, BOOT.INI will be ignored.
  • NTLDR through BOOT.INI can ONLY chainload:
    • a Windows install
    • a bootsector
    • grldr or grldr.mbr (which are crafted AS if they were a bootsector) <- Addition: some versions of grldr.mbr seemingly do not work, use C:\grldr ONLY
  • a PE on HD will use /minint as opposed to /I386
:)


Now be nice :rofl:, FORGET whatever you attempted and let's solve the flashing cursor problem.

Please forget about Acronis and let's start working with tools that we know how they behave. (and NO. Disk Director is not one of them)

WHICH kind of hard disk image does this Hyper-V thingie use?

RAW ones?

Or it can import VMware (.vmdk), Virtualbox (.vdi) or Virtual PC (.vhd)?

Or does it use only "real" physicaldrives?

:thumbup:

jaclaz

#15 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 24 November 2009 - 07:55 PM

Now be nice :), FORGET whatever you attempted and let's solve the flashing cursor problem.

Fair enough :thumbup:

WHICH kind of hard disk image does this Hyper-V thingie use?

RAW ones?

Not that I can see.

Or it can import VMware (.vmdk), Virtualbox (.vdi)

This may be possible, but not without special tools.

or Virtual PC (.vhd)?

Default disk image.

Or does it use only "real" physicaldrives?

This option is also offered, but I have been - and would prefer - to work with vhd.

Thanks,
VW

#16 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 November 2009 - 08:32 PM

This option is also offered, but I have been - and would prefer - to work with vhd.


Good. :thumbup:

Try reading these two threads:
http://www.boot-land...?showtopic=3191
http://www.boot-land...?showtopic=5000

Then FORGET them :), and try using the "simplified" approach:
http://www.boot-land...?showtopic=9033

You should come out with a valid RAW (or dd-like) image.

Add to it NTLDR (NOT setupldr.bin renamed) and a BOOT.INI with at least two entries.

Now read this seemingly unrelated thread:
http://www.boot-land...?showtopic=9715

You should come out with the same image converted to .vhd.

Try booting from it, you should be able to see the two choices in BOOT.INI.

If it doesn't work, go back to start and use MBRBATCH using a different geometry (small images often use 16/63 geometry instead of "usual" 255/63, as an example Qemu uses 16/63).

jaclaz

#17 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 25 November 2009 - 04:25 AM

Then FORGET them :thumbup:, and try using the "simplified" approach:
http://www.boot-land...?showtopic=9033

A very thorough post ... thank you ... which I have read and attempted to understand.

You should come out with a valid RAW (or dd-like) image.

Before I do anything I want to outline my understanding so I don't end up terminating my Hyper-V server inadvertently.

I think I should be running the command hddimage on a logical partition on the Hyper-V server (i.e. not in a VM but if you like against a physical disk).

hddimage will produce a disk image, which can be opened in Explorer.

Add to it NTLDR (NOT setupldr.bin renamed) and a BOOT.INI with at least two entries.

Presumably I include an entry in boot.ini to call grub, so that we can see whether grub works. The second entry in boot.ini will either be a dummy entry (or perhaps I could also make a copy of setupldr.bin in the I386 directory and rename it to NTLDR) and make the second entry reference that NTLDR. (an ode to Spacesurfer)

Now read this seemingly unrelated thread:
http://www.boot-land...?showtopic=9715

You should come out with the same image converted to .vhd.

I note that there are a few different conversion programs. I'll have a closer look at this thread when I've completed the first steps.

Try booting from it, you should be able to see the two choices in BOOT.INI.

I hope so!
This is more involved than I had expected, ignorance is bliss!

VW

#18 was_jaclaz

was_jaclaz

    Finder

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

Posted 25 November 2009 - 08:36 AM

I think I should be running the command hddimage on a logical partition on the Hyper-V server (i.e. not in a VM but if you like against a physical disk).

Yes, you just create a file under your "normal" OS, be aware that the thingy is intended for 2K/XP/2003.
If you run Vista/2008/Vista 7 you will need to make some changes to it (and later run a "bootsect.exe /nt52")
Or use a 2K/XP/2003 file to get the MBR.
An useful little app (just in case):
http://www.boot-land...?showtopic=7975

hddimage will produce a disk image, which can be opened in Explorer.

Better:
hddimage will produce a disk image, which will be mounted by VDK.EXE and that then can be opened in Explorer:
(Logical Drive through a drive letter) and accessed directly (Physical Drive as \\.\PhysicalDriven)

Presumably I include an entry in boot.ini to call grub, so that we can see whether grub works. The second entry in boot.ini will either be a dummy entry (or perhaps I could also make a copy of setupldr.bin in the I386 directory and rename it to NTLDR) and make the second entry reference that NTLDR. (an ode to Spacesurfer)

Yes/NO.
You can use this BOOT.INI allright:
http://diddy.boot-la...ws.htm#windows1

You won't have (anymore) a \I386 directory, since you are on HD, you will need a \minint one, not really, but I would wait before introducing yet another variation :thumbup::
http://www.911cd.net...showtopic=17504

BUT you are going a bit too "forward" and the ode to Spacesurfer, with all due respect :rofl: is quite frankly, immotivated :thumbup:.
We are actually trying ways to AVOID renaming things, as we like to call things with their name:
http://www.boot-land...?showtopic=2362

This application, if hopefully proven to be working, is particularly dedicated to our good spacesurfer, so that maybe he will stop going through half the internet suggesting to rename something to something else. ;) :)


I note that there are a few different conversion programs. I'll have a closer look at this thread when I've completed the first steps.

An additional intermediate step would be testing the dd-like image in Qemu (+ Qemu Manager) in order to make sure that it is fine before the conversion.


This is more involved than I had expected, ignorance is bliss!


Everything seems difficult the first time, but once you have got the "basis", things will speed up, what I sugggested is more complex than actually needed, in order to let you understand the single steps involved in making a bootable HD image:
  • create a file
  • write MBR code to it
  • write MBR data to it (partitioning)
  • write PBR and filesystem data (formatting)
  • write loader and files to it


:)

jaclaz

#19 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 26 November 2009 - 06:01 AM

Everything seems difficult the first time

It certainly does, there is a lot of assumed knowledge.

Having attempted this procedure, I am left wondering why simply formatting a drive in the VM does not work.

but once you have got the "basis", things will speed up

That is why I am persisting with this approach.

  • create a file

Done that using hddimage.cmd
Was able to mount using vdk.exe
Upon mounting Explorer immediately wanted to format the partition.

  • write MBR code to it

  • Is that accomplished by Explorer formatting the partition or do I need to do something with mbrbatch.cmd to copy the mbr from my XP and then write the mbr to the file?
    If additional steps beyond formatting the partition are needed, would appreciate clarification of these steps as this is an area that I am hazy on the detail.

  • write MBR data to it (partitioning)
  • write PBR and filesystem data (formatting)
  • write loader and files to it
  • Believe that I have completed these steps OK.

    Then need to convert the raw img to vhd.

    Looking at the qemu-img documentation it appears that vhd is not a recognised disk image format.

    Clonedisk appears to support vmdk only.

    Disk2vhd only operates on logical volumes / partitions - not image files.

    So it would appear that the only tool might be raw2vhd? I ask this question because I want to confirm that my understanding of the other tools in this thread

    Thanks,
    VW

    #20 was_jaclaz

    was_jaclaz

      Finder

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

    Posted 26 November 2009 - 09:50 AM

    MBRbatch or hddimage create the file and write a valid MBR (CODE and DATA) to it, then the image is mounted in VDK and formatted "normally".

    The image is ready, it has a drive letter and you can write files to it.

    Here is where it is advised to test the image in Qemu (optional - just to make sure)

    Now try using raw2vhd :)

    And NO, Disk2VHD would work as well... but it creates a "dynamic" kind of .vhd, which is something that is a bit "advanced".
    Unlike what you think, in it you do select a partition BUT the output will be that of A WHOLE disk comprising that partition:
    http://technet.micro...s/ee656415.aspx

    It will create one VHD for each disk on which selected volumes reside. It preserves the partitioning information of the disk, but only copies the data contents for volumes on the disk that are selected. This enables you to capture just system volumes and exclude data volumes, for example.

    the idea is that you have smaller images of multi-partitioned hard disks, but right now you have a single partition on your disk image, so it wouldn't make any difference.

    I don't think erwan.l is a liar :):
    http://www.boot-land...?showtopic=8480

    -dump a physical disk to a VHD file.


    In qemu-img the .vhd is called "vpc", but DO NOT use it, I just checked and it uses an old format for the .vhd ;).

    jaclaz

    #21 VeeDub

    VeeDub

      Frequent Member

    • Advanced user
    • 140 posts
    •  
      Australia

    Posted 26 November 2009 - 10:58 AM

    MBRbatch or hddimage create the file and write a valid MBR (CODE and DATA) to it, then the image is mounted in VDK and formatted "normally".

    The image is ready, it has a drive letter and you can write files to it.

    Thanks for explaining that.

    Here is where it is advised to test the image in Qemu (optional - just to make sure)

    Do you mean by using:
    qemu-img info
    or by trying the load the image into a qemu VM?

    Now try using raw2vhd

    Command appeared to run OK, interestingly it did not rename the img file.

    Having converted the img to vhd I copied the file across to the Hyper-V box, renamed the suffix from img to vhd and added into my LiveXP virtual machine.

    Started the virtual machine and ... wait for .... flashing cursor just as before ;) You have to laugh.

    So next step is to redo the above steps and test in qemu before proceeding any further.

    #22 was_jaclaz

    was_jaclaz

      Finder

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

    Posted 26 November 2009 - 11:09 AM

    Yes, I mean test the bootability in a Qemu vm, Qemu manager is a big help in using Qemu:
    http://www.davereyn.co.uk/download.htm

    jaclaz

    #23 VeeDub

    VeeDub

      Frequent Member

    • Advanced user
    • 140 posts
    •  
      Australia

    Posted 26 November 2009 - 11:17 AM

    Actually I think it is likely that the vhd is intact.

    Booted BartPE in the VM off a CD. Can view the vhd in Explorer and everything looks as it did in Explorer via vdk

    Also verified that the partition is Pri/Act

    This suggests to me that the issue is something more basic, as these symptoms are identical to what I was experiencing when creating a partition via Disk Management in the VM.

    #24 was_jaclaz

    was_jaclaz

      Finder

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

    Posted 26 November 2009 - 11:53 AM

    A disk or disk image can be "intact" but still not bootable.

    What I was trying to do is to make you create the HD image in a way that is "known" and documented.

    Now is the right time to:
    • see what happens in Qemu
    • use a hex editor on the UNmounted image and backup first (at least 64, but let's make it 200 sectors)

    Compress the file into a .zip archive and attach it to your next post.

    jaclaz

    #25 VeeDub

    VeeDub

      Frequent Member

    • Advanced user
    • 140 posts
    •  
      Australia

    Posted 26 November 2009 - 12:27 PM

    Now is the right time to:
    [list]
    [*]see what happens in Qemu

    Fortunately QEMU is consistent with Hyper-V, although slightly more informative. VM fails to boot.

    A disk read error occurred. Press Ctl+Alt+Del to restart


    I'll post the zip archive tomorrow.




    0 user(s) are reading this topic

    0 members, 0 guests, 0 anonymous users