My first LXC would not start

sechanbask

Member
Aug 12, 2013
23
0
21
Hi,

I use Proxmox since 3.2 proxmox version. I'm trying 4.0 beta one.

I can't start my first lxc :

Code:
pct start 104 -logpriority
Unknown option: logpriority
400 unable to parse option
pct start <vmid>


LXC was created with :
Code:
pct create 104 /var/lib/vz/template/cache/debian-8.0-standard_8.0-1_amd64.tar.gz \
 -description LXC -rootfs 4 -hostname pvecontainer01 -memory 1024 -nameserver 8.8.8.8 \
 -net0 name=eth0,hwaddr=52:4A:5E:26:58:D8,ip=192.168.30.208/24,gw=192.168.30.254,bridge=vmbr0 \
 -storage local -password changeme

With Openvz, I have only have to give IP adresse not bridge, how to use LXC ?



P.S Proxmox was installed form debian jessie following https://pve.proxmox.com/wiki/Install..._Debian_Jessie
 
Hello,

Code:
# pct start 104
doesn't work :

Code:
# pct start 104
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.

So I try

Code:
# pct start 104 --logfile
Unknown option: logfile
400 unable to parse option
pct start <vmid>


and

Code:
# pct start 104 --logpriority
Unknown option: logpriority
400 unable to parse option
pct start <vmid>

but It doesn't work too. I can't start this CT from WEB GUICapture d'écran de 2015-09-28 05:51:55.png

And I can't create CT form WEB GUI:Capture d'écran de 2015-09-28 05:56:13.png I don't know why it' ansk me a bridge, on older vesion it only ask me an IP adress...


Do you have any idea ?
 
Last edited:
First make sure your packages are up to date. (do another apt-get dist-upgrade).

Now, the messages there about log-files come from the lxc backend. In order to actually get the log you have to use lxc-start directly.
Code:
lxc-start -lDEBUG -o YOURLOGFILE.log -F -n 104
Note that once it works this will start the container in the foreground - you can still just stop it with `pct stop 104` from another terminal.

If the information provided by the above command doesn't help you figure it out post its output together with the log file and the output of `pct config 104`
 
Hi,

Thank you for help :

Code:
# apt-get dist-upgrade
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Calcul de la mise à jour... Fait
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
root@pve:~# lxc-start -lDEBUG -o YOURLOGFILE.log -F -n 104
bridge 'vmbr0' does not exist
lxc-start: conf.c: run_buffer: 336 Script exited with status 2
lxc-start: conf.c: lxc_create_network: 2960 failed to create netdev
lxc-start: start.c: lxc_spawn: 920 failed to create the network
lxc-start: start.c: __lxc_start: 1172 failed to spawn '104'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.

and the log file :

Code:
   lxc-start 1443525344.076 INFO     lxc_start_ui - lxc_start.c:main:264 - using rcfile /var/lib/lxc/104/config
      lxc-start 1443525344.076 WARN     lxc_confile - confile.c:config_pivotdir:1825 - lxc.pivotdir is ignored.  It will soon become an error.
      lxc-start 1443525344.078 WARN     lxc_cgmanager - cgmanager.c:cgm_get:993 - do_cgm_get exited with error
      lxc-start 1443525344.078 INFO     lxc_lsm - lsm/lsm.c:lsm_init:48 - LSM security driver AppArmor
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .reject_force_umount  # comment this to allow umount -f;  not recommended.
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:410 - Adding native rule for reject_force_umount action 0
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:do_resolve_add_rule:210 - Setting seccomp rule to reject force umounts

      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:413 - Adding compat rule for reject_force_umount action 0
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:do_resolve_add_rule:210 - Setting seccomp rule to reject force umounts

      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .[all].
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .kexec_load errno 1.
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:410 - Adding native rule for kexec_load action 327681
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:413 - Adding compat rule for kexec_load action 327681
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .open_by_handle_at errno 1.
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:410 - Adding native rule for open_by_handle_at action 327681
      lxc-start 1443525344.078 INFO     lxc_seccomp - seccomp.c:parse_config_v2:413 - Adding compat rule for open_by_handle_at action 327681
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .init_module errno 1.
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:410 - Adding native rule for init_module action 327681
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:413 - Adding compat rule for init_module action 327681
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .finit_module errno 1.
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:410 - Adding native rule for finit_module action 327681
      lxc-start 1443525344.079 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:227 - Seccomp: got negative # for syscall: finit_module
      lxc-start 1443525344.079 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:228 - This syscall will NOT be blacklisted
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:413 - Adding compat rule for finit_module action 327681
      lxc-start 1443525344.079 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:227 - Seccomp: got negative # for syscall: finit_module
      lxc-start 1443525344.079 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:228 - This syscall will NOT be blacklisted
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:318 - processing: .delete_module errno 1.
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:410 - Adding native rule for delete_module action 327681
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:413 - Adding compat rule for delete_module action 327681
      lxc-start 1443525344.079 INFO     lxc_seccomp - seccomp.c:parse_config_v2:420 - Merging in the compat seccomp ctx into the main one
      lxc-start 1443525344.079 INFO     lxc_conf - conf.c:run_script_argv:356 - Executing script '/usr/share/lxc/hooks/lxc-pve-prestart-hook' for container '104', config section 'lxc'
      lxc-start 1443525344.741 DEBUG    lxc_start - start.c:setup_signal_fd:262 - sigchild handler set
      lxc-start 1443525344.742 DEBUG    lxc_console - console.c:lxc_console_peer_default:500 - opening /dev/tty for console peer
      lxc-start 1443525344.742 DEBUG    lxc_console - console.c:lxc_console_peer_default:506 - using '/dev/tty' as console
      lxc-start 1443525344.742 DEBUG    lxc_console - console.c:lxc_console_sigwinch_init:179 - 21797 got SIGWINCH fd 9
      lxc-start 1443525344.742 DEBUG    lxc_console - console.c:lxc_console_winsz:88 - set winsz dstfd:6 cols:80 rows:24
      lxc-start 1443525344.742 INFO     lxc_start - start.c:lxc_init:454 - '104' is initialized
      lxc-start 1443525344.742 DEBUG    lxc_start - start.c:__lxc_start:1145 - Not dropping cap_sys_boot or watching utmp
      lxc-start 1443525344.744 INFO     lxc_conf - conf.c:run_script:406 - Executing script '/usr/share/lxc/lxcnetaddbr' for container '104', config section 'net'
      lxc-start 1443525345.373 ERROR    lxc_conf - conf.c:run_buffer:336 - Script exited with status 2
      lxc-start 1443525345.379 ERROR    lxc_conf - conf.c:lxc_create_network:2960 - failed to create netdev
      lxc-start 1443525345.379 ERROR    lxc_start - start.c:lxc_spawn:920 - failed to create the network
      lxc-start 1443525345.379 ERROR    lxc_start - start.c:__lxc_start:1172 - failed to spawn '104'
      lxc-start 1443525345.379 INFO     lxc_conf - conf.c:run_script_argv:356 - Executing script '/usr/share/lxc/hooks/lxc-pve-poststop-hook' for container '104', config section 'lxc'
      lxc-start 1443525346.032 ERROR    lxc_start_ui - lxc_start.c:main:344 - The container failed to start.
      lxc-start 1443525346.032 ERROR    lxc_start_ui - lxc_start.c:main:348 - Additional information can be obtained by setting the --logfile and --logpriority options.

There is actually an issue this the network... but...
 
Seems you're missing a bridge there? The recommended default setup uses a bridge named vmbr0 with your default network interface on it.
Check the network configuration (GUI or /etc/network/interfaces). Though you asked to not have to use a bridge - this is not currently supported directly. But you can remove the network interface from the config and manually add lxc.network.* entries to the container's configuration file. (Then you also have to setup forwarding/routing manually, though.)
 
Linux bridge or OVS bridge ?

If Linux bridge, is the configuration will be OK :

Code:
Pending changes (Please reboot to activate changes)


--- /etc/network/interfaces	2015-09-24 10:25:36.275471864 +0200
+++ /etc/network/interfaces.new	2015-09-29 16:11:59.097180193 +0200
@@ -1,15 +1,30 @@
-# This file describes the network interfaces available on your system
-# and how to activate them. For more information, see interfaces(5).
+# network interface settings; autogenerated
+# Please do NOT modify this file directly, unless you know what
+# you're doing.
+#
+# If you want to manage part of the network configuration manually,
+# please utilize the 'source' or 'source-directory' directives to do
+# so.
+# PVE will preserve these directives, but will NOT its network
+# configuration from sourced files, so do not attempt to move any of
+# the PVE managed interfaces into external files!
 
 source /etc/network/interfaces.d/*
 
-# The loopback network interface
 auto lo
 iface lo inet loopback
 
-# The primary network interface
-allow-hotplug eth0
-iface eth0 inet static
+iface eth1 inet manual
+
+iface eth0 inet manual
+
+auto vmbr0
+iface vmbr0 inet static
 	address	192.168.30.177
 	netmask	255.255.255.0
 	gateway	192.168.30.254
+	bridge_ports none
+	bridge_stp off
+	bridge_fd 0
+
+allow-hotplug eth0