Sorry for not answering any earlier - one need's just a bit of magic on
sfdisk and dmsetup:
# dd if=/dev/zero of=/tmp/zero count=63
# losetup -fv /tmp/zero
# echo -e "unit: sectors\n\n/dev/sda1 : start= 63, size= $( blockdev --getsz
/dev/sda1 ), Id=7" | sfdisk --force /dev/loop0
# echo -e "0 63 linear /dev/loop0 0\n63 $( blockdev --getsz /dev/sda1 ) linear
/dev/sda1 0" | dmsetup -v create virtdisk
# fdisk -lu /dev/mapper/virtdisk
On my tests I could at least fsck the partition - YMMV!
Henning
Am 28.09.2010 18:27, schrieb sam chan:
so looks like this functionality is just more involved
and complex than i realized. probably not worth the
effort, at this point, to try to hack my way through
it.
moving forward, would this be something that's worth
adding as an explicit feature to KVM?
-sam
On Tue, 28 Sep 2010, Richard W.M. Jones wrote:
> On Sun, Sep 26, 2010 at 12:11:45PM +0100, Daniel Sanabria wrote:
>> I know you can use vmware converter (i'm done this myself in the past) it
>> will allow you to convert local and remote physical machines into virtual
>> machines most likely in vkdm format that you can then run from kvm.
>>
>> Not sure if libguestfs or any other open source tool allows you to do this,
>> but I'd certainly love to see an open source alternative to this approach.
>
> You would need virt-p2v, but that doesn't solve the problem since it
> makes a copy of the Windows disk, and the requester wants to run the
> original in place.
>
> As Dor pointed out, this is more complex than it looks. If you just
> configure the guest to have for example:
>
> <disk type='block'>
> <source dev='/dev/sda1'/>
> <target dev='hda' bus='ide'/>
> </disk>
>
> then virtual Windows will see a block device containing the filesystem
> (no partition table). It's unlikely that Windows will even boot.
>
> Another way to do it is very hairy, but might just work:
>
> <disk type='block'>
> <source dev='/dev/sda'/>
> <target dev='hda' bus='ide'/>
> </disk>
>
> Of course now virtual Windows will see the host disk, so you'd need to
> be extremely careful not to modify the partition table or the Linux
> host partition from the guest (not to mention security concerns).
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
> virt-top is 'top' for virtual machines. Tiny program with many
> powerful monitoring features, net stats, disk stats, logging, etc.
>
http://et.redhat.com/~rjones/virt-top
> _______________________________________________
> virt mailing list
> virt(a)lists.fedoraproject.org
>
https://admin.fedoraproject.org/mailman/listinfo/virt
>
_______________________________________________
virt mailing list
virt(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/virt
--
Mit freundlichen Grüßen
i.A. Henning Rohde
AFC Auto Fleet Control GmbH
Wir machen mit Ihren Schäden kurzen Prozess.
Großmoorbogen 25
D-21079 Hamburg
Telefon +49 40 79 68 60 - 118
Telefax +49 40 79 68 60 - 815
www.autofleetcontrol.de
Amtsgericht: Hamburg HRB 69990 - Steuernummer: 47/700/00624
Geschäftsführer: Rüdiger Hoffmann, Daniel Schreiber