I want to setup a Ubuntu install on a virtualbox and then use this later to install onto a machine. I know I can create clones of partitions using something like Clonezilla, but is something similar possible when using a Virtualbox? I am not opposed to using VMware if it has such a function.

  • If your computer is powerful enough, you might want to consider keeping the VM inside virtualbox. By default only one core and some memory is assigned to the VM, but if you increase it to all cores and at least 6 GB of ram, it will have a really good performance. Even videos play fine inside it, as if it was realtime. You should see if this can be something for you. – LPChip Jul 8 '15 at 18:17
  • @LPChip the idea is that I have a PC that is acting as a "server" and is kind of old and slow to work with. It is annoying to configure everything on this machine so it is much easier to set it up on virtual box and then just plop it on the machine. Running it in virtualbox on there is not ideal. – ComputerLocus Jul 8 '15 at 18:50

Virtualbox has the option to use raw disks instead of files for its hard drives. See: https://www.virtualbox.org/manual/ch09.html

It should be possible to do the following:

  1. Create a vmdk file to tell virtualbox where you want the image. This is a small text file that simply tells virtualbox where you want it to look for the guest OS. Execute the following command, changing the file convention to suit your OS:

    VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda

Alternately you can manually create and edit a .vmdk text file

  1. Create the new virtual machine in virtualbox in the usual way, except choose Use existing hard disk and select your vmdk file.

Now it should be theoretically possible to use that drive in another computer. However, I imagine that there may be problems with the virtualization drivers (e.g. guest additions). Linux is pretty good about sensing new hardware though, so it may work.

It's also possible to use an LVM as your rawdisk and to clone it to a new disk.

  • You mentioned LVM. Would that be the least likely method to be broken from doing something like this? – ComputerLocus Jul 8 '15 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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