Install apache, php and mysql on Ubuntu 22.04 toolbox

I would like to install apache, php and mysql on Ubuntu 22.04 toolbox which is running in a Fedora 39 desktop VM.
I am following the steps instructions provided in this link, but is seems to have some problem trying to set the ports in the firewall; when I run

⬢[lab@toolbox lab]$ sudo ufw allow in "Apache"
WARN: initcaps
[Errno 2] iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root)

Besides,

$ sudo ufw status

outputs error:

⬢[lab@toolbox lab]$ sudo ufw status
ERROR: problem running iptables: iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root)
Asked By: pablo

||

You are in toolbox (a container) which doesn’t have its own networking stack. Since toolbox runs in host networking mode, it should inherit whatever firewall rules you set outside toolbox.

Have you tried running sudo ufw allow in "Apache" outside toolbox?

Answered By: Cadence
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.