Convert KVM virtual machine to LXC container

4

1

I have 2 virtual machines (with Debian, using KVM) with virtual hard drives:

  • /srv/kvm/ssh.img
  • /srv/kvm/www.img

Both have 3 partitions (/, /home, swap).

I want to convert them in a RootFS usable with LXC (in order to use LXC instead of KVM).

The only solution I have for the moment is:

  • create a new RootFS
  • copy /home partition into it
  • reproduce the same configuration into it

But is there an automated way to do it

linkdd

Posted 2012-09-17T09:14:42.490

Reputation: 163

I doubt it since LXC is highly dependable on the type of kernel used. – Lucas Kauffman – 2012-09-17T09:38:29.893

Answers

3

Maybe you can give this a shot Booting an Ubuntu 12.04 virtual machine in an LXC container . At least LXC on Ubuntu provides various distro templates, I believe you can boot different Linux distro from the host.

chenwj

Posted 2012-09-17T09:14:42.490

Reputation: 240

1

You can look at lxc-convert here.

I've done it several time, it works well.

Deimosfr

Posted 2012-09-17T09:14:42.490

Reputation: 111