Build a home media server

I successfully created the container.

I configured the container in LuCI > LXC Containers: I added what you wrote at the end of the file.

So that would be:

# Template used to create this container: /usr/share/lxc/templates/lxc-download
# Parameters passed to the template: --server api.turris.cz/lxc --no-validate --dist Debian --release Jessie --arch armv7l
# For additional config options, please look at lxc.container.conf(5)

# Distribution configuration
lxc.arch = armv7l

# Container specific configuration
lxc.tty = 4
lxc.pts = 1024
lxc.rootfs = /srv/lxc/OpenMediaVault/rootfs
lxc.utsname = OpenMediaVault

# Network configuration
lxc.network.type = veth
lxc.network.link = br-lan
lxc.network.flags = up
lxc.network.name = eth0

# Block configuration
lxc.cgroup.devices.allow = b 8:0 rwm # sda
lxc.cgroup.devices.allow = b 8:1 rwm # sda1

# Passthrough Printer and USB devices
lxc.mount.entry=/dev/bus/usb dev/bus/usb none bind,optional,create=dir 0 0
lxc.cgroup.devices.allow = c 180:* r

lxc.mount.entry=/dev/usb dev/usb none bind,optional,create=dir 0 0
lxc.cgroup.devices.allow = c 189:* rw

In the terminal I edited the /etc/rc.local file with what you wrote

question: do I have to keep the line ‘exit 0’?

So that would be:

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

# Code for OpenMediaVault
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2
mknod /dev/sda3 b 8 3
mknod /dev/sda4 b 8 4

mknod /dev/sdb b 8 16
mknod /dev/sdb1 b 8 17
mknod /dev/sdb2 b 8 18
mknod /dev/sdb3 b 8 19
mknod /dev/sdb4 b 8 20

echo /sys/block/sd? /sys/block/sd?/sd?? | xargs -r -n1 udevadm test

fsck -A
mount -a

# Do I need that line?
exit 0

I don’t know what to do with LXC /etc/apt/sources.list.d/openmediavault.list

question: do I have to create those directories and file (and put the content you wrote in it) or do I have to install a package?

Then the installation itself

question: it doesn’t know the command ‘apt-get’

Thanks for the help

1 Like