lxc-start(1)

✨ lxc-start(1) β€” the LXC glow-up guide ✨

okay so bestie, you're looking at the lxc-start page from the lxc manual set, and honestly? it's a whole vibe. this is the command that actually boots your container, like pressing play on your fave playlist. let's get into it πŸ’…


🌸 NAME 🌸

lxc-start β€” run an application inside a container. yes, that's the whole thing, and it ate πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

lxc-start {-n name} [-f config_file] [-c console_device] [-L
          console_logfile] [-d] [-F] [-p pid_file] [-s KEY=VAL] [-C]
          [--share-[net|ipc|uts] name|pid] [command]

look at all those little flags, they're giving main character energy fr fr πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

so lxc-start runs the command you specify inside the container you picked with name. that's it, that's the job, and it slays at it 🫢

it sets everything up according to the config you already defined with the lxc-create command, or per the config file parameter. if there's literally no configuration defined? no worries, it just uses the default isolation. lowkey chill of it ngl ✨

and if you don't specify a command at all, lxc-start will use the command defined in lxc.init.cmd β€” or, if that's not set either, the default "/sbin/init" command to run a system container. icon behavior πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • -d, --daemon β€” run the container as a daemon. heads up bestie: since the container has no more tty, if an error happens nothing will be displayed 😭 the log file is your bestie for checking the error. (this is the default mode btw)
  • -F, --foreground β€” run the container in the foreground. in this mode the container console gets attached to the current tty, and signals are routed directly to the container. very hands-on, very demure πŸ’…
  • -p, --pidfile pid_file β€” create a file with the process id. cute little receipt of your container's existence πŸŽ€
  • -f, --rcfile config_file β€” specify the configuration file that configures the virtualization and isolation functionalities for the container.

and listen: this config file, if present, will be used even if there's already a config file chillin' in the previously created container (via lxc-create). it overrides, periodt ✨

  • -c, --console console_device β€” specify a device to use for the container's console, for example /dev/tty8. if you don't specify this option, the current terminal will be used β€” unless -d is specified. iykyk 🌸
  • -L, --console-log console_logfile β€” specify a file to log the container's console output to. everything gets written down, no cap πŸ“
  • -s, --define KEY=VAL β€” assign value VAL to configuration variable KEY. this overrides any assignment done in config_file. override queen πŸ‘‘
  • -C, --close-all-fds β€” if any file descriptors are inherited, close them. and if you don't specify this option? then lxc-start will exit with failure instead πŸ’€ note: --daemon implies --close-all-fds.
  • --share-net name|pid β€” inherit a network namespace from a name container or a pid. the network namespace will continue to be managed by the original owner. the network configuration of the starting container is ignored and the up/down scripts won't be executed. sharing is caring but read the fine print bestie πŸ¦‹
  • --share-ipc name|pid β€” inherit an IPC namespace from a name container or a pid.
  • --share-uts name|pid β€” inherit a UTS namespace from a name container or a pid. the starting LXC will not set the hostname β€” but the container OS may do it anyway πŸ™ˆ

🌈 COMMON OPTIONS 🌈

these options are common to most of the lxc commands, so learn 'em once and you're set forever πŸ’œ

  • -?, -h, --help β€” print a longer usage message than normal. when you need the full story πŸ“–
  • --usage β€” give the usage message. short and sweet ⭐
  • -q, --quiet β€” mute on πŸ”‡
  • -P, --lxcpath=PATH β€” use an alternate container path. the default is /var/lib/lxc. know your home base 🏠
  • -o, --logfile=FILE β€” output to an alternate log FILE. the default is no log. (yes, no log at all, choose your destiny) πŸŽ€
  • -l, --logpriority=LEVEL β€” set log priority to LEVEL. the default log priority is ERROR. possible values are: FATAL, ALERT, CRIT, WARN, ERROR, NOTICE, INFO, DEBUG, TRACE. a whole ladder of drama, from FATAL down to TRACE πŸ”₯
note that this option sets the priority of the events log in the alternate log file. it does not have an effect on the ERROR events log on stderr. read that twice bestie, it matters πŸ‘€
  • -n, --name=NAME β€” use container identifier NAME. the container identifier format is an alphanumeric string. no emoji in your container names, sorry πŸ’€
  • --rcfile=FILE β€” specify the configuration file that configures the virtualization and isolation functionalities for the container.

same deal as before: this config file, if present, will be used even if there's already a config file in the previously created container (via lxc-create). ✨

  • --version β€” show the version number. gotta know which era of slay you're running πŸ’…

🩺 DIAGNOSTIC 🩺

  • the container is busy β€” the specified container is already running an application. you should stop it before you reuse this container, or just create a new one. don't fight it, just make a new one bestie 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

lxc(7), lxc-create(1), lxc-copy(1), lxc-destroy(1), lxc-start(1), lxc-stop(1), lxc-execute(1), lxc-console(1), lxc-monitor(1), lxc-wait(1), lxc-cgroup(1), lxc-ls(1), lxc-info(1), lxc-freeze(1), lxc-unfreeze(1), lxc-attach(1), lxc.conf(5) β€” the whole friend group, go say hi πŸ’–


and that's the page! this one's from the lxc source, version dated 2026-05-01 β€” go forth and start some containers, you've got this πŸ’œβœ¨

πŸ“¦ where this page comes from