Updated as at June 2016 for Proxmox Virtual Environment 4.2-11/2c626aa1
Change the apt sources to point to the community repo. Thanks to niccolox.org
# disable the enterprise repo
sed -i.bak s'/deb/# deb/' /etc/apt/sources.list.d/pve-enterprise.list
# add comunity repo
wget -O /etc/apt/sources.list.d/pve-community.list https://goo.gl/tYnGyt
# update
apt-get update && apt-get -y dist-upgrade
# grab updated templates
pveam update
Now reboot and then download the updated latest LXC templates with pveam update
Rather than have individual image files for container disks, passthrough local folder structure (e.g. for media) to the container. See Promox Wiki Examples:
media root
passthrough to thenfs server
containertranscoding
folder on a RAID0 SSD array passthrough to theplex
container
To do this you need to edit the .conf
file for the container ID in question (shown next to the name in the browser, usually starts at 100).
For example, to add /data/media
as a mount from the host directly into the container with ID 100
:
nano /etc/pve/lxc/101.conf
...
# Mount points zero-indexed, just increment by one if adding more
mp0: /data/media,mp=/data/media
If you have a lxc
container that you want to run as a nfs-kernel-server then the following files need to be edited:
- LXC template
- Apparmour (to allow clients to mount the exports)
Known bug where nfs-kernel-server
package will not install. See Launchpad
nano /etc/pve/lxc/[ID_OF_CONTAINER].conf
...
lxc.aa_profile: unconfined
# /etc/apparmour.d/lxc/lxc-default
profile lxc-container-default flags=(attach_disconnected,mediate_deleted) {
...
mount options=(rw, ro, bind, noatime),
...
Source: Proxmox forums
Need to run the following command as root
inside the container to ensure fuse module is loaded
mknod -m 666 /dev/fuse c 10 229
This change is then lost on a restart of the container.... So create a systemd init service to do it on startup
[Unit]
Description=Workaround for LXC containers to run fuse
Before=network-online.target local-fs.target
[Service]
Type=oneshot
ExecStart=/bin/mknod -m 666 /dev/fuse c 10 229
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Source: James Coyle
# Initial creation (first node)
pvecm create [CLUSTER_NAME]
pvecm status
# On second node
pvecm add [HOSTNAME_OF_CLUSTER_OR_IP_ADDRESS]
Now, remove the need for more than one node to be online at once (it's a homelab after all). Source serverfault. This stops the dreaded cluster not ready - no quorum?
.
pvecm expected 1
# pct resize <vmid> <disk> <size> [OPTIONS]
# disk can be: rootfs, mp0, mp1, mp2, mp3, mp4, mp5, mp6, mp7, mp8, mp9
pct resize 104 rootfs +20G
...