[Plugin] LXC Plugin


Recommended Posts

3 hours ago, The_Eric said:

I wanted to use nix / nixos and I couldn't find any info in this thread.

Thank you for the write up!

 

If you are interest I can add a logo for NixOS in the next update from the plugin, you would only need to make a minor change to the config to see the logo afterwards on the LXC page. :)

 

EDIT: This would look something like that:

grafik.thumb.png.1895b65e89cfb2e9189027601b5dd023.png

  • Like 1
Link to comment
21 hours ago, ich777 said:

Thank you for the write up!

 

If you are interest I can add a logo for NixOS in the next update from the plugin, you would only need to make a minor change to the config to see the logo afterwards on the LXC page. :)

 

EDIT: This would look something like that:

grafik.thumb.png.1895b65e89cfb2e9189027601b5dd023.png

 

That would be cool!

Link to comment
  • 2 weeks later...

Just a feedback, I have been using it for a while already, months I think, and It have been such a good experience!

 

Im running 6 containers (2 debian 4 alpine), 4 of them is production (1 debian 3 alpine). Everything running amazing well and smooth...

 

I really love and appreciate the work you have bring to Unraid. It is an incredible experience to use it.

 

Only thing that may have bother me is the user mapping, since it is root some containers may "conflict" users/groups, but I have moved those to 1000, so if you know what you are doing you will be fine!

Thanks!!!

Edited by fabricionaweb
  • Like 1
Link to comment
1 hour ago, fabricionaweb said:

how to create a slackware container

May I ask first why do you need a Slackware container?

 

1 hour ago, fabricionaweb said:

I googled a lot, I found some stuff, one lxc-template, but Im not confident enough to run it... I prefer to ask first

Currently only the containers from the LXC registry are working, I've never tried to installing a container from a template, or better speaking building it from a template on Unraid. Don't know if everything will work out as it should.

  • Thanks 1
Link to comment
1 hour ago, ich777 said:

May I ask first why do you need a Slackware container?

 

I was thinking in having a container for development and build some packages when needed. 

 

Maybe I do some backups first and try to compile that template later. Or maybe I just go VM

Edited by fabricionaweb
  • Like 1
  • Thanks 1
Link to comment
57 minutes ago, fabricionaweb said:

I was thinking in having a container for development and build some packages when needed. 

For Unraid itself? You could also do that in a Docker container...

 

58 minutes ago, fabricionaweb said:

Maybe I do some backups first and try to compile that template later. Or maybe I just go VM

I know the template that you've linked but I haven't got time yet to wrap my head around it.

  • Thanks 1
Link to comment

I have running experiments and seems that I got it.

 

As far as it concern to security, to the mount points, those /dev /proc stuffs, Im really dont not know much, so I can not review it or say nothing about it. Yet Im testing. 

 

But I have already found some particularities:

 

- For this container the mac address in the config file does not work, so we just dont add it. It seems like the Slackware has they things about it. But just enabling DHCP worked. Every reboot has a new MAC but I think I can change it in some Slackware way.

- It was missing some packages in the container to be able to run gpg signatures and the repository, so I added.


After install two packages on Unraid (slackpkg and gnupg) I could build the container fine :tada

If you want see what I have done, I made a small documentation about it (git history mostly)

https://github.com/fabricionaweb/lxc-slackware

 

I have not done my things yet inside the container, its early to say much. But the container is

running.

 

-- update

 

Just a heads up, after one small issue in the container (about the gpg), I ran `update-ca-certificates --fresh` to fix. Installed dependencies and already building the packages I wanted just fine.

 

I think its working :)

 

Edited by fabricionaweb
  • Like 1
Link to comment
5 hours ago, primeval_god said:

The current looks like of out of place in the Azure theme.

I didn't even noticed that this is a issue since I don't use that, I will look into that, thanks for the report!

 

Would that be sufficient for you:
grafik.png.860db4e664862bc6a964ec770689d980.png

 

grafik.png.4b88b58226e8054a1f2e318b3e838934.png

 

Of course this would be also possible:
grafik.png.f855ef70d73eb5d5c93a417cf0dad8b7.png

 

grafik.png.f8cb412c4b7a6e705c5522c7f5afb9a1.png

 

