Skip to content

Migration from VirtualBox to Parallels provider

Mikhail Zholobov edited this page Apr 10, 2014 · 6 revisions
  • Note: This wiki page has published as a 'draft' yet. If you find some mistakes, please, send an e-mail to [email protected]. Thank you!

This manual describes the way how to migrate your existing virtual machines managed by default VirtualBox provider to the Parallels provider.

For whom this manual is?

We suggest that you are familiar with Vagrant and already have some virtual machine (environment) managed by VirtualBox provider, the default provider shipped with Vagrant.

Flexibility and reproducibility are the main advantages of Vagrant. So, take a look at your existing virtual environment and try to answer on this question:

  • Can you reproduce this environment from the base box? (using provisioner or some uncomplicated manipulations)?

If your answer is 'Yes', congratulations - you are really cool and you don't need this manual!

Just create a new virtual machine using the Parallels provider and then reproduce your environment. Refer to the Parallels Provider Documentation: Boxes, Getting Started

But if your environment...

  • is complicated and unreproducible, or
  • has unique important content (database, manually edited configuration, etc.)

... then we are so sorry you will need this manual to migrate your existing VirtualBox machine.

Frankly speaking, we will just convert it's image to Parallels format, will install Parallels Tools inside and then we will put the new VM's uuid to the Vagrant environment configuration.

I. Convert the VM image

  1. Switch to directory with your existing Vagrant environment (where the Vagrantfile and .vagrant folder place) and then detect the machine_name.
$ vagrant status
...
default                   poweroff (virtualbox)

In our case machine name is "default". If you have multi-machine configuration and/or specified another name, please, use it instead the "default" in commands below. If your machine is running, please, stop it using vagrant halt.

  1. Detect the VM name and configuration path:
$ VBoxManage showvminfo `cat .vagrant/machines/default/virtualbox/id` | grep -E "^Config file:  |^Name:  "
Name:            vbox-migrate_default_1397118356894_30506
Config file:     /Users/user/VirtualBox VMs/vbox-migrate_default_1397118356894_30506/vbox-migrate_default_1397118356894_30506.vbox
  1. Convert the VM. You should set the config path as argument for this command:
prlctl convert '/Users/user/VirtualBox VMs/vbox-migrate_default_1397118356894_30506/vbox-migrate-test_default_1397118356894_30506.vbox' --force
  1. Detect the new VM uuid. Machine name still the same (which we have detected in p.2):
$ prlctl list vbox-migrate_default_1397118356894_30506
UUID                                    STATUS       IP_ADDR         NAME
{5670bea2-313f-4ac9-998d-de2290af3791}  stopped      -               vbox-migrate_default_1397118356894_30506

We will use this uuid for the next configuration steps.

II. Replace Guest Tools

  1. Connect Parallels Tools ISO to the new virtual machine. We suggest that you have installed Paralells Desktop to the /Applications. If you have installed it to another path, please change --image argument respectively.
$ prlctl set 5670bea2-313f-4ac9-998d-de2290af3791 --device-set cdrom0 --image "/Applications/Parallels Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso" --connect
  1. Make sure that all VirtualBox machines are stopped (because of KB-115966) and start our new Parallels based virtual machine:
$ prlctl start 5670bea2-313f-4ac9-998d-de2290af3791

Then open the VM window and login with vagrant credentials. By default username is vagrant, and password is vagrant too.

  1. Remove VirtualBox Guest Additions. Execute this command in the VM console:
$ sudo /opt/VBoxGuestAdditions-*/uninstall.sh

If you don't have /opt/VBoxGuestAdditions-* path in your VM, refer to the nex instruction: VirtualBox - Uninstalling the Linux Guest Additions

  1. Reboot your virtual machine. Execute sudo reboot in the VM console. After the machine restarts, please login to the VM console again.

  2. Install Parallels Tools. Execute these commands in the VM console:

$ sudo mkdir -p /media/cdrom

$ sudo mount /dev/cdrom* /media/cdrom
mount: block device /dev/sr0 is write-protected, mounting read-only

$ sudo /media/cdrom/install
...

Follow the steps of Parallels Tools Installer. When the installation completes, you should not restart the VM - just shutdown it by executing sudo halt in the VM console.

III. Replace the VM uuid in the Vagrant environment

So, you've prepared the VM and only one step remains - you should put the machine's uuid to the current Vagrant environment. We suggest that your current directory is existing Vagrant environment (where the Vagrantfile and .vagrant folder place).

$ rm -rf .vagrant/machines/default/virtualbox
$ mkdir -p .vagrant/machines/default/parallels
$ echo '5670bea2-313f-4ac9-998d-de2290af3791' > .vagrant/machines/default/parallels/id

That's it! You've migrated your virtual environment - now it is a Parallels based virtual machine and you can use Vagrant to manage it, as before.

Edit Vagrantfile

If you want to use customisation options, please edit your Vagrantfile (refer to "Configuration" doc page)

You also have to set the box with support of the Parallels provider(refer to "Boxes" doc page). It would be required when you decide to reproduce this environment.