RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 693876 - LXC: virtinst support for Linux Containers
Summary: LXC: virtinst support for Linux Containers
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 693872
Blocks: 693512
TreeView+ depends on / blocked
 
Reported: 2011-04-05 19:34 UTC by Bhavna Sarathy
Modified: 2015-06-11 01:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
New Feature: virt-install can now be used to create linux container guests. This includes application containers and full OS containers. However, no tool for creating an OS directory tree is provided, users must manually build one.
Clone Of: 693872
Environment:
Last Closed: 2011-12-06 16:16:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1643 0 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-12-06 00:50:36 UTC

Description Bhavna Sarathy 2011-04-05 19:34:48 UTC
+++ This bug was initially created as a clone of Bug #693872 +++

LXC support to have support across the stack in kernel, libvirt, virt-manager, and virtinst.  This allows for a consistent user experience with both KVM an LXC using the existing Virtualization management tools.  The virt-manager should allow for a user to create Linux Containers.

Comment 2 RHEL Program Management 2011-04-05 19:43:56 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Cole Robinson 2011-06-10 19:59:52 UTC
Current upstream has all the hookups for creating LXC guests and specifying <filesystem> devices. Main thing lacking at the moment is a tool to actually populate an OS directory tree. I've got something half working but it has various hacks in it that should probably be investigated before actually recommending it to customers.

Comment 4 Martin Foster 2011-06-20 06:43:50 UTC
(In reply to comment #3)

Hello Cole, would you consider sharing your information on populating a RHEL (say 6.1) OS directory tree?  Understand it would be a work in progress, but it would be nice to get a feel for what will presumably eventually be the recommended way of doing this.

So far, to make an LXC environment in 6.1 (barely) useable:
(1) I am using libvirt 0.91 because it appears to resolve many bugs opened against LXC while we wait for the relevant fixes to be backported to the version shipped with RHEL.  RPMs rebuilt from http://libvirt.org/sources/libvirt-0.9.1-1.fc14.src.rpm.  In my case, using stock RHEL 6.1 libvirt triggers bug https://bugzilla.redhat.com/show_bug.cgi?id=698071. 

(2) The filesystem image is a copy of a freshly kickstarted VM.  Works fine with a libvirt <init> of /bin/sh.  Unfortunately this doesn't start services, and isn't very resilient as "exit" will stop the container (terminates the shell).

I'm experimenting with an <init> of /sbin/init, but:
- udev must not start.  The udev-post service can be stopped in a standard way. /sbin/start_udev has to be commented out of /etc/rc.d/rc.sysinit which isn't clean, a switch under /etc/sysconfig would be better.
- ensuring that the container's console is segregated from the main instance needs some work.  I'm still looking at what's going on here with libvirt 0.9.1

Comment 5 Cole Robinson 2011-07-28 15:34:01 UTC
Fixed in python-virtinst-0.600.0-1.el6

Comment 12 Cole Robinson 2011-09-27 15:02:05 UTC
Martin, here's the steps I used to get a full FS container up and running on F15. This is basically a list of hacks and I'm guessing is unsupportable, so take it with a grain of salt. This was on Fedora 14

# Populate dir
mkdir -p testdir/var/lib/rpm
mkdir -p testdir/var/log
yumdownloader --destdir testdir fedora-release
rpm --root testdir --initdb
rpm --root testdir -ivh testdir/fedora-release*
yum --installroot=testdir -y groupinstall Base

# Set a root passwd
#chroot testdir
#passwd

# Add pts/0 to /etc/securetty
# Makes root login act same as non root login, prompting:
# Would you like to enter a security context (and then bailing)

# Edit /etc/pam.d/login, comment out selinux lines
# root prompt takes password and goes right back to login:

# Edit /etc/pam.d/login, comment out loginuid line
# root prompt works!

# Edit /etc/rc.sysinit, disable /sbin/start_udev
# Quieter boot up

# Created /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=myinit

# Create /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

# chkconfig NetworkManager off
# chkconfig network on
# Gets startup networking

# Add a basic /etc/fstab with
# tmpfs  /dev/shm   tmpfs  defaults  0 0
# Made startup a bit happier, no noticeable effect

Comment 13 zhe peng 2011-09-28 06:52:22 UTC
according by comment 12,
verify on python-virtinst-0.600.0-3.el6
step:
1: run command line :
#cd /tmp
#febootstrap fedora-13 rootfs.fedora
2: after install complete, disable selinux on host and fedora-13
#chroot /tmp/rootfs.fedora
(by comment 12 settings)
3: run command line:

#virt-install --connect lxc:/// -n demo -r 1024 --filesystem
/tmp/rootfs.fedora,/ --debug

# virsh -c lxc:/// list --all
Id Name                 State
----------------------------------
10331 demo                 running

use virt-manager to login the vm successful.
move to verify.

Comment 14 Cole Robinson 2011-11-07 17:13:06 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
New Feature:
virt-install can now be used to create linux container guests. This includes application containers and full OS containers. However, no tool for creating an OS directory tree is provided, users must manually build one.

Comment 15 errata-xmlrpc 2011-12-06 16:16:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1643.html


Note You need to log in before you can comment on or make changes to this bug.