Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Would it be possible to install (and maintain by simple means, such as apt-get dist-upgrade) a "dual-use" setup? I.e. install an guest instance in a way which allows me to run it either as LXC or as KVM guest and switch between the method at will?

Concerning the apt-get dist-upgrade mentioning above, I mean that I want to install it in a way so that the kernel and GRUB are updated in the guest for when it runs fully virtualized in KVM - given this is at all possible.

share|improve this question
up vote 1 down vote accepted

Yes you can. Upgrading would not be a problem, you would use apt-get. It would almost certainly be best to update when running the guest in KVM.

To use is for LXC, you would mount the disk, and specify the mount location in the LXC configuration.

To do this, use libguestfs

apt-get install libguestfs-tools

You would then mount it with guestmount

Just be sure NOT to mount a running KVM guest (well you could mount it RO).

guestmount -a your_kvm.img /mount_point

See also

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.