11

I'm finding that my graphics drivers (ATI Radeon HD 4200) run MUCH better in a native windows system, I can't even get the closed-source drivers working in Ubuntu, thus leading me to want to run windows as my main os again but have Ubuntu in a vm. Anyone know how I could migrate my current ubuntu system to a vm?

1
  • Good luck with this: localizingjapan.com/blog/2011/03/05/… ... I would just install Ubuntu in a virtual server and copy all important data from the normal Ubuntu over to that VM. But I doubt your problem will go away.
    – Rinzwind
    Mar 20, 2013 at 13:46

2 Answers 2

10

It's not much different from machine-to-machine disk copy. Try using Clonezilla.

Before running clonezilla to make a partition image, I'd run e2fsck -f then resize2fs -M to make the original partition to the smallest, so that when you are moving the partition to the VM, you can make it to any size you want. Note that, though I've done resize2fs -M many times and successful, it can go wrong. So be sure to have a backup.

I'd install a new Ubuntu in a VM so that you can do the partition as you like, then overwrite the partition from the original partition image created by Clonezilla. That way, you know the bootstrap works in the VM, and you are replacing the partition.

Once the partition is restored, while still in Clonezilla resize2fs (with no option) makes the file system to fit to the partition map (aka enlarged to the max).

This is how I usually transfer system from one system to other, reglardless of VM or non-VM.

4
  • super I'll try this method, will report back when done
    – Raansu
    Mar 21, 2013 at 9:26
  • Just finished this, had a few hiccups due to my own user errors lol but it worked. Thank you for the help! :D
    – Raansu
    Mar 25, 2013 at 6:10
  • Also for those who want to do this method, don't forget to add in the new UUID for your swap partition into /etc/fstab, it has changed!
    – Raansu
    Mar 25, 2013 at 6:19
  • 1
    In my case the extra "resize2fs" at the vary end was unneeded, if you install a fresh Ubuntu system and run clonezilla over it to restore just the partition you need like I did clonezilla will fill it in.
    – Raansu
    Mar 25, 2013 at 6:27
5

You can image your Ubuntu install from a live CD using dd. You can then boot the raw image with most any virtualization technology or convert the raw image.

As you are doing so you may run into problems, especially if you installed the ATI drivers, and so as advised it may be better to simply do a fresh install.

Assuming your Ubuntu is installed to /dev/sda , from a live CD run dd

dd if=/dev/sda1 of=/storage/ubuntu.img bs=1024 

The final ubuntu.img will be as large as your Ubuntu install and will need to be stored on a separate partition or external storage.

You can boot the raw image as a hard disk or convert it to a virtualbox (or other) image

VBoxManage convertdd ubuntu.img ubuntu.vdi
1
  • I reversed my ATI driver install, I'm running the latest Xorg drivers from Xorg-edgers so everything in theory should reconfigure themselves graphic wise I think...
    – Raansu
    Mar 21, 2013 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .