Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu Server 10.04 VPS (Virtual Private Server) that hosts my website. I would like to clone this VPS and create a VirtualBox machine from it. How can I do this?

share|improve this question
up vote 1 down vote accepted

I think you want to look at the command VBoxManage convertfromraw or VBoxManage clonehd. I can't remember exactly how to do it, but I found these two guides: http://www.virtualbox.org/wiki/Migrate_Windows and http://www.pendrivelinux.com/boot-a-usb-flash-drive-in-virtualbox/.

Once you have the hard drive converted, you can just create a new Virtual Machine, but use your existing disk image you just created.

share|improve this answer
I realize that the first document is about migrating Windows, but near the end, they show a command to convert a device file on Linux to a VDI. – penguin359 Apr 20 '11 at 19:43

If you want to migrate the whole installation byte-for-byte, in essence making a copy of the disk: read penguin359's answer, or see Moving linux install to a new computer.

If you just want to reproduce the settings of an existing installation: install a basic system from scratch, then run aptitude-create-state-bundle on the VPS to export your package selection and APT settings, and run aptitude-run-state-bundle to import these settings into the VirtualBox installation (and in particular get the same set of packages installed). Then migrate your customizations: /etc (where you'll have to change a few files), /home, and /var/www or wherever you keep your web server data. See also How do I migrate configuration between computers with different hardware?. See also a step-by-step cloning guide, which addresses what files you'll most likely need to change in /etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.