hi All, I'm new to this list and also not a professional libvirt user:) I'm trying to use it for running a container. This is my config: <domain type='lxc'> <name>test</name> <uuid>d3667da2-061a-7b20-a29c-3afc798a257e</uuid> <memory>500000</memory> <currentMemory>500000</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/lib/libvirt/libvirt_lxc</emulator> <filesystem type='mount'> <source dir='/data/lxc/test/rootfs'/> <target dir='/'/> </filesystem> <interface type='bridge'> <mac address='52:54:00:b8:a7:80'/> <source bridge='br1'/> <target dev='veth0'/> </interface> <console type='pty'> <target type='serial' port='0'/> </console> </devices> </domain> It's up and running after start: 3141 ? Ss 0:00 /usr/lib/libvirt/libvirt_lxc --name test --console 107 --background --veth veth1 3148 pts/0 Ss+ 0:00 \_ /sbin/init 3158 ? S<s 0:00 \_ udevd --daemon 3641 ? S< 0:00 | \_ udevd --daemon 3643 ? S< 0:00 | \_ udevd --daemon 3690 ? Sl 0:00 \_ rsyslogd -c4 3703 ? Ss 0:00 \_ /usr/sbin/sshd 3730 ? Ss 0:00 \_ cron 3767 ? Ssl 0:00 \_ /usr/sbin/nscd 3818 ? Ss 0:00 \_ /usr/sbin/munin-node 3989 ? Ss 0:00 \_ /usr/lib/postfix/master 3996 ? S 0:00 | \_ pickup -l -t fifo -u -c 3997 ? S 0:00 | \_ qmgr -l -t fifo -u 3998 ? Ss 0:00 \_ /sbin/getty -8 38400 tty1 I'm trying to connect to the console: $ virsh --connect=lxc:/// console test Connected to domain test Escape character is ^] And it got off: $ virsh --connect=lxc:/// list --all Id Name State ---------------------------------- - test shut off /var/log/libvirt/lxc/test.log: 23:17:13.463: error : lxcFdForward:231 : read of fd 7 failed: Input/output error The system is Ubuntu 10.10 beta, 2.6.35-22-server and libvirt 0.8.3-1ubuntu14. What's wrong? I am out of idea. Thank you, tamas
On 10/05/2010 08:53 AM, Papp Tam?s wrote: <snip>> I'm trying to connect to the console: > > $ virsh --connect=lxc:/// console test > Connected to domain test > Escape character is ^] > > > And it got off: > > $ virsh --connect=lxc:/// list --all > Id Name State > ---------------------------------- > - test shut off > > /var/log/libvirt/lxc/test.log: > > 23:17:13.463: error : lxcFdForward:231 : read of fd 7 failed: > Input/output errorOuch, that sounds like a bug, rather than being caused by you doing something wrong. I personally don't know anything about lxc though, so we'll need to wait for someone with lxc experience to took at this. Might be tomorrow? not sure who is into lxc. :/ In the meantime, if you want to increase the level of logging generated by libvirt, it may reveal useful information. To do that, change your /etc/libvirt/libvirtd.conf. Change: #log_level = 3 to: log_level = 2 (it's more info, but not as much as level 1. Level 1 can sometimes be too much information) And also change: # log_outputs="3:syslog:libvirtd" to: log_outputs="2:file:/var/log/libvirt/libvirt.log" In the configuration file, there is also a "log_filters" field. It's probably best to leave that commented out for now, so you capture logging information from all sources. Then restart the libvirt daemon. It should then create the log file /var/log/libvirt/libvirt.log. Try creating the problem again, and see if anything useful turns up. (it may not) Hopefully that helps. :) Regards and best wishes, Justin Clift
At Mon, 04 Oct 2010 23:53:49 +0200, Papp Tam?s wrote:> <os> > <type arch='x86_64'>exe</type> > <init>/sbin/init</init> > </os>I have avoided running /sbin/init because of various problems, including: 1. udev doesn't work inside LXC 2. getty will overwrite/steal your host's virtual consoles, by default 3. init instantly dying - see http://www.redhat.com/archives/libvir-list/2010-January/msg00218.html and probably some other problems that I can't remember. Your problem is familiar, but I can't remember what my solution to it was. Now it may be that Ubuntu has been patched to fix some of these problems - I don't know. But I would recommend you try setting your init option to /bin/bash, and then (if you are able to get a console) start the services you want manually. If you are still not able to get a console, the first thing I personally would try is different kernel versions (newer *or* older). I have experienced a number of different issues with LXC, but I haven't had time to write all of them up as bug reports, only some of them, so if you are able to file reproducible bug reports that would be great. -- Robin