KatharaFramework / Kathara

A lightweight container-based network emulation system.
https://www.kathara.org/
GNU General Public License v3.0
452 stars 63 forks source link

kathara VMs have /proc/sys/net/ with readonly permission #92

Closed pedrofran12 closed 4 years ago

pedrofran12 commented 4 years ago

Describe the bug VMs launched with kathara/docker have /proc/sys/net/ files with readonly permissions.

I tried to extend kathara/quagga image. When making changes to /proc/sys/net/ files I was unable because it has readonly permissions. I searched online and found that running a docker image with "--priviledged" flag would allow to overcome this issue. I tried and I was able to make the changes to the intended files (and then commited those changes to a new image). When I run a kathara lab (with the new image) the changes that were made are not visible and /proc/sys/net files is still readonly. Is there a way to run a kathara lab with "--priviledged" flag on all VMs?

Expected behavior Allow make changes to /proc/sys/net/ files.

Screenshots Captura de ecrã de 2020-05-09 01-12-07

Thank you for the help.

pedrofran12 commented 4 years ago

Hi, I have discovered today that kathara lstart has a --privileged flag. By using it I am allowed to make changes to /proc/sys/net/ files. However by using this flag, the VM terminal windows don't show up automatically, meaning that I need to "kathara connect" to each single VM. Why is there such restriction and how can I launch automatically all VM terminals? Captura de ecrã de 2020-05-09 17-52-03

Thank you again for the support.

Skazza94 commented 4 years ago

Hi @pedrofran12, you can specify /proc/sys/net/ values into the lab.conf file. As an example:

machine_name[sysctl]="net.ipv4.fib_multipath_hash_policy=1"

Will set net.ipv4.fib_multipath_hash_policy to 1 to machine called machine_name. This do not require --privileged flag. Using this method the /proc/sys/net/ is still read-only, so you can't change values at runtime.

Terminals are not opened automatically when using --privileged flag since root user does not have x11.

pedrofran12 commented 4 years ago

Hi @Skazzino, Thank you for the answer. I have tried the suggested solution and it works :+1: