-
Notifications
You must be signed in to change notification settings - Fork 8
Containers in Proxmox VE
It should be easy but there are few quirks.
First you need to get suitable "Template" (tarball with container content) as describe on:
For example:
pveam update
pveam available --section system
pveam download debian-11-standard_11.3-1_amd64.tar.zst
pveam download local debian-11-standard_11.3-1_amd64.tar.zst
pveam list local
Next you have to enable content type rootdir
so it will be offered
as storage. In my case I simply did this:
pvesm status
cat /etc/pve/storage.cfg
# ensure that you do NOT remove any existing content type:
pvesm set local --content iso,vztmpl,backup,rootdir,images
cat /etc/pve/storage.cfg
Normally recent Proxmox allows you to use only Volumes (images formatted with filesystem) from GUI, as pointed out on:
Creating subdir storage is possible from CLI only, for example:
pct create 402 /var/lib/vz/template/cache/debian-11-standard_11.3-1_amd64.tar.zst \
--hostname deb11-ct --rootfs local:0 --password SecurePassword
You can verify that VM filesystem is real subdirectory using command like this:
ls -l /var/lib/vz/images/402/subvol-402-disk-0.subvol/
I was curious and tried container with Gentoo using
pveam download local gentoo-current-openrc_20231009_amd64.tar.xz
pct create 224 /var/lib/vz/template/cache/gentoo-current-openrc_20231009_amd64.tar.xz \
--hostname gentoo-ct --rootfs local:0 --password TopSecretPassword
But when I tried emerge any package (in my case emerge-webrsync && emerge -an tmux
, got:
mount: /proc: cannot mount none read-only.
dmesg(1) may have more information after failed mount system call.
Unable to mark /proc slave: 32
* The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
* does not exist: '/var/tmp/portage/dev-libs/libevent-2.1.12-r1'
There exist two workarounds:
Workaround A:
- https://forums.gentoo.org/viewtopic-t-1095098-start-0.html
- disable
pid-sandbox
feature: - add to
/etc/portage/make.conf
It is likely less secure.FEATURES="-pid-sandbox"
Workaround B:
- https://forum.proxmox.com/threads/gentoo-lxc-image-does-not-have-correct-features.77891/
- allow container nesting:
pct set CONTAINER_ID --features nesting=1
And "power cycle" container (shutdown and start again).
Copyright © Henryk Paluch. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License