Making it possible: NextCloudPi LXD on Proxmox

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?

2 Likes

I’ve followed your instructions and am even more stuck than you. :laughing: I can’t login through the console, and the web splash page isn’t showing when I browse to the IP of the container.

When I try to use the console through proxmox, I just see

Debian GNU/Linux 10 NextCloudPiLXD tty1

NextCloudPiLXD login: 

and any user/pass combo I have tried has failed.

to augment (I think) your instructions a bit and make them not dependent on the username, I used

cd Downloads
mkdir temp-convrt
cd temp-convrt
tar xpf ../NextCloudPi_LXD_10-08-21.tar.bz2 
sudo tar cpzf ../ncp-lxd4proxmox.tar.gz -C backup/container/rootfs/ .

Try accessing the console using the shell of your pvm node. You can do that by using.

lxc-attach --name 100

Change 100 for the number you have given to your CT.

This lets you access the console of your container without using credentials.

The password user of the CT should be root and the password the one you have given in the process of setting it up.
However, I have to admit, I went straight for the lxc-attach --name 100 as I was feeling lazy :sweat_smile:

Thank you very much! I thought I had tried root/the password I entered, but I guess I didn’t or I botched it. I’m in now!

I’ve added both the ip address and hostname of the container to config.php and rebooted, but I am getting the same

Hooray! We’re stuck in the same spot! :laughing:

I will spend some more time trying to figure this out after Christmas, but I’m very pessimistic about my odds of success. Hopefully some other kind soul can help set us straight!

Note to myself or anyone who wants to try. (I might have some time later in the week or in January to try myself.)

See this to try and fix the problem.

1 Like

I want to Adjust file permissions & ownership of the webroot directory. But I’m not even shure which one that is. :see_no_evil:
Is it /var/www/ ?

I can see that I have the following NCP-relevant users

  • www-data
  • ncp

Here is some relevant output:

root@ncp-lxd-rootfs:~# less /etc/passwd
bash: less: command not found
root@ncp-lxd-rootfs:~# getent passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:104:105::/nonexistent:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
mysql:x:105:109:MySQL Server,,,:/nonexistent:/bin/false
postfix:x:106:111::/var/spool/postfix:/usr/sbin/nologin
redis:x:107:113::/var/lib/redis:/usr/sbin/nologin
ncp:x:1000:1000::/nonexistent:/usr/sbin/nologin
dnsmasq:x:108:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
avahi:x:109:115:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/usr/sbin/nologin

root@ncp-lxd-rootfs:~# ls -lah /var/www/
total 28K
drwxr-xr-x  7 ncp 1001 4.0K Oct  8 17:54 .
drwxr-xr-x 12 ncp 1001 4.0K Oct  8 17:50 ..
drwxr-xr-x  2 ncp 1001 4.0K Oct  8 17:50 html
drwxr-xr-x  8 ncp 1001 4.0K Oct  8 17:54 ncp-app
drwxr-xr-x  4 ncp 1001 4.0K Oct  8 17:54 ncp-previewgenerator
drwxrwx---  8 ncp 1001 4.0K Oct  8 17:54 ncp-web
drwxr-x--- 14 ncp 1001 4.0K Oct  8 17:52 nextcloud

@nachoparker , @OliverV, or anyone else… Could you maybe give me a hint? Who needs which permissions? And are the permissions and ownership for /var/www/nextcloud correct?

1 Like

This what my /var/www looks like:

sudo ls -lhtr /var/www/
total 20K
drwxr-xr-x 2 root root 4,0K Nov 30 2020 html
drwxrwx— 9 www-data www-data 4,0K Nov 4 06:25 ncp-web
drwxr-x— 14 www-data www-data 4,0K Nov 25 19:26 nextcloud
drwxr-xr-x 8 root root 4,0K Dec 15 06:25 ncp-app
drwxr-xr-x 4 www-data www-data 4,0K Dec 15 06:25 ncp-previewgenerator

1 Like

I noticed under ncp-config / CONFIG / nc-webui was disabled. I enabled it, but I still can’t access it. in fact, I’ve regressed and just get a “this site can’t be reached” from my browser when trying to access the nextcloudpi IP or nextcloudpi IP:4443

In the absence of any other clue what to do, I tried to use nc-update to update nextcloudpi. That failed, and here is the 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 18 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...

and…

root@NextCloudPiLXD:~# sudo ncp-update
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
root@NextCloudPiLXD:~# 

Edit: also, I think that I was getting the

when I had my IPV4/CIDR address and gateway misconfigured. I now have network access (e.g. can ping google.com from within the LXC, and see that nextcloudpi v1.40.4 is outdated, when I could not before).

I have now failed in another way!

I tried to create an LXC from scratch, using the debian buster instructions. I used proxmox’s debian-10-standard template. After creating the lxc, I had to enter

apt-get update --allow-releaseinfo-change

as buster is now oldstable
I then did

apt-get upgrade
apt install curl
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash

from there, nextcloudpi is running! woohoo! I can access ncp-config and so on. However, when I navigate to the IP for my instance, my browser just reports “This site can’t be reached. The connection was reset.”

I’ve added the IP to trusted_domains in config.php (localhost was already there), and tried a few other things in ncp-config to no avail.

This is the output of sudo ncp-report, excluding the Nextcloud Logs. Is any kind person able to see any obvious issues in here and set me straight?

NextCloudPi diagnostics

NextCloudPi version  v1.46.7
NextCloudPi image    NextCloudPi_lxc_01-15-22
OS                   Debian GNU/Linux 10. 5.13.19-2-pve (x86_64)
automount            no
USB devices          none
datadir              /var/www/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      2.2G/7.8G
rootfs usage         2.2G/7.8G
swapfile             none
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    22.2.2.0
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          down
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               14min

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "7": "nextcloudpi",
            "5": "nextcloudpi.local",
            "8": "nextcloudpi.lan",
            "3": "nextcloudpi",
            "9": "192.168.1.244",
            "1": "192.168.1.244",
            "14": "NextCloudPiLXCDIY.local",
            "11": "75.68.160.139"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "22.2.2.0",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/var\/www\/nextcloud\/data\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https"
    }
}

HTTPd logs

[Sat Jan 15 19:42:57.167637 2022] [ssl:error] [pid 144:tid 140447081096320] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sat Jan 15 19:42:57.168258 2022] [ssl:error] [pid 144:tid 140447081096320] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sat Jan 15 19:42:57.168268 2022] [ssl:error] [pid 144:tid 140447081096320] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Sat Jan 15 19:42:57.187838 2022] [ssl:error] [pid 241:tid 140447081096320] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sat Jan 15 19:42:57.187866 2022] [ssl:error] [pid 241:tid 140447081096320] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sat Jan 15 19:42:57.189188 2022] [ssl:error] [pid 241:tid 140447081096320] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sat Jan 15 19:42:57.189212 2022] [ssl:error] [pid 241:tid 140447081096320] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Sat Jan 15 19:42:57.192300 2022] [mpm_event:notice] [pid 241:tid 140447081096320] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Sat Jan 15 19:42:57.192339 2022] [core:notice] [pid 241:tid 140447081096320] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jan 15 19:53:34.618942 2022] [mpm_event:notice] [pid 241:tid 140447081096320] AH00491: caught SIGTERM, shutting down
[Sun Jan 16 18:51:37.904844 2022] [ssl:error] [pid 160:tid 139925875594368] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sun Jan 16 18:51:37.905096 2022] [ssl:error] [pid 160:tid 139925875594368] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sun Jan 16 18:51:37.905644 2022] [ssl:error] [pid 160:tid 139925875594368] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sun Jan 16 18:51:37.905666 2022] [ssl:error] [pid 160:tid 139925875594368] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Sun Jan 16 18:51:37.940987 2022] [ssl:error] [pid 234:tid 139925875594368] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sun Jan 16 18:51:37.941017 2022] [ssl:error] [pid 234:tid 139925875594368] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sun Jan 16 18:51:37.941495 2022] [ssl:error] [pid 234:tid 139925875594368] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Sun Jan 16 18:51:37.941505 2022] [ssl:error] [pid 234:tid 139925875594368] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Sun Jan 16 18:51:37.945855 2022] [mpm_event:notice] [pid 234:tid 139925875594368] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Sun Jan 16 18:51:37.945892 2022] [core:notice] [pid 234:tid 139925875594368] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2022-01-16 18:51:38 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-01-16 18:51:38 0 [Note] InnoDB: Number of pools: 1
2022-01-16 18:51:38 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-01-16 18:51:38 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M
2022-01-16 18:51:38 0 [Note] InnoDB: Completed initialization of buffer pool
2022-01-16 18:51:38 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-01-16 18:51:38 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-01-16 18:51:38 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-01-16 18:51:38 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-01-16 18:51:38 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-01-16 18:51:38 0 [Note] InnoDB: Waiting for purge to start
2022-01-16 18:51:38 0 [Note] InnoDB: 10.3.31 started; log sequence number 3573277; transaction id 3901
2022-01-16 18:51:38 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-01-16 18:51:38 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-01-16 18:51:38 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-01-16 18:51:38 0 [Note] Reading of all Master_info entries succeeded
2022-01-16 18:51:38 0 [Note] Added new Master_info '' to hash table
2022-01-16 18:51:38 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.31-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2022-01-16 18:51:38 0 [Note] InnoDB: Buffer pool(s) load completed at 220116 18:51:38

Also, whoever put the code for sections and code snippets right into the log output… genius!

1 Like

Is it possible for one to use btrfs as the file system within an LXD on proxmox? I’ve made good progress, but am stuck when trying to add my external hard drive.

I was using an external HDD formatted with BTRFS with my raspberry pi as my main data directory. I pulled that HDD from my pi and am trying to add it to my proxmox lxc. I am “able” to mount it, but I can’t see its contents, only lost+found. It also shows the filesystem type as ext4.

Filesystem                       Type      Size  Used Avail Use% Mounted on
/dev/mapper/pve-vm--100--disk--0 ext4      7.8G  2.1G  5.4G  28% /
/dev/loop0                       ext4      2.0T   32K  1.9T   1% /mediaseagate

When I navigate to the btrfs associated with the external HDD from the proxmox shell, I can see the contents.

I don’t think that is possible. But also not needed.
If I’m not mistaken all NCP images use ext4 as the file system. Only the data drive uses BTRFS and they work together perfectly well.

Currently my PVE VM has this very setup.


How did you connect the USB to the PVE ncp CT (LXD) did you directly pass through the USB device? If so, at least in the VM it should detect the correct file system.

if it does not work, maybe you can try to add it to /etc/fstab specifying to mount as btrfs?


Can you share how you made it this far?

Well I have once installed and setup NCP in a LXC container. As it is true it probably is tough to get working as an easy to install service in Proxmox, then remember that NCP can be installed using one script. All you needs is the right apts in the container image and not on the Proxmox host as such. Venturing the road of preparing the container and image for NCP for running the install script successfully, might do the trick.

However I do not use NCP today. I have installed Nextcloud from scratch aswell as all the needed services - still in a LXC container - as I find that easier to customize and enhance to my own liking.

I tried to install in a normal debian 10 LXC using the curl script. However, I never got it working and got errors.

After quite some research and asking for help I finally gave up as I could not find out how to solve the errors that came up.
Even though there where people who seem to have succeeded. LXC · Issue #1058 · nextcloud/nextcloudpi · GitHub

It would be amazing if you @Kerasit could share how you got around the issues.

I think there are a number of people who are looking to have a NCP LXC up and running on Proxmox.

Basically I installed all the needed apts and ran the script not using SUDO, as I was loggedin as root.
I slowly solved each issue as it came. It is 2 years ago I switched, so frankly I cannot remember the details.
I came very far with using a personal user created in the container image and allowed SUDO as root for that user aswell, as then the script was possible to run as-is. What is hard is the NCP webservice and layer and not NC itself. But thats what I remembers.

I have “resolved” my mount issue by following the advice of this post, I needed to create a bind mount point, not whatever the heck I had done instead.

I am now however to my next issue (I am proving to be much more out of my depth than I expected…), when I try to run “ncp-import-nc” I am getting this output. Also, I’ve noticed that many tools seem to be missing, such as nc-database and nc datadir.

Running nc-import-ncp
tar: /media/myCloudDrive/ncp-config_20220125.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
Running unattended-upgrades
Unattended upgrades active: yes (autoreboot true)
Running nc-maintenance
Maintenance mode already enabled
Running nc-webui
Site ncp already enabled
ncp-web enabled
Running nc-notify-updates
update web notifications enabled
Running nc-previews-auto
Automatic preview generation enabled

configuration restored
Done. Press any key...

Here are the first three sections of ncp-report… perhaps some wizard can read the tea leaves?

NextCloudPi diagnostics

NextCloudPi version  v1.46.7
NextCloudPi image    NextCloudPi_lxc_01-15-22
OS                   Debian GNU/Linux 10. 5.13.19-2-pve (x86_64)
automount            no
USB devices          sdb 
datadir              /var/www/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      2.1G/7.8G
rootfs usage         2.1G/7.8G
swapfile             none
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    22.2.2.0
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          up
Postfix service      up
internet check       ok
port check 80        closed
port check 443       closed
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               1min

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "7": "nextcloudpi",
            "5": "nextcloudpi.local",
            "8": "nextcloudpi.lan",
            "3": "nextcloudpi",
            "9": "192.168.1.244",
            "1": "192.168.1.244",
            "14": "nextcloudpi.local",
            "11": "75.68.160.139"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "22.2.2.0",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/var\/www\/nextcloud\/data\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false
    }
}

HTTPd logs

[Fri Jan 28 01:50:22.521209 2022] [proxy_fcgi:error] [pid 2718:tid 140711476283136] [client 192.168.1.113:47734] AH01067: Failed to read FastCGI header
[Fri Jan 28 01:50:22.521271 2022] [proxy_fcgi:error] [pid 2718:tid 140711476283136] (104)Connection reset by peer: [client 192.168.1.113:47734] AH01075: Error dispatching request to :4443: 
[Fri Jan 28 01:50:22.521976 2022] [proxy_fcgi:error] [pid 240:tid 140711266465536] [client 192.168.1.113:47730] AH01067: Failed to read FastCGI header
[Fri Jan 28 01:50:22.522015 2022] [proxy_fcgi:error] [pid 240:tid 140711266465536] (104)Connection reset by peer: [client 192.168.1.113:47730] AH01075: Error dispatching request to :4443: 
[Fri Jan 28 01:50:22.529560 2022] [proxy_fcgi:error] [pid 240:tid 140711274858240] [client 192.168.1.113:47730] AH01067: Failed to read FastCGI header
[Fri Jan 28 01:50:22.529600 2022] [proxy_fcgi:error] [pid 240:tid 140711274858240] (104)Connection reset by peer: [client 192.168.1.113:47730] AH01075: Error dispatching request to :4443: 
[Fri Jan 28 01:50:22.659561 2022] [mpm_event:notice] [pid 238:tid 140711489614976] AH00491: caught SIGTERM, shutting down
[Fri Jan 28 02:03:52.414446 2022] [ssl:error] [pid 139:tid 140215028524160] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Fri Jan 28 02:03:52.414661 2022] [ssl:error] [pid 139:tid 140215028524160] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Fri Jan 28 02:03:52.433402 2022] [ssl:error] [pid 232:tid 140215028524160] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Fri Jan 28 02:03:52.433419 2022] [ssl:error] [pid 232:tid 140215028524160] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Fri Jan 28 02:03:52.435251 2022] [mpm_event:notice] [pid 232:tid 140215028524160] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Fri Jan 28 02:03:52.435288 2022] [core:notice] [pid 232:tid 140215028524160] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jan 28 02:06:06.628239 2022] [mpm_event:notice] [pid 232:tid 140215028524160] AH00491: caught SIGTERM, shutting down
[Fri Jan 28 02:07:07.397639 2022] [ssl:error] [pid 143:tid 140540324684928] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Fri Jan 28 02:07:07.397789 2022] [ssl:error] [pid 143:tid 140540324684928] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Fri Jan 28 02:07:07.423560 2022] [ssl:error] [pid 217:tid 140540324684928] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 754BC334BB9ED71FD78EE21D480E0CCDE3A15384 / notbefore: Dec 11 08:03:36 2020 GMT / notafter: Dec  9 08:03:36 2030 GMT]
[Fri Jan 28 02:07:07.423587 2022] [ssl:error] [pid 217:tid 140540324684928] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Fri Jan 28 02:07:07.429504 2022] [mpm_event:notice] [pid 217:tid 140540324684928] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Fri Jan 28 02:07:07.429686 2022] [core:notice] [pid 217:tid 140540324684928] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2022-01-28  2:07:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-01-28  2:07:07 0 [Note] InnoDB: Number of pools: 1
2022-01-28  2:07:07 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-01-28  2:07:07 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M
2022-01-28  2:07:07 0 [Note] InnoDB: Completed initialization of buffer pool
2022-01-28  2:07:07 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-01-28  2:07:07 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-01-28  2:07:07 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-01-28  2:07:07 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-01-28  2:07:07 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-01-28  2:07:07 0 [Note] InnoDB: Waiting for purge to start
2022-01-28  2:07:07 0 [Note] InnoDB: 10.3.31 started; log sequence number 24710301; transaction id 138829
2022-01-28  2:07:07 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-01-28  2:07:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-01-28  2:07:07 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-01-28  2:07:07 0 [Note] Reading of all Master_info entries succeeded
2022-01-28  2:07:07 0 [Note] Added new Master_info '' to hash table
2022-01-28  2:07:07 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.31-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2022-01-28  2:07:07 0 [Note] InnoDB: Buffer pool(s) load completed at 220128  2:07:07

I am not sure exactly how I managed to overcome my previous issue wherein I couldn't get the splash page to appear... I suspect that I may have somehow missed and then re-found the activation page.

some ncp-apps do not get installed in containerized environments (look in update.sh)

I’m also unable to install ncp via LXD on Proxmox.
Has anyone been able to make it work and might be so kind to share a guide?

I installed NCP on Proxmox with this help:

Basically the whole installation worked perfectly, but I am also facing the issue that many ncp apps are not available, like hdd automount, datadir and others.
So at the moment I am lost how to add the HDD with all files, that I currently use on my NCP installation on a raspberry pi.
After seeing this thread I ask myself if NCP as LXC container on Proxmox is not really usable? Or do I just need to follow this Getting started with NextCloudPi on Proxmox or this NextCloudPi [VM] on Proxmox to mount my HDD and then I am fine?
So far my datadir was /media/USBdrive/ncdata.
In the proxmox installation it is /var/www/nextcloud/data.
As it looks like I cannot change this, would I need to mount the HDD folder into /var/www/nextcloud/data? I guess that is not possible to mount into this folder, isn´t it?

Would installing NCP into a Debian VM make anything easier here?
According to How to get started with NCP docker also in Docker nc-datadir and so on are not available, so this would lead to the same situation (plus so far I never needed docker, so no experience with that).

1 Like

Yes, Proxmox is a VM Hypervisor, you configure it within “hardware” as shown in the picture of my configuration below

This is how it looks like for the node

I created the VM using NCP’s LXD image, importing it as a VM .img file, which are found in the ISO tab of Proxmox as shown below.

And here you can see my attempts at importing and using it as a CT image, which I have failed to do so far. Note I haven’t tried this in quite a while as you can see by the version numbers in the images above

For Docker, the volume is where you specify your data directory

More fundamentally, it seems more like you aren’t really understanding what these softwares are & do that you are using :slight_smile: (i.e Proxmox itself, or maybe just VM Hypervisors & Docker containers), at least not yet. They can be quite difficult to understand after all, I don’t know everything about them myself either :pray:

I found it confusing that I still find information about a VM (also on Nextcloudpi.com), but not a download link for that anymore. This post here talks about using an LXD like a LXC and that this is not really working, while I also read in some posts here that people seem to have managed that. So this is overall not clear, what is outdated and what the recent status quo is.
Nevertheless, I got a CT working with the help of Proxmox Helper Scripts | Proxmox Scripts For Home Automation
So this working.
I think I can also achieve to get the HDD into the CT at all.

The topic is more what happens then to bring my old HDD together with a datadir path that I cannot edit via ncp-config and that points to a directory that I probably need to adjust.
But this is then more related to How to configure an external USB drive with NextCloudPi - #7 by johndoe0815 where you also started replying, while this thread here is more on how to bring the LXD into Proxmox.

1 Like