[Lxc-users] Fedora 15 on Fedora 15 LXC with Libvirt

Iliyan Stoyanov ilf at ilf.me
Sun Jul 31 14:45:24 UTC 2011


Hi guys,

I'm trying to run two containers of Fedora 15 over Fedora 15 host
through libvirt on an amd64 host. However so far I've not been able to
setup the environment and going through the list it seems there are some
issues with systemd, however I'm not really sure how to make it work.
I'm new to the LXC, but not new to libvirt, as I use it for few large
deployments of QEMU for several clients and our internal infrastructure.

However I decided to go the LXC way for this host, as this server is
very old and doesn't support AMD-V, and as it is an internal dev server
it would be nice if I can consolidate couple of even older PIII machines
on top of it.


I've setup Fedora 15 with btrfs raid1 on the host, and used febootstrap
(v2) to create Fedora 15 image in /var/lib/libvirt/lxc/web.fedora. I
followed the howto (btw, the documentation of LXC lacks in quantity and
arguably in quality) and set up fstab file according to it. Then in the
xml definition for virsh I used this setup:

<domain type='lxc'>
  <name>web.fedora</name>
  <uuid>deffe022-cf0d-e56c-badf-af46802a4538</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/sbin/init</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <interface type='bridge'>
      <mac address='52:54:00:e3:8f:27'/>
      <source bridge='br0'/>
      <target dev='veth0'/>
    </interface>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
  </devices>
</domain>

which according to what I understand of lxc docs and libvirt docs (btw,
that documentation is not great either) seems to be alright. However
when starting the container with virsh -c lxc:/// start web.fedora, the
container starts through libvirt_lxc, however when I try to see the
console through virsh -c lxc:/// console web.fedora, I don't get
anything. 

The network of the container doesn't go up either, so I suppose it just
doesn't go through init.

>From what I gathered looking through the mailing list, there seems to be
a problem with systemd and the fact that it mounts cgroups in different
directories, however I saw that in the latest git, this is supposed to
be fixed, so I pulled the latest code and compiled it (my paths are
correct, and essentially the latest binaries overridden the old ones).
However I still can't seem to start the container. I'm thinking the
problem lays in the systemd of the container, as this is essentially
the /sbin/init of F15, however I'm not sure what should I do.

When I issue a start command through virsh, this is what I get in
the /var/log/libvirt/lxc/web.fedora.log:

PATH=/sbin:/usr/sbin:/bin:/usr/bin LIBVIRT_DEBUG=3
LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name web.fedora
--console 25 --handshake 28 --background --veth veth1
PATH=/bin:/sbin TERM=linux
LIBVIRT_LXC_UUID=deffe022-cf0d-e56c-badf-af46802a4538
LIBVIRT_LXC_NAME=web.fedora /sbin/init
17:43:02.278: 9459: info : libvirt version: 0.9.3, package: 2.fc15
(Unknown, 2011-07-26-18:35:16, storm.evo.net)

and once I issue:
virsh -c lxc:/// console web.fedora
I get the log file flooded with:

17:43:02.278: 9459: error : lxcFdForward:287 : read of fd 9 failed:
Input/output error
17:43:02.278: 9459: error : lxcFdForward:287 : read of fd 9 failed:
Input/output error
17:43:02.278: 9459: error : lxcFdForward:287 : read of fd 9 failed:
Input/output error
17:43:02.278: 9459: error : lxcFdForward:287 : read of fd 9 failed:
Input/output error


So could you please point me in the right direction, so that I can try
and make this thing to work.

Sincerely,
Iliyan ilf Stoyanov





More information about the lxc-users mailing list