Hi! Is there any experience of converting vmware''s vmdk file to a domU image? Maybe via extracting vmdk (how?) -> build tar -> untar in domU? That would be very nice despite replacing the original kernel with a self-built one and worthy to write a script... :) Cheers, Sven. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Lately I have been creating xen domU images using vmware. But what i usually do is do a basic install in vmware, then do something like: dd if=/dev/zero of=/osname bs=1024k count=size_megabytes mkfs.ext3 /osname mount -o loop /osnname /mnt cp -ax /mnt/{root,dev,var,etc,usr,bin,sbin,lib} /mnt mkdir /mnt/{proc,sys,home,tmp} chmod 777 /mnt/tmp umount /mnt gzip osname then i would FTP the image up to one of our xen servers and start testing, getting it running. The copying steps might be slightly different depending on what you want to copy across. This isn''t really the easiest way, but has been working great so far. Regards, Aaron Sven Uebelacker wrote:>Hi! > >Is there any experience of converting vmware''s vmdk file to a domU image? >Maybe via extracting vmdk (how?) -> build tar -> untar in domU? > >That would be very nice despite replacing the original kernel with a >self-built one and worthy to write a script... :) > >Cheers, >Sven. > >_______________________________________________ >Xen-users mailing list >Xen-users@lists.xensource.com >http://lists.xensource.com/xen-users > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I think you might be able to use qemu-img to do this. Do a search for ''qemu'' and download it. qemu-img is included as part of it and can supposively convert images. I think it handles vmdk''s but haven''t actually used it myself to do the conversion. I use qemu to install the base OS into a regular file and then use ''dd'' to rip the individual partitions out of the resulting file to get by root disk image. -- Ray -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com]On Behalf Of Sven Uebelacker Sent: Friday, September 30, 2005 11:27 AM To: xen-users@lists.xensource.com Subject: [Xen-users] porting vmware''s vmdk to domU Hi! Is there any experience of converting vmware''s vmdk file to a domU image? Maybe via extracting vmdk (how?) -> build tar -> untar in domU? That would be very nice despite replacing the original kernel with a self-built one and worthy to write a script... :) Cheers, Sven. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Friday 30 September 2005 18:57, Aaron // LT wrote:> Lately I have been creating xen domU images using vmware. But what i > usually do is do a basic install in vmware, then do something like: > > dd if=/dev/zero of=/osname bs=1024k count=size_megabytes > mkfs.ext3 /osname > mount -o loop /osnname /mnt > cp -ax /mnt/{root,dev,var,etc,usr,bin,sbin,lib} /mnt > mkdir /mnt/{proc,sys,home,tmp} > chmod 777 /mnt/tmpA bit offtopic, but I hope you don''t create your /tmp dir that way on a multiuser system, it is missing the sticky / "tempdir" flag. chmod 1777 /mnt/tmp would be better. For the original question: There''s a tool to loopback-mount the vmware images into the host os, have a look at: http://www.vmware.com/support/reference/linux/loopback_linux.html#what /Ernst _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I have never seen vmware-mount.pl or vmware-loop working properly, Everytime you try to mount, you would get "Unable to invoke vmware-loop", this seems to support older version(version 2) of vmdk files and not the newer ones. if you try to use vmware-loop(vmdk to NBD mapper) directly, it might give you "Unable to open the vmdk file" or something.... But give it a try, I believe qemu-img works better in this case and much more easier to use. #qemu-img convert -f vmdk /path/filename.vmdk -O raw /path/filename.raw # fdisk -l /path/filename.raw will give you the list of partitions...... showing that the conversion was good. Make sure to peel off the required partition from this image to a new image, because you cannot mount a disk, you can only mount a partition. supports vmware 3 and 4 images check: http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC18 -- Sharath On 10/1/05, Ernst Bachmann <e.bachmann@xebec.de> wrote:> > On Friday 30 September 2005 18:57, Aaron // LT wrote: > > Lately I have been creating xen domU images using vmware. But what i > > usually do is do a basic install in vmware, then do something like: > > > > dd if=/dev/zero of=/osname bs=1024k count=size_megabytes > > mkfs.ext3 /osname > > mount -o loop /osnname /mnt > > cp -ax /mnt/{root,dev,var,etc,usr,bin,sbin,lib} /mnt > > mkdir /mnt/{proc,sys,home,tmp} > > chmod 777 /mnt/tmp > > A bit offtopic, but I hope you don''t create your /tmp dir that way on a > multiuser system, it is missing the sticky / "tempdir" flag. > > chmod 1777 /mnt/tmp > > would be better. > > For the original question: > > There''s a tool to loopback-mount the vmware images into the host os, have > a > look at: > http://www.vmware.com/support/reference/linux/loopback_linux.html#what > > /Ernst > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, 30 Sep 2005 18:27:22 +0200, Sven Uebelacker wrote:> Hi! > > Is there any experience of converting vmware''s vmdk file to a domU image? > Maybe via extracting vmdk (how?) -> build tar -> untar in domU? > > That would be very nice despite replacing the original kernel with a > self-built one and worthy to write a script... :)Well, qemu comes with a command (qemu-img) that can convert between various image formats, such as: vpc bochs dmg cloop vmdk qcow cow raw You ought to be able to use that to convert the vmdk into a raw image, however it may not be sparse. I''ve never had to use the command myself, so it''d be interesting to hear how you go. Regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thank you all, qemu-img is a good hint! With vmware-mount.pl I had my problems as described by Sharath. Am Samstag, 1. Oktober 2005 00:40 schrieb Sharath Babu:> I believe qemu-img works better in this case and much more easier to use. > #qemu-img convert -f vmdk /path/filename.vmdk -O raw /path/filename.rawThis works although I use VMWare5... Just can''t use my snapshots.> # fdisk -l /path/filename.rawWell, a known qemu error message occurs "You must set cylinders."> Make sure to peel off the required partition from this image to a new > image, because you cannot mount a disk, you can only mount a partition.Can you give me a hint how to do that? Sven. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hint???? Hmm........ Not so easy to explain in just couple of lines. here is what you can do...... [root@localhost vmdk]# fdisk -l -u -C 592 linux.raw Disk sharath: 0 MB, 0 bytes 255 heads, 63 sectors/track, 592 cylinders, total 0 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System linux1 * 63 208844 104391 83 Linux linux2 208845 7341704 3566430 83 Linux linux3 7341705 8385929 522112+ 82 Linux swap Consider that we have to extract linux2, which is ext3 For this remember the formula (End - Start + 1) = count For linux2: Start = 208845 = skip(in "dd" command) End = 7341704 So we have count=(7341704 - 208845 + 1) = 7132860 Now there we are, we have all the necessary info to "peel" the required partition. Now give the following command [root@localhost vmdk]# dd if=linux.raw of=linuxpartition.raw bs=512 skip=208845 count=7132860 dd: writing `linuxpartition.raw'': No space left on device 1760697+0 records in 1760696+0 records out Thats it...... we have linuxpartition.raw which should be mounted [root@localhost vmdk]# mount -o loop -t ext3 linuxpartition.raw /mnt/vmdisk/ Hope, thats a hint...... ;-) Regards, On 10/5/05, Sven Uebelacker <uebelacker@tuhh.de> wrote:> > Thank you all, qemu-img is a good hint! > > With vmware-mount.pl I had my problems as described by Sharath. > > Am Samstag, 1. Oktober 2005 00:40 schrieb Sharath Babu: > > I believe qemu-img works better in this case and much more easier to > use. > > #qemu-img convert -f vmdk /path/filename.vmdk -O raw /path/filename.raw > > This works although I use VMWare5... Just can''t use my snapshots. > > > # fdisk -l /path/filename.raw > > Well, a known qemu error message occurs "You must set cylinders." > > > Make sure to peel off the required partition from this image to a new > > image, because you cannot mount a disk, you can only mount a partition. > > Can you give me a hint how to do that? > > Sven. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users