I think just for consistency the second would be better, what are your thoughts on this @primeval_god?

Link to comment
7 hours ago, ich777 said:

I didn't even noticed that this is a issue since I don't use that, I will look into that, thanks for the report!

 

Would that be sufficient for you:
grafik.png.860db4e664862bc6a964ec770689d980.png

 

grafik.png.4b88b58226e8054a1f2e318b3e838934.png

 

Of course this would be also possible:
grafik.png.f855ef70d73eb5d5c93a417cf0dad8b7.png

 

grafik.png.f8cb412c4b7a6e705c5522c7f5afb9a1.png

 

I think just for consistency the second would be better, what are your thoughts on this @primeval_god?

I also like the second better, but either one looks great! 

  • Thanks 2
Link to comment
  • 1 month later...

Is it possible to run CUDA in a LXC container? Having an issue and I'm unsure of where to start troubleshooting. 
 

I have my Quadro P400 exposed to my Ubuntu 22.04 container and can see it from nvtop inside the container. 
 

Driver in the container is the 535 branch, the exact same version that is installed in unraid.

 

Inside the container I have installed CUDA 11.2 and cuDNN 8.1.0. Both seem to be installed fine. 
 

The issue is the app I need the GPU for says that it has loaded all the libraries but that it cant load the GPU…

 

I don’t know if its a permissions issue or what. 

 

For those curios im trying to setup the Nextcloud app Recognize. 

Link to comment
5 hours ago, ich777 said:

Please look at the first recommended post on top from @juan11perez.

 

It should be possible indeed.

 

Please also share your Diagnostics so that I can see how everything is configured.


That post was actually what inspired me to try LXC. 
 

But I think I might have found part of my issue. In my excitement to get everything setup, it never dawned on me to create a user inside the container 😅 so I had done everything as root. 
 

I ended up nuking that container last night since I also started having an unrelated issue with PostgreSQL too.
 

Im going to start fresh. I will post back with how everything worked out. 

  • Like 1
Link to comment

@ich777 ok I managed to figure out the issue. When I first setup the container I needed to add to my config,

lxc.cgroup2.devices.allow = c 195:* rwm
lxc.cgroup2.devices.allow = c 243:* rwm

 

and I did verify at the time that 195 and 243 were correct. However I have re-created this container several times and tried different distros in-between and for whatever reason it has changed to 195 and 238...I didn't realize that could change. 

But regardless after manually installing the nvidia driver, manually installing cuda and cuDNN It appears to be finally working!

 

1292737651_Screenshot2023-06-28at12_38_13AM.png.258b4930311b920055d7ced9d718c70d.png

 

Screenshot 2023-06-28 at 12.40.31 AM.png

Screenshot 2023-06-28 at 12.42.52 AM.png

Screenshot 2023-06-28 at 12.42.20 AM.png

  • Like 1
Link to comment
  • 2 weeks later...

Something weird is happening to me with this plugin.

I installed the LXC plugin, go to settings, change the directory to /mnt/cache/lxc/ and updated.

Then i go to the LXC Tab and i try to create a new one based on archlinux, and it seems to work, but when i press the "done" buttom after it finished, the container dissapear.

 

On the folder /mnt/cache/lxc/ i see that a folder named "cache" was created with the files from the archlinux template and while the server was creating the container other folder "arch-multimedia" was created, but ... when it finish only the "cache" folder is there.

 

On the window i see this output:

Creating container, please wait until the DONE button is displayed!

Using image from local cache

Unpacking the rootfs



To connect to the console from the container, start the container and select Console from the context menu.

If you want to connect to the container console from the Unraid terminal, start the container and type in:

lxc-attach arch-multimedia

It is recommended to attach to the corresponding shell by typing in for example:

lxc-attach arch-multimedia /bin/bash

 

 

On the logs i see that the containar was created

Jul  7 12:16:04 hades-raid root: LXC: Creating container arch-multimedia
Jul  7 12:16:18 hades-raid root: LXC: Container arch-multimedia created

 

I try with others templates, several ubuntu versions, and debian, but in all the cases the folder with the LXC container is removed and i didnt see any error on the logs.

Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.