It’s been a wile that @nachoparker has published a LXD of NCP.
In theory, that should make it possible to install NCP on Proxmox as a CT.
However, things are more complicated than they seem. To my knowledge, there is nobody who has succeeded to install it on Proxmox (mid-December 2021).
So let’s try to solve this together. If we succeed, I will write a documentation and add it to Getting started with NextCloudPi on Proxmox and the official NCP Docs.
The first problem is that Proxmox needs .tar.gz the LXC is .tar.bz2
This means it can not even be uploaded.
Workaround
- Decompress
NextCloudPi_LXD_10-08-21.tar.bz2
and compress it as .tar.gz
I found someone with a related issue on the Proxmox Forum and used the advice given to compress the image as .tar.gz
After downloading the NCP_LXD image …
~]$ cd /home/mnj/Downloads/
Downloads]$ ls -l
drwxr-xr-x 2 mnj mnj 4096 30. Nov 21:17 NextCloudPi_LXD_10-08-21
Downloads]$ mkdir temp-convrt
Downloads]$ cd temp-convrt/
temp-convrt]$ tar xpf /home/mnj/Downloads/NextCloudPi_LXD_10-08-21/NextCloudPi_LXD_10-08-21.tar.bz2
temp-convrt]$ ls -l
drwxr-xr-x 3 mnj mnj 4096 17. Dez 23:36 backup
temp-convrt]$ sudo tar cpzf /home/mnj/Downloads/ncp-lxd4proxmox.tar.gz -C backup/container/rootfs/ .
Note: You need to pack backup/container/rootfs/ .
if you try to directly pack the backup/
directory, you will get the following error when trying to install on Proxmox:
Architecture detection failed
Logical volume "vm-285-disk-0" created.
Creating filesystem with 4194304 4k blocks and 1048576 inodes
Filesystem UUID: 6d5f201a-80c7-40ca-9de0-4554b2adf70c
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
extracting archive '/var/lib/vz/template/cache/ncp-lxd4proxmox.tar.gz'
Total bytes read: 1645465600 (1.6GiB, 119MiB/s)
Architecture detection failed: open '/bin/sh' failed: No such file or directory
Falling back to amd64.
Use `pct set VMID --arch ARCH` to change.
/etc/os-release file not found and autodetection failed, falling back to 'unmanaged'
TASK OK
It could be that you also succeed if you pack: backup/container/ .
I believe I tried that and also succeeded to install.
It seems to me, Proxmox does not search the directory. But actually, I have no idea what the issue is.
Packed as .tar.gz the ncp-lxd template can now be uploaded
with this output:
starting file import from: /var/tmp/pveupload-417e9c000df08d3f83c5049b63ed7c04
target node: pve-Server
target file: /var/lib/vz/template/cache/ncp-lxd4proxmox.tar.gz
file size is: 519322469
command: cp -- /var/tmp/pveupload-417e9c000df08d3f83c5049b63ed7c04 /var/lib/vz/template/cache/ncp-lxd4proxmox.tar.gz
finished file import successfully
TASK OK
And it can be installed successfully,
with the following output.
Logical volume "vm-286-disk-0" created.
Creating filesystem with 4194304 4k blocks and 1048576 inodes
Filesystem UUID: 58021b38-dfa6-46c2-a477-0803307ae5a6
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
extracting archive '/var/lib/vz/template/cache/ncp-lxd4proxmox.tar.gz'
Total bytes read: 1641226240 (1.6GiB, 107MiB/s)
Detected container architecture: amd64
Creating SSH host key 'ssh_host_dsa_key' - this may take some time ...
done: SHA256:/aI+KhRxxbpGFe4LLOiIQKaFUhF91Dl28IIt9KJGBdM root@ncp-lxd-rootfs
Creating SSH host key 'ssh_host_rsa_key' - this may take some time ...
done: SHA256:3TnPhwIbn8xyXJSbCt9SKUqk1iliNH4EGsgqai23dYA root@ncp-lxd-rootfs
Creating SSH host key 'ssh_host_ecdsa_key' - this may take some time ...
done: SHA256:ZtzuM49YTDFIcszCIF3JpTDlAnwk2LSFgSTmph0zgTg root@ncp-lxd-rootfs
Creating SSH host key 'ssh_host_ed25519_key' - this may take some time ...
done: SHA256:YUZUKhWUXBqxhA1bWBt2gSJsT0l384JKGv0/3ghWBfM root@ncp-lxd-rootfs
TASK OK
The second problem ist that if you start the CT Container and go to the initialization page with your browser, you will be greeted with a promising:
“Warning: Potential Security Risk Ahead”
but subsequently, you will be disappointed with a:
Forbidden
You don’t have permission to access this resource.
It is possible to use the >_shell
and even reach ncp-config
It will ask to update but seems to fail. Maybe due to ncp not yet being initialized?
output
Running nc-update
Downloading updates
Performing updates
Installing nc-encrypt
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
gocryptfs is already the newest version (1.6.1-1+b20).
0 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up samba-common-bin (2:4.9.5+dfsg-5+deb10u2) ...
Checking smb.conf with testparm
Unable to initialize messaging context!
dpkg: error processing package samba-common-bin (--configure):
installed samba-common-bin package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of samba:
samba depends on samba-common-bin (= 2:4.9.5+dfsg-5+deb10u2); however:
Package samba-common-bin is not configured yet.
dpkg: error processing package samba (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
samba-common-bin
samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
Done. Press any key...
Basically, this is where I’m stuck for now.
Do you have any ideas how to see what the reason is that I get the permission error?