Howto – LXC in Proxmox

## Things about LXC

– LXC is not as separated as VMs
– LXC only emulates the OS (not the hardware layer) which makes is fast
– Techniques used behind the scenes are cgroups and namespaces
– …thus only Linux guests are possible
– LXC emulates an OS, whereas “Docker containers are restricted to a single application by design.” (“Container as an app”) (


## General Considerations

Things to keep in mind:
– in general use “unpriveliged container”.
– containers use the kernel of the host
– use bind mount to access NFS-Shares from proxmox-host on LXC containers
– limit memory and cpu


## useful commands
> lxc-info -n mycontainer
> lxc-monitor -n mycontainer

## Create Container in Proxmox

> pveam update
> pveam available
> pveam download local xxx

Then use the GUI to create the Container.

## Access Container via SSH

On Proxmox:
> lxc-attach –name 300
> vi /etc/ssh/sshd_config

change the line PermitRootLogin without-password to PermitRootLogin yes.
Restart (caution!).

## Get internet access inside container
Within same subnet and fixed ip, it workes our of the box.
For diffrent VLAN, Subnet make sure the DNS-Server is set correctly.

## Install Jellyfin on Ubuntu LXC

install on Ubuntu 20.04 (20.10 is not supported)

Doku on Jellyfin:

### 1) Install:
> sudo apt install apt-transport-https
> sudo apt-get install software-properties-common
(due to
> sudo add-apt-repository universe
> wget -O – | sudo apt-key add –
> echo “deb [arch=$( dpkg –print-architecture )] $( lsb_release -c -s ) main” | sudo tee /etc/apt/sources.list.d/jellyfin.list
> sudo apt update
> sudo apt install jellyfin

### 2) Manage:
> service jellyfin status
> systemctl restart jellyfin
> /etc/init.d/jellyfin stop

### 3) Configure:
File: /etc/systemd/system/jellyfin.service.d/qjellyfin.service.conf
Point to IP con configure: http://SERVER_IP:8096
– Set Username and password.

Using “Bind Mount Point” on Proxmox to access an NFS mount from the host in the guest (LXC). From the Proxmox documentation: “Bind mounts allow you to access arbitrary directories from your Proxmox VE host inside a container.” Be aware:
– bind mounts are not backed up by vzdump
– never bind mount system directories!
– the bind mount path must not contain any symlinks.

To add a bind mount to the LXC:

a) Datacenter > Storage > Add > NFS
Change to config file /etc/pve/storage.cfg and add the read-only flag by adding this line:

> options ro

b) Add bind mount to LXC config file eg. /etc/pve/lxc/300.conf where as:
/mnt/pve/truenas-movies is the path on the proxmox host
mp=/media/movies is the mount point inside the LXC container
shared=1 makes the bind mount available on all nodes
ro=1 add read-only

> mp0: /mnt/pve/truenas-movies,mp=/media/movies,shared=1,ro=1

### 4) Documentation
see links for accessing NFS-shares inside unpriviliged LXC container:

Best practice – LXC NFS mounting from Proxmox

Advice requested for my Plex migration from FreeNAS jail to Proxmox LXC. from Proxmox

For IP-TV:

## Install Unifi-Controller

used LXC image: Debian 10

> apt-get update; apt-get install ca-certificates wget -y
> rm &> /dev/null; wget && bash

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.