<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div>Thanks for the reply. </div><div><br></div><div>
<div style="font-family:΢ÈíÑźÚ;font-size:10pt">
<div>Does libvirt have corresponding API for this? </div></div></div><div><br></div>regards<div>zhangzhang<br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Fri, 22 Feb 2013 09:53:49 +0000<br>> From: berrange@redhat.com<br>> To: zhang_zhang@live.com<br>> CC: libvirt-users@redhat.com<br>> Subject: Re: [libvirt-users] How to run a cmd inside lxc through libvirt API?<br>> <br>> On Fri, Feb 22, 2013 at 09:27:05AM +0000, ÕÅÕ wrote:<br>> > <br>> > Hi<br>> > <br>> > As far as I know, I can not run a cmd inside lxc through<br>> > shell after "virsh -c lxc:/// console". How could I run<br>> > a cmd though libvirt API instead of shell like the userspace<br>> > tool lxc_start(name, cmd, conf)? <br>> <br>> Latest libvirt has a new command for running stuff inside a container<br>> <br>>    virsh -c lxc:/// lxc-enter-namespace mycontainername -- /bin/ps -auxf<br>> <br>> This requires a fairly new !
 kernel(3.7 or even 3.8 kernel is preferred)<br>> since it needs all 6 namespaces present in /proc/self/ns to work properly.<br>> <br>> Regards,<br>> Daniel<br>> -- <br>> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|<br>> |: http://libvirt.org              -o-             http://virt-manager.org :|<br>> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|<br>> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|<br></div></div>                                      </div></body>
</html>