Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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

http://packages.ubuntu.com/quantal/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

http://ebalaskas.gr/wiki/kvm/libguestfs

http://libguestfs.org/guestmount.1.html

share|improve this answer

Your Answer

 
discard

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.