Hi, I am new to v2v/libguestfs. I need to convert a 30 GB virtual machine running Windows7 64 bit (a guest on a Linux system) from Virtualbox vdi format to qcow2 (or raw/img--another debate in itself) so I can use libvirt/qemu/kvm to run it and completely migrate away from Virtualbox. The vdi machine is a mission critical production environment and I cannot afford to mess it up, etc. Will keep original vdi intact until have successfully converted and tested. I have done some research and come upon v2v which seems to be just what the doctor ordered except that, in "local" man pages of version 1.36.4 which I have installed, there is NO mention of vdi compatibility as input format. However, on these online man pages <https://linux.die.net/man/1/virt-v2v> I see a section called "Local VirtualBox guests" which seems to indicate that vdi is indeed accepted as input format. Can anyone provide feedback as to the above? v2v seems to be a tool I could use to more easily deal with this conversion/migration than just using qemu-img convert and having to then deal with the other bits and pieces such as virtio drivers, etc. Thanks for any helpful feedback and pointers.
Richard W.M. Jones
2017-Aug-19 16:36 UTC
Re: [Libguestfs] Virtualbox vdi Input Format and man pages
On Sat, Aug 19, 2017 at 08:38:31AM -0600, stef204 wrote:> Hi, > > I am new to v2v/libguestfs.> I need to convert a 30 GB virtual machine running Windows7 64 bit (a > guest on a Linux system) from Virtualbox vdi format to qcow2 (or > raw/img--another debate in itself) so I can use libvirt/qemu/kvm to > run it and completely migrate away from Virtualbox. > > The vdi machine is a mission critical production environment and I > cannot afford to mess it up, etc. Will keep original vdi intact > until have successfully converted and tested.This is very good advice.> I have done some research and come upon v2v which seems to be just > what the doctor ordered except that, in "local" man pages of version > 1.36.4 which I have installed, there is NO mention of vdi > compatibility as input format. > > However, on these online man pages > <https://linux.die.net/man/1/virt-v2v> I see a section called "Local > VirtualBox guests" which seems to indicate that vdi is indeed > accepted as input format.Unfortunately the link documents the old version of virt-v2v (which we normally call "0.9"). The current version is a derivative of that, of sorts, but massively rewritten internally.> Can anyone provide feedback as to the above? > > v2v seems to be a tool I could use to more easily deal with this > conversion/migration than just using qemu-img convert and having to > then deal with the other bits and pieces such as virtio drivers, > etc.It's good that you mention ‘qemu-img convert’, because the significant difference between virt-v2v & plain qemu-img conversion is that virt-v2v will try to install virtio drivers. Installing virtio drivers in a Windows guest post-conversion is a PITA which is why virt-v2v may be better if you require virtio. So ... to the topic: We don't specifically test conversion from VirtualBox or .vdi. But it ought to work. You will need the virtio drivers from: https://fedoraproject.org/wiki/Windows_Virtio_Drivers You can either install that package so it appears under /usr/share/virtio-win, or you can use the .iso file from that package and set the VIRTIO_WIN environment variable to point to it: http://libguestfs.org/virt-v2v.1.html#environment-variables Do you have metadata from VirtualBox (number of CPUs, RAM, etc) in some format? If not, then you should probably use the ‘-i libvirtxml’ input method. You will have to write or modify the metadata, as documented here: http://libguestfs.org/virt-v2v.1.html#minimal-xml-for--i-libvirtxml-option I believe that virt-v2v should be able to transparently convert the .vdi source file. You might or might not need to use the ‘-if vdi‘ option. It's safe to run virt-v2v on the guest disk image (or a copy, if you want to be extra cautious), just to see if it can be converted. If it fails or gives warnings or errors, then please post the full output of ‘virt-v2v -v -x ....’ Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Rich, Thanks a lot for your detailed feedback, very helpful. Will follow your suggestions and post again here as needed. 19.08.2017, 10:36, "Richard W.M. Jones" <rjones@redhat.com>:> It's good that you mention ‘qemu-img convert’, because the significant > difference between virt-v2v & plain qemu-img conversion is that > virt-v2v will try to install virtio drivers. Installing virtio > drivers in a Windows guest post-conversion is a PITA which is why > virt-v2v may be better if you require virtio. > > So ... to the topic: We don't specifically test conversion from > VirtualBox or .vdi. But it ought to work. > > You will need the virtio drivers from: > https://fedoraproject.org/wiki/Windows_Virtio_Drivers > You can either install that package so it appears under > /usr/share/virtio-win, or you can use the .iso file from that package > and set the VIRTIO_WIN environment variable to point to it: > > http://libguestfs.org/virt-v2v.1.html#environment-variables > > Do you have metadata from VirtualBox (number of CPUs, RAM, etc) in > some format? If not, then you should probably use the ‘-i libvirtxml’ > input method. You will have to write or modify the metadata, as > documented here: > > http://libguestfs.org/virt-v2v.1.html#minimal-xml-for--i-libvirtxml-option > > I believe that virt-v2v should be able to transparently convert > the .vdi source file. You might or might not need to use the > ‘-if vdi‘ option. > > It's safe to run virt-v2v on the guest disk image (or a copy, if you > want to be extra cautious), just to see if it can be converted. If it > fails or gives warnings or errors, then please post the full output of > ‘virt-v2v -v -x ....’ > > Rich.
Only able to get to this now, but need additional help, if at all possible. See comments inline below. Thanks. 19.08.2017, 10:36, "Richard W.M. Jones" <rjones@redhat.com>:> On Sat, Aug 19, 2017 at 08:38:31AM -0600, stef204 wrote: >> Hi, >> >> I am new to v2v/libguestfs. > >> I need to convert a 30 GB virtual machine running Windows7 64 bit (a >> guest on a Linux system) from Virtualbox vdi format to qcow2 (or >> raw/img--another debate in itself) so I can use libvirt/qemu/kvm to >> run it and completely migrate away from Virtualbox. >>> > You will need the virtio drivers from: > https://fedoraproject.org/wiki/Windows_Virtio_Drivers > You can either install that package so it appears under > /usr/share/virtio-win, or you can use the .iso file from that package > and set the VIRTIO_WIN environment variable to point to it: > > http://libguestfs.org/virt-v2v.1.html#environment-variables >The above is done (easy).> Do you have metadata from VirtualBox (number of CPUs, RAM, etc) in > some format? If not, then you should probably use the ‘-i libvirtxml’ > input method. You will have to write or modify the metadata, as > documented here: > > http://libguestfs.org/virt-v2v.1.html#minimal-xml-for--i-libvirtxml-option >Please bear with me but I really don't have enough info as to HOW to modify the xml template., beyond the obvious stuff, MAC address, name of VM, etc. Might there bit a more detailed xml template in context of Windows to kvm/qemu I could use?> I believe that virt-v2v should be able to transparently convert > the .vdi source file. You might or might not need to use the > ‘-if vdi‘ option. > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones