Enabling tun by default when starting a CT image to get zerotier working

Choi

New Member
Feb 4, 2023
2
1
1
Hello all!

This is my first post here, and I am since a couple of days back, a user of proxmox in my home environment. Let me say that im seriously impressed with how this behaves, is setup and simply just works out of the box.

Yesterday, I started fiddling with the CT templates, and downloaded and started a ubuntu template.

It all seemed to work fine, so I started to mess around with zerotier inside the ct container. However, I could not get it to work properly(when trying to join a network, I get a 500 respons), but after som googling, I realized that TUN is not working out of the box. This was due to the fact that a CT uses the hosts kernel, since it does not have it's own(from what I could understand atleast). This led me further down the rabbit how, and then realizing that I had to do a small configuration inside the .conf file for that specific container.

What I did was on my proxmox host, was editing this file "/etc/pve/lxc/ctxxx.conf" with these 2 lines which enabled me to get zerotier working on the container, and connect to my zerotier network. After adding the lines, I simply rebooted the ct.

Code:
lxc.cgroup.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir


Ok, this is super good to get it working, but Im wondering if there is a way of modifiying the origin of this file(which i guess is generated when i create a new CT from a template), to contain these 2 extra rows, to make them always exist when I create a new ct.

Do anyone know if this is possible?
 
So, the answer where easier then I thought...

When setting up the CT image, and installing the stuff that I needed in my base CT, i simply just made that CT into a Template... and then I can make clones out of that template, and it will retain that .conf setting that I made before creating the template.

Cheers
 
  • Like
Reactions: UnsoberDev

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!