[libvirt] [PATCH] lxc: Bind mount container TTYs

Martin Kletzander mkletzan at redhat.com
Wed Jul 1 09:40:38 UTC 2015


On Tue, Jun 30, 2015 at 07:54:25PM +0200, Richard Weinberger wrote:
>Am 30.06.2015 um 19:12 schrieb Martin Kletzander:
>>> Hmm, very strange. What guest container are you using?
>>> I tried with a Debian jessi and had user namespace enabled.
>>>
>>
>> Sorry for the late reply.  I used simple one.  Only gentoo's stage 3
>> unpacked into a directory, no special settings used for it.  Removing
>> /etc/securetty works for me.  I'll give it another try, but probably
>> after the freeze.  If anyone else wants to review this, don't get
>> stopped by the problems I'm having!
>
>Hmm, just gave gentoo a try, worked perfectly fine.

I tried with latest master with and without your patch.  Wtih your
patch I got to the problem exactly once even though I tried multiple
times.  And even though it didn't happen to me at all without your
patch, I'm thinking it's just some weird rare race and it's not
related to what you've sent.  That just wouldn't make sense to me.

I also suspected the problem being me starting with --console
parameter, but trying with and without that didn't help isolate the
problem either.

Anyway, that patch still doesn't help me get rid of /etc/securetty.
The output of 'tty' is still /dev/pts/0 and unless I remove
/etc/securetty it doesn't start.  What is the output of 'tty' and what
ttys do you have in /etc/securetty in your container?

>Can you share your xml?
>

Sure, mine is almost same as yours except the user namespace
isolation.

<domain type='lxc'>
  <name>gentoo</name>
  <uuid>9de0da50-bddd-40e5-ba4a-24c2ed8fca05</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='auto'>1</vcpu>
  <numatune>
    <memory mode='strict' placement='auto'/>
  </numatune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/sbin/init</init>
  </os>
  <features>
    <acpi/>
  </features>
  <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>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/lxc_gentoo'/>
      <target dir='/'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:ae:8b:47'/>
      <source bridge='virbr0'/>
      <target dev='viftestmaster'/>
      <guest dev='eth0'/>
    </interface>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
</domain>



>This is mine:
><domain type='lxc'>
>        <name>gentoo</name>
>        <memory>524288</memory>
>        <os>
>                <type>exe</type>
>                <init>/sbin/init</init>
>        </os>
>        <idmap>
>                <uid start='0' target='100000' count='998'/>
>                <gid start='0' target='100000' count='998'/>
>                <uid start='65533' target='100998' count='2'/>
>                <gid start='65533' target='100998' count='2'/>
>        </idmap>
>        <devices>
>                <console type='pty'/>
>                <filesystem type='mount'>
>                        <source dir='/srv/container/gentoo/'/>
>                        <target dir='/'/>
>                </filesystem>
>                <interface type='bridge'>
>                        <source bridge='br0'/>
>                        <mac address='52:54:00:44:55:66'/>
>                </interface>
>        </devices>
></domain>
>
>Thanks,
>//richard
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150701/16dc04fe/attachment-0001.sig>


More information about the libvir-list mailing list