# lxc-execute

## NAME



           lxc-execute - run an application inside a container.
    


## SYNOPSIS



           **lxc-execute**{-n _name_} [-d] [-f _config_file_] [-s KEY=VAL] [-u,
                       --uid _uid_] [-g, --gid _gid_] [-- _command_]
    


## DESCRIPTION



           **lxc-execute** runs the specified _command_ inside the container speci‐
           fied by _name_.
    
           It  will setup the container according to the configuration previ‐
           ously defined with the lxc-create command or with  the  configura‐
           tion  file parameter.  If no configuration is defined, the default
           isolation is used.
    
           This command is mainly used when you want to quickly launch an ap‐
           plication in an isolated environment.
    
           **lxc-execute** command will run the specified command into  the  con‐
           tainer via an intermediate process, **lxc-init**.  This lxc-init after
           launching  the  specified  command,  will wait for its end and all
           other reparented processes.  (to support daemons in  the  contain‐
           er).  In other words, in the container, **lxc-init** has the pid 1 and
           the first process of the application has the pid 2.
    
           The  above **lxc-init** is designed to forward received signals to the
           started command.
    


## OPTIONS



           **-f, --rcfile** _config_file_
                  Specify the configuration file to configure the virtualiza‐
                  tion and isolation functionalities for the container.
    
                  This configuration file if present will be used even if
                  there is already a configuration file present in the previ‐
                  ously created container (via lxc-create).
    
           **-s, --define** _KEY=VAL_
                  Assign value _VAL_ to configuration variable _KEY_. This over‐
                  rides any assignment done in _config_file_.
    
           **-d, --daemon**
                  Run the container as a daemon. As the container has no more
                  tty, if an error occurs nothing will be displayed, the log
                  file can be used to check the error.
    
           **-u, --uid** _uid_
                  Executes the _command_ with user ID (use numerical value) _uid_
                  inside the container.
    
           **--g, --gid** _gid_
                  Executes the _command_ with group ID (use numerical value)
                  _gid_ inside the container.
    
           **--** Signal the end of options and disables further option pro‐
                  cessing. Any arguments after the -- are treated as argu‐
                  ments to _command_.
    
                  This option is useful when you want specify options to _com‐_
                  _mand_ and don't want **lxc-execute** to interpret them.
    


## COMMON OPTIONS



           These options are common to most of lxc commands.
    
           **-?, -h, --help**
                  Print a longer usage message than normal.
    
           **--usage**
                  Give the usage message
    
           **-q, --quiet**
                  mute on
    
           **-P, --lxcpath=**_PATH_
                  Use an alternate container path. The default is
                  /var/lib/lxc.
    
           **-o, --logfile=**_FILE_
                  Output to an alternate log _FILE_. The default is no log.
    
           **-l, --logpriority=**_LEVEL_
                  Set log priority to _LEVEL_. The default log priority is ER‐
                  ROR. Possible values are : FATAL, ALERT, CRIT, WARN, ERROR,
                  NOTICE, INFO, DEBUG, TRACE.
    
                  Note that this option is setting the priority of the events
                  log in the alternate log file. It do not have effect on the
                  ERROR events log on stderr.
    
           **-n, --name=**_NAME_
                  Use container identifier _NAME_.  The container identifier
                  format is an alphanumeric string.
    
           **--rcfile=**_FILE_
                  Specify the configuration file to configure the virtualiza‐
                  tion and isolation functionalities for the container.
    
                  This configuration file if present will be used even if
                  there is already a configuration file present in the previ‐
                  ously created container (via lxc-create).
    
           **--version**
                  Show the version number.
    


## DIAGNOSTIC



           The container is busy
                  The specified container is already running an application.
                  You should stop it before reuse this container or create a
                  new one.
    


* * *