Running a LXD image on Proxmox

twl

New Member
Oct 30, 2021
14
11
3
Hi, I'm using Proxmox as my home server, and I really like and appreciate your work!

I'm also active in the NextCloudPi docs community.
Recently our main developer (nachoparker) has released a LXD image of NextCloudPi.

LXD.png

I only know how to deploy LXC on Proxmox and have read and watched some stuff to understand LXD/LXC better.
As I understand it LXD is simply a way to deploy LXC (Correct me if I'm wrong). But fundamentally it is LXC.

From my understanding it should be possible to get the NextCloudPi image running under proxmox.
However, the image is packed as: NextCloudPi_LXD_10-08-21.tar.bz2
This can not be uploaded to proxmox.

Is there a way of getting the image up and running under Proxmox, if so, how? Is it packed wrongly?

Here is the build on github: build: add LXC/LXD support
 

Attachments

  • LXD.png
    LXD.png
    60.3 KB · Views: 5
Last edited:
hi,

However, the image is packed as: NextCloudPi_LXD_10-08-21.tar.bz2
This can not be uploaded to proxmox.
it looks like its named wrongly though...

Code:
$ wget https://ownyourbits.com/downloads/NextCloudPi_LXD_10-08-21/NextCloudPi_LXD_10-08-21.tar.bz2
$ file NextCloudPi_LXD_10-08-21.tar.bz2
NextCloudPi_LXD_10-08-21.tar.bz2: gzip compressed data, from Unix, original size modulo 2^32 1638202880
so it's actually gzip file, you can rename it to tar.gz extension and maybe it can work.

there are also other images for nextcloud, namely from turnkeylinux (which you can download using our template tool as well)
Code:
$ pveam available | grep nextcloud
$ pveam download local debian-10-turnkey-nextcloud_16.1-1_amd64.tar.gz

hope this helps
 
  • Like
Reactions: Moayad
thank you @oguz for taking the time to respond. I tried to re-name it to `.tar.gz` but Proxmox still won't even let me upload it.


so it's actually gzip file, you can rename it to tar.gz extension and maybe it can work.

odd.. if I examine the file using my mac it actually tells me:
> Kind: bzip2 compressed archive

I just opened a issue on github/nextcloud/nextcloudpi.

---
I'm aware of the TurnKey template, but NextCloudPi offers a ton of additional features and have a vibrant community behind it.
 
thank you @oguz for taking the time to respond. I tried to re-name it to `.tar.gz` but Proxmox still won't even let me upload it.




odd.. if I examine the file using my mac it actually tells me:
> Kind: bzip2 compressed archive

I just opened a issue on github/nextcloud/nextcloudpi.

---
I'm aware of the TurnKey template, but NextCloudPi offers a ton of additional features and have a vibrant community behind it.
I am having this same issue.

With the file extension as is on https://ownyourbits.com/downloads/NextCloudPi_LXD_10-08-21/ , proxmox refuses to allow me to upload it.

When i tried to recompress it using,
Bash:
bunzip2 -c < file.tar.bz2 | gzip -c > file.tar.gz
I get this output
Bash:
aida@aida-desktop:~/Downloads$ bunzip2 -c < NextCloudPi_LXD_10-08-21.tar.bz2 | gzip -c > NextCloudPi_LXD_10-08-21.tar.gz
bunzip2: (stdin) is not a bzip2 file.
aida@aida-desktop:~/Downloads$ file NextCloudPi_LXD_10-08-21.tar.gz
NextCloudPi_LXD_10-08-21.tar.gz: gzip compressed data, from Unix, original size modulo 2^32 0

I tried using 7-zip to uncompress from tar.bz2 and recompress into tar.gz. I was able to upload that into proxmox. When I tried to create the container using that file, I got many errors like this:
Code:
Creating filesystem with 2097152 4k blocks and 524288 inodes
Filesystem UUID: cb109969-4b6f-4531-9649-7e18ee983e11
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
extracting archive '/var/lib/vz/template/cache/NextCloudPi_LXD_10-08-21.tar.gz'
tar: backup/container/rootfs/bin: Cannot change ownership to uid 100000, gid 100000: Invalid argument
tar: backup/container/rootfs/boot: Cannot change ownership to uid 100000, gid 100000: Invalid argument
tar: backup/container/rootfs/dev: Cannot change ownership to uid 100000, gid 100000: Invalid argument
tar: backup/container/rootfs/etc/.pwd.lock: Cannot change ownership to uid 100000, gid 100000: Invalid argument
tar: backup/container/rootfs/etc/adduser.conf: Cannot change ownership to uid 100000, gid 100000: Invalid argument
tar: backup/container/rootfs/etc/aliases: Cannot change ownership to uid 100000, gid 100000: Invalid argument

The same thing happened when I went full ape and just changed the extension from tar.bz2 to tar.gz

Does anyone please have any advice as to how to get this container file working? I'm very excited about the possibility!
 
I finally have had some time to look into this more.

I was able to solve the issue with the file extension.
Thanks to this post I was able to use the advice given by @wbumiller and convert the LXD to tar.gz

Here is how I did it. (on Manjaro)

After downloading the NCP_LXD image:

Code:
~]$ 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/ or backup/container/ directory, you will get the following error when trying to install on Proxmox:

Code:
  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 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
Code:
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

I can also create a CT with the uploaded template
Code:
  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

So far so good. It is possible to spin up the CT and access the >_Shell HOWEVER..

If I want to access the web interface of Nextcloud, I was first greeted with a promising: “Warning: Potential Security Risk Ahead”

But subsequently disappointed with a:

Forbidden
You don’t have permission to access this resource.

Judging from this error, some permission issue might have arisen when converting to tar.gz or LXD somehow works a bit different in this regard. Honestly, I'm utterly clueless.

One thing I'm unsure about is that in this post, where I have copied the steps for converting the file from, @wbumiller points out the following:

Code:
~/conversion-temp-dir # ls -ld rootfs
<make sure this shows a directory owned by root, not some unkown user>

Here is how it looks in the case of the NCP-LXD Template:

Code:
temp-convrt]$ ls -lah
total 20K
drwxr-xr-x 3 mnj mnj 4.0K 17. Dez 23:36 .
drwxr-xr-x 5 mnj mnj  12K 24. Dez 13:47 ..
drwxr-xr-x 3 mnj mnj 4.0K 17. Dez 23:36 backup
temp-convrt]$ cd backup/
backup]$ ls -lah
total 16K
drwxr-xr-x 3 mnj mnj 4.0K 17. Dez 23:36 .
drwxr-xr-x 3 mnj mnj 4.0K 17. Dez 23:36 ..
d--x------ 4 mnj mnj 4.0K  8. Okt 19:49 container
-rw-r--r-- 1 mnj mnj   96  8. Okt 19:56 index.yaml
backup]$ cd container/
container]$ sudo ls -lah
total 24K
d--x------  4 mnj mnj 4.0K  8. Okt 19:49 .
drwxr-xr-x  3 mnj mnj 4.0K 17. Dez 23:36 ..
-r--------  1 mnj mnj 2.9K  8. Okt 19:56 backup.yaml
-rw-r--r--  1 mnj mnj  529  8. Okt 09:27 metadata.yaml
drwxr-xr-x 16 mnj mnj 4.0K 18. Dez 00:44 rootfs
drwxr-xr-x  2 mnj mnj 4.0K  8. Okt 09:27 templates

mnj is my sudo user of my PC.

drwxr-xr-x 16 mnj mnj 4.0K 18. Dez 00:44 rootfs but this suggests to me that mnj is the owner and not root as it should be... but
permissions on Linux still give me a headache. Can someone tell me if this is correct?





I have raised this same issue in the Nextcloud Forum as well, but this might be a Proxmox issue.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!