FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-12-2011, 04:58 AM
Ivan Fetch
 
Default COnverting an LXC to a virtual machine

Hello,

I would like to convert some LXC containers into virtual machines, and am looking for advice on how to do this while maintaining an accurate package database.

SO far, I have copied the contents of an LXC into an initial Ubuntu 10.04 installation, mixing the contents of the initial install with the contents of the LXC. A down side to this, is that dpkg does not know about packages which were installed in the initial installation, for example, kernel images, grub, Etc.

How can I register these packages who's files are installed, although they are not listed in the package database? ALternatively, is there a better way to turn an LXC into a more complete; bootable system?

Thanks,

Ivan.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-30-2012, 04:13 AM
Ivan Fetch
 
Default COnverting an LXC to a virtual machine

Hello,

I'm replying to this, for the list archives, with the hope it may help someone else:

On Dec 11, 2011, at 10:58 PM, Ivan Fetch wrote:

Hello,

I would like to convert some LXC containers into virtual machines, and am looking for advice on how to do this while maintaining an accurate package database.

SO far, I have copied the contents of an LXC into an initial Ubuntu 10.04 installation, mixing the contents of the initial install with the contents of the LXC. A down side to this, is that dpkg does not know about packages which were installed in the initial installation, for example, kernel images, grub, Etc.

How can I register these packages who's files are installed, although they are not listed in the package database? ALternatively, is there a better way to turn an LXC into a more complete; bootable system?

Thanks,

Ivan.


I started with a base virtual machine, installed with Ubuntu 10.04, and no updates applied. I did not apply updates, because I don't want any packages in the base BM to be newer than those which will come from the LXC.

I saved a list of packages installed in the base VM: dpkg -l >packages.txt I adjusted this file so that it only contains a list of packages (no version numbers or other info from dpkg).

I used a second, helper VM to copy the contents of the LXC, into the / and /boot filesystems of the base VM, then booted the base VM.

THe VM's package database now contains packages from the LXC, but not from the base VM. Packages such as kernel and grub are not registered in the package database.

Edit /etc/apt/sources.list, so it only contains the base repositories (not security, updates, Etc):
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid main restricted

Install any missing packages which were installed in the base VM, by feeding the list of packages taken earlier, to apt-get:
apt-get install `cat packages.txt`

Put back the original /etc/apt/sources.list file.

You may want to run the VM in it's current state, to verify the migration didn't introduce any issues - then, update with apt-get update && apt-get upgrade

- Ivan]


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 06:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org