[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Migrate Virtualbox



On Fri, Feb 17, 2017 at 09:20:18PM +0900, Mark Fletcher wrote:
Hello!

I have been reading from a couple of people on this list that Virtualbox
is going away and will not be in stretch when it becomes the stable
distro shortly.

I use Virtualbox for a couple of Windows machines to do the last task I
cannot yet migrate to Debian (due to specialist software that is not made
for Linux).

I am starting to contemplate migrating from Virtualbox to a different
virtualisation solution that will be supported in Stretch.

My needs are fairly vanilla -- I have a 4-core-with-hyperthreading Intel
Core i7 920 CPU, circa 2009, and 24GB or RAM in the host. I run 2 VMs,
not all the time, which have 2 CPUs and 4GB of RAM each.

Access to physical optical drive, and virtual disks, is important.
Shared folders with the host OS (which is currently Jessie and will be
Stretch in the future) is important. 2D graphics is important, 3D less
so. Ability to access physical USB equipment attached to the host would
be nice but not a show-stopper. I have never got that working completely
satisfactorily with my Virtualbox install, but suspect that is due more
to insufficient time reading documentation than it is to limitations in
the software (which should illustrate the importance of that element of
things).

Minimal time futzing around to get the virtualisation solution working
is important, as is not having to learn an entirely new paradigm to use
the software. Stability of the result is also important.

And finally, a neat solution to migrate my Virtualbox machines to the
new environment is very important -- I would infinitely prefer not to
have to re-install from scratch into the new environment but would
prefer to be able to migrate my Virtualbox disks to the new environment
somehow, if anything supports that.

So my question is, is there an alternative solution in Debian that
allows for that easy migration path -- any recommendations?

I have recently gone down this path myself. I chose qemu+kvm as my virtualisation platform of choice, as it seems the most 'natively Linux' option (that is, QEMU is FOSS and KVM is in the kernel, so no third-party bits needed).

I suggest installing the 'virt-manager', 'libvirt-daemon-system' and 'qemu-kvm' packages (frontend, middleware and virtualisation, respectively). You should then be able to use the 'virt-manager' graphical interface to create, manage and interact with your Virtual Machines.

In terms of migrating from VirtualBox, the procedure seems to work as follows:
* Uninstall the VirtualBox tools from the guest
* Use VirtualBox to convert the VDI into a RAW disk (this will expand it to the full size, so make sure you have enough space):
  VBoxManage clonehd /path/to/guest.vdi /path/to/guest.img --format raw
* Use qemu-img to convert this into a compressed, expandable "QCOW2" disk: qemu-img convert -f raw /path/to/guest.img -O qcow2 /var/lib/libvirt/images/guest.qcow2 -c -p * Now create a new virtual machine from scratch, using the guest.qcow2 image (There doesn't appear to be a way to automate converting the VirtualBox definition to a libvirt one, so you'll need to redefine the machine.

One more thing to note. The "Virtio" disk driver is more efficient than emulating AHCI, etc so it's best to use that. If your guest is Linux, then it should just pick up on the new drive as "/dev/vda". If you're using Windows, though, this seems to work:

* Set the main drive as "AHCI", and create a second drive (any size) as "VIRTIO". * Boot into the guest and install the virtio drivers from Fedora: fedoraproject.org/wiki/Windows_Virtio_Drivers#ISO_contents * Windows should now know how to use Virtio (i.e. be able to see the second disk) * Shut down the guest, change the main drive to use virtio, and restart the guest. * Windows should now be able to boot from the main drive. You can delete the second drive.


Thanks

Mark


--
For more information, please reread.


Reply to: