Failed install on OpenVZ container

Hi, tried like others to install mailinabox in an OpenVZ container (via vzctl, not direct SSH), with the trick to previous install ufw and disable it for install.

Still get this :

Updating system packages…
already installed: python3 (3.4.0-0ubuntu2), wget (1.15-1ubuntu1.14.04.1), curl (7.35.0-1ubuntu2.2)
installing python3-dev python3-pip haveged unattended-upgrades ntp fail2ban …
already installed: ufw (0.34~rc-0ubuntu2)
ERROR: problem running ufw-init
modprobe: ERROR: …/libkmod/libkmod.c:507 kmod_lookup_alias_from_builtin_file() could not open builtin file ‘/lib/modules/2.6.32-34-pve/modules.builtin.bin’
modprobe: FATAL: Module nf_conntrack_ftp not found.
modprobe: ERROR: …/libkmod/libkmod.c:507 kmod_lookup_alias_from_builtin_file() could not open builtin file ‘/lib/modules/2.6.32-34-pve/modules.builtin.bin’
modprobe: FATAL: Module nf_nat_ftp not found.
modprobe: ERROR: …/libkmod/libkmod.c:507 kmod_lookup_alias_from_builtin_file() could not open builtin file ‘/lib/modules/2.6.32-34-pve/modules.builtin.bin’
modprobe: FATAL: Module nf_conntrack_netbios_ns not found.
iptables-restore: line 4 failed
iptables-restore: line 77 failed
iptables-restore: line 31 failed
ip6tables-restore: line 4 failed
ip6tables-restore: line 73 failed
ip6tables-restore: line 31 failed
sysctl: permission denied on key ‘net.ipv4.tcp_sack’

Problem running ‘/etc/ufw/before.rules’
Problem running ‘/lib/ufw/user.rules’
Problem running ‘/etc/ufw/before6.rules’
Problem running ‘/lib/ufw/user6.rules’

After errors, VM loosing access to network and can’t continue install, any hint please?

1 Like

Set DISABLE_FIREWALL=1 in the VM’s environment to have it not attempt to install ufw. Would that help?

Still installing ufw, and same errors, after some steps, still Could not resolve 'archive.ubuntu.com
and no more network connection.

No, then you didn’t set the environment variable correctly. You may need to use export. This will totally skip ufw (source).

Yep, seems export DISABLE_FIREWALL=1 not working or i just did something wrong but can’t see what.
Btw, just edited the system.sh manually to remove ufw install, working well, work in progress, thanks.

I’ve come over the same problem lately and I think I’ve found the source and the solution of the problem.

I have wrote a small bash script to test if the environment variable is set correctly.

When I run

$ DISABLE_FIREWALL=1
$ export DISABLE_FIREWALL
$ ./test-fw.sh
$

Everything looks super. But the problem is that the installer is called via sudo. So now when I run sudo ./test-fw.sh I get:

$ sudo ./test-fw.sh
FW enabled

I googled an found the following thread on stackoverflow.

The solution to the problem is to run the installer script with the parameter -E to preserve the the environment variables.

$ curl -s https://mailinabox.email/bootstrap.sh | sudo -E bash
2 Likes