Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] LXC Plugin

Featured Replies

I have one problem. All containers run only with terminal command:
 

lxc-start nextcloudpi


staring with web-ui and autostart is not working.

  • Replies 899
  • Views 157.4k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Install SSH Server in Debian based containers:     Method 1 (recommended) :   Attach to the container with "lxc-attach DebianLXC /bin/bash" (replace DebianLXC with your con

  • Is someone here interested in something like a "Button" on the create container page where a Debian Bullseye container is set up with a pretty basic Desktop environment (XFCE4) in conjunction with Tur

  • domrockt
    domrockt

    AWSOMEEEEEEE   

Posted Images

  • Author
1 hour ago, Hayo Tee said:

staring with web-ui and autostart is not working.

Again, I don't give support unless you removed all piracy stuff, extend your trail or bought a license and post a new Diagnostics.

12 hours ago, Hayo Tee said:

sorry for using the pirated version. I haven't decided yet whether to buy the program or not. Because $109 is a lot of money for me. before that, I used OMV and Debian based distro. I chose unraid because it is convenient to manage lxc and VM via the web ui.

It is also advantageous to purchase the product, unRAID, if you find it valuable and continue to use it, especially when you require support for its extensions. Please note that assistance will not be provided for pirated versions of the product. This community and the future of unRAID depend on the support of its legitimate users.

  • 2 weeks later...

on beta 7 yet to test curentl 6 stable release


when i wget to add a template.

image.thumb.png.ad4bf5658214a8aceb1b351eafb7fe79.png

 

the template data is not loading.
How hard would it be to add a unraid path box to downladed templates and load them in here?

Just updated teh pre build to lattest release:


Destroyed unifi lxc, removed previous downloaded template, and rebooted unraid
ran wget command and lxc data not filled in. not sure if something changed or pathing is wrong.

On 6/12/2024 at 3:07 PM, ich777 said:

Thanks for the explanation.

 

This is something that I plan to release, basically pre-made container archives witch certain applications installed that can be downloaded directly through the CA App.

 

I already have a few proof of concept containers, the most complete one is here.

 

BTW, this container can already be installed:

  1. Open a Unraid terminal and execute:
    wget -O /tmp/lxc_container_template.xml https://github.com/ich777/unraid_lxc_pihole/raw/main/lxc_container_template.xml
  2. Open a browser and go to http://<YOUERSERVERIP>/LXCAddTemplate
  3. Install it

Most excellent. Sounds like my Labor Day project has been found! I'd really like LXC applicance templates being built in to the LXC plugin. I use the feature a lot in other platforms. 

  • Author
45 minutes ago, bmartino1 said:

Destroyed unifi lxc, removed previous downloaded template, and rebooted unraid
ran wget command and lxc data not filled in. not sure if something changed or pathing is wrong.

You changed the template wrongly... You are dealing with an XML and you have to escape certain characters and in your case why it's failing is: &

 

Please always try a different template or one from my templates first to see if it is really not working.

 

45 minutes ago, bmartino1 said:

How hard would it be to add a unraid path box to downladed templates and load them in here?

That won't happen, at least not yet.

I'm really not a fan by that because one could really destroy his whole Unraid installation and data with that.

  • Author

@bmartino1 what I have to add for the mount entry is that I specificity scan for that when creating a container from an archive and even if there is a mount entry in the config the plugin will remove it, the user has to do this manually.

 

You should really think of a reliable update script in your container archive instead of every time destroying and recreating the container <- this was never how I intended for what the container archives are used for.

(you really shouldn't have changed the update script that I've provided since it would always download/check for the latest version from Unifi without user intervention, a average user should not have to issue terminal commands and that's also really bad practice because you will probably turn away many people from your container <- keep it simple for them, if a user wants to change something he does it anyways).

  • Author
29 minutes ago, darthkielbasa said:

Most excellent. Sounds like my Labor Day project has been found! I'd really like LXC applicance templates being built in to the LXC plugin. I use the feature a lot in other platforms. 

Have fun! :)

5 minutes ago, ich777 said:

@bmartino1 what I have to add for the mount entry is that I specificity scan for that when creating a container from an archive and even if there is a mount entry in the config the plugin will remove it, the user has to do this manually.

 

You should really think of a reliable update script in your container archive instead of every time destroying and recreating the container <- this was never how I intended for what the container archives are used for.

(you really shouldn't have changed the update script that I've provided since it would always download/check for the latest version from Unifi without user intervention)

it didn't though. i had to go back to the apt release as unfi won't install the lattest deb without user interaction and confriming that there was a backup. the script will deb downlaod the lattest but fail at install.

I have updated parts to help prevent this. and testing. unfortunatly I can't realiable test this. 

  • Author
4 minutes ago, bmartino1 said:

the script will deb downlaod the lattest but fail at install.

You can skip that from what I found from a quick google search, you should first research if you can disable that and also if you maybe can take a auto backup on installation (this is a thing that I haven‘t researched on because I don‘t have a single Unifi network device).

24 minutes ago, ich777 said:

You can skip that from what I found from a quick google search, you should first research if you can disable that and also if you maybe can take a auto backup on installation (this is a thing that I haven‘t researched on because I don‘t have a single Unifi network device).

it's not easy to CLI backup unifi. From experiences, that's more a unifi forum questions. Rather not as I don't want to have to create a continue increase in space. (it more a issue that i can make a backup. but unifi web ui will not see it.) Backups should be on the end user, I would prefer the end user manual do this and make  a lxc snapshot/ backup instead...) I'm currently working on solutions. And have setup this container so that this wouldn't be needed in the future. it's more testing and publishing issues on adding the template to lxc. once that is ironed out i can focus on the needed scripts.
Nothing major is changed except 2 scripts located at /root in the lxc and can be redownloaded for current users...

During testing, the updated unifi script has a front end prompt when updating... I may have to re work it for automations...

 

The destroy, re-add is for my test environment was never a production was extra data to explain and show that the file name and file type were correct for the lxc add template web ui to load.... Minor fixes have been made already.

I just need to re-read your script for update-unify and set up a nonreactive front end to accept yes at the first prompt.... when asked do you have a backup and find a temp solution to unifi make a backup...

Hence, I rather the end user update manual... the release was more an update to make changes to apply my updates due to this change. I've done the research and attempted the solution but these failed hence the release updates... My main issues which you solved already was the in the xml donation link error in xml. I missed that. However, in testing before, I was able to use the template with the "&"... Doesn't matter.

Currently fixing:
image.thumb.png.4be4901ae4074eeb186d9066c44c7d2c.png

 

Edited by bmartino1
spelling and notes

  • 2 weeks later...
  • Author

Just if anyone is curious how to set up Tailscale in a LXC container:

  1. Create a new container and disable Autostart, in this case I will use a Debian Bookworm container (you can of course use any existing container too)
  2. Edit the config file from the container and add this at the end:
    # Allow TUN access
    lxc.cgroup2.devices.allow = c 10:200 rwm
    lxc.mount.entry = /dev/net/tun dev/net/tun none bind,create=file
  3. Start the container and open up a console
  4. Execute this (this will install basic tools and tailscale itself:
    apt-get update && apt-get -y install curl && \
    curl -fsSL https://tailscale.com/install.sh | sh
  5. After everything is installed issue:
    tailscale up
  6. And finally follow the link that is displayed to add the container to your Tailnet

 

 

If you want to run OpenVPN or any other application which needs access to /dev/net/tun simply add the lines from Step 2 to the container config.

  • 2 weeks later...

NGINX Proxy Manager - Install on Debian 12 LXC

 

This post is for reference, if in the future someone needs to get NPM installed in LXC on Unraid.

 

Why: There's a perfectly good docker container in the CA store for NPM, however, by having it in LXC, other packages can easily be installed and maintained along side it. Like Tailscale.

 

So...

 

There's a popular script for Proxmox out there referenced in a number of guides which has dependencies preventing it from working. However, I found another one, that despite some output errors, seems to install everything correctly.

 

Quote

 

The only things I've added have been some additional packages, mainly for testing and maintenance: dnsutils, nano, wget, resolveconf

 

Originally the LXC didn't seem to be getting its nameserver set by DHCP, though it didn't seem to affect performance. I decidced to set my local DNS IP manually anyway, so installed resolveconf and added it in  /etc/resolvconf/resolv.conf.d/head

 

 

 

Edited by Espressomatic

I may have found an issue with the way the plugin creates its folder/share structure.

 

Running Unraid 7.0.0beta2

 

When setting it up, I made sure to specify the lxc directory under my only pool  (/mnt/nvme_pool/lxc/) instead of under user (/mnt/user/lxc). The pool is my only storage on this system.

 

When I look at my shares, this is what I see:

 

 

Screenshot2024-09-22at10_29_27AM.thumb.png.0f4384fa99e74a979e52d16cfe8a688f.png

 

The lxc directory says it's on "array" which doesn't exist. It's the only share on any of my 4 systems that's ever shown up like this.

 

Curious also it shows 0B for free space. Trying to copy anything from Unraid's command-line into the path of the sole Debian container I have set up doesn't work - says disk is full. But I'm not sure if that's a correct way to put content into the container anyway.

 

UPDATE: I fixed the issue by toggling a change (change any setting and change it back)  in the lxc plugin settings which re-enabled the "Apply" button. Pressing Apply then seems to have fixed the issue and the directory is correctly shown as "nvme_pool" along with correct free space.

Edited by Espressomatic

  • Author
8 hours ago, Espressomatic said:

This post is for reference, if in the future someone needs to get NPM installed in LXC on Unraid.

On Unraid you can actually create container archives for that that you can then install through a template similar to Docker.

For refference you can look at my repositories here (PiHole is the most complete one and in the README.md is a detailled description on how to install the templates currently) :

https://github.com/ich777?tab=repositories&q=Lxc&type=&language=&sort=

 

I‘m not sure if I want to do that because I don‘t use NginxProxyManager personally, however it should be easy to set up.

 

Since this is a s6-overlay container I have something cool coming for such containers where you maybe want to install Tailscale. ;)

 

4 hours ago, Espressomatic said:

When setting it up, I made sure to specify the lxc directory under my only pool  (/mnt/nvme_pool/lxc/) instead of under user (/mnt/user/lxc). The pool is my only storage on this system.

This should not happen and I‘m not able to reproduce this on my test server.

On a new instance I set the path to /mnt/cache/lxc and the path is on the Cache when I look in the terminal, when I then create the container everything is working es expected and the path is: /mnt/cache/lxc/Debian where in that folder is the file config located and the folder rootfs

9 hours ago, ich777 said:

On a new instance I set the path to /mnt/cache/lxc and the path is on the Cache when I look in the terminal,

 

That much was also correct on my system. Even installing packages inside the container worked without issue. The only way I found the error was by copying in Unraid's (not the container's) shell and getting the no free space error. That led me to look at the Shares tab in Unraid where I saw the image I posted above.

 

9 hours ago, ich777 said:

Since this is a s6-overlay container I have something cool coming for such containers where you maybe want to install Tailscale

Like a simple check-box when creating the container to include Tailscale? ;)

 

The only issue I had with NPM was that it's only distributed for docker and I had no clue how to install it any other way - so I had to hunt for someone else's script. A baremetal download/install, download/compile/install or package download from an existing repo for the host OS would have been pretty straight-forward.

 

I'm loving having the option of rolling out LXC as-needed on Unraid, even if I don't have immediate plans to install anything else yet.

BTW, how do we set CPU/core and memory usage/limits for individual containers? I'm not sure if I missed that somewhere, as it was late last night while I read much of the thread.

 

OK, just like the other post someone wrote about this... nevermind, found the reference:

 

 

 

 

 

Edited by Espressomatic

  • Author
3 hours ago, Espressomatic said:

Example, CPU #10 and 512MB RAM limit:

Please do it like that in your config:

#Resource limitation
lxc.cgroup2.cpuset.cpus = 10

 

 

A detailed post is here:

 

Thanks, I didn't find any info about memory.max, only the memory.limit_in_bytes  I had posted.

 

They seem to do different things.

 

Here's what limit in bytes looks like:  the total memory seen by the lxc is 512M

 

Screenshot2024-09-21at2_51_43PM.png.d4b2f2c65fad82d10837057407b9a5bd.png

 

And memory max here: the total memory seen by the lxc is ~16GB (the total I have installed on this system)

Screenshot2024-09-21at2_55_25PM.png.5fc257ee7b384c6c0a526c6779d994c8.png

  • Author
3 minutes ago, Espressomatic said:

Here's what limit in bytes looks like:  the total memory seen by the lxc is 512M

Sorry the post above (in the code box) was wrong, please look at the linked post.

 

However, I would recommend that you actually use cgroup2 not cgroup since we are dealing with cgroup2 here...

 

EDIT: However this was quite some time ago and I can't remember if that was actually correct however I tested one (or the other) setting with 2G and it would simply crash and restart if the limit was reached, however I wouldn't recommend setting the limit to 512MB since it seems a bit too tight to me...

On 9/21/2024 at 12:45 AM, ich777 said:

This should not happen and I‘m not able to reproduce this on my test server.

 

I've duplicated the "Array" issue on another two machines. Seems like the magic recipe is that these servers have only pools, no array. The one pictured here has a pool consisting of a single NVME, and the other has a pool of 6 spinners in ZRAID2.

 

Screenshot2024-09-22at10_22_26AM.thumb.png.fdc6c7b2930edde008160e14c8e33bac.png

 

The issue is "repaired" by simply making an edit to the share, even something as simple as adding a comment and then applying.

 

Edited by Espressomatic

  • Author
45 minutes ago, Espressomatic said:

Seems like the magic recipe is that these servers have only pools, no array.

That should also be no issue at all because the plugin creates the paths on it's own and is independent from the Array or a Cache pool as long as the directory is located directly on the pool.

 

Have you ever thought that this is a visual bug in the shares section?

Did you actually look in the terminal if the path was there and if you can create containers?

 

45 minutes ago, Espressomatic said:

The issue is "repaired" by simply making an edit to the share, even something as simple as adding a comment and then applying.

Then it's most likely an issue from the Shares section because the path was created not by Unraid itself and Unraid or better the Shares section has no idea where the path points to.

 

However it would be very interesting if you can create containers and see if the directory for LXC was properly created in the terminal, my assumption is that this is an issue with the Shares section and would maybe fix itself after a reboot.

 

45 minutes ago, Espressomatic said:

ZRAID2

I hope you are using ZFS as the Storage Backing Driver in the LXC plugin settings and not Directory...

11 minutes ago, ich777 said:

Have you ever thought that this is a visual bug in the shares section?

Did you actually look in the terminal if the path was there and if you can create containers?

 

It's not simply visual. Uncorrected, this issue prevents file copying in terminal, where it thinks the lxc destination is "full."

 

OK, I've definitively confirmed this isn't an issue with the plugin - it's an issue in Unraid 7beta itself.

 

$ mkdir /mnt/pool/testing

 

image.thumb.png.510f7326d972b4f99d8963ffaf2e2302.png

 

I'll post a bug report.

 

Edited by Espressomatic

  • Author
6 minutes ago, Espressomatic said:

It's not simply visual. Uncorrected, this issue prevents file copying in terminal, where it thinks the lxc destination is "full."

Tanks for the explanation. :)

 

This is caused because you are using /mnt/user/... from the terminal, please always use the real file path not /mnt/user/... when specifying a path other then /mnt/user/... in a plugin <- that's actually your issue.

 

6 minutes ago, Espressomatic said:

From the plugin settings itself there's no issue, as I can create/install containers, I can open a terminal within the container and wget and apt install additional packages, etc.

Yup, that's actually why it's working, the plugin uses /mnt/nvme_pool/... not /mnt/user/...

 

There is nothing I can do about that.

If you want to copy files through /mnt/user/... you have to tell Unraid where the share is located and that it's main storage is the specified Pool, because Unraid has no idea what the main storage is.

 

I wouldn't recommend messing with the rootfs from a LXC container anyways because you can basically destroy the container if you do copy/change something.

 

 

I assume you didn't see that from my previous post:

12 minutes ago, ich777 said:

I hope you are using ZFS as the Storage Backing Driver in the LXC plugin settings and not Directory...

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.