[Plugin] LXC Plugin


Recommended Posts

Thank you @ich777 , I appreciate your input and, please, take your time. I just thought I would mention these things to make life easier since unRaid seems to be more GUI focused.

 

I have been using

lxc.cgroup.cpuset.cpus = x,y

and seems to have been working. I'll try cgroup2 as well, but they are probably equivalent.

 

Memory limit, unfortunately does not work, and I cannot start the container at all with this option in the config.

 

Another interesting thing I notcied is that LXC in proxmox only shows the resources available to the container, while here all of hosts resources are shown, although loading the container to the full only appears to load the 2 cores I've assigned - so the limits are working.

Edited by m00nman
  • Like 1
Link to comment
21 minutes ago, m00nman said:

but they are probably equivalent.

Not really.

 

You can‘t boot for example newer LXC containers which are using cgroupv2 and systemd (Debian Bookworm, Ubuntu Jammy,…).

 

23 minutes ago, m00nman said:

Another interesting thing I notcied is that LXC in proxmox only shows the resources available to the container, while here all of hosts resources are shown, although loading the container to the full only appears to load the 2 cores I've assigned - so the limits are working.

The resources, at least the assigned CPU cores show up fine with croupv2 but not the RAM usage (haven‘t got time yet to wrap my head around this).

Link to comment
  • 4 weeks later...

 

On 11/5/2022 at 12:59 PM, m00nman said:

Memory limit, unfortunately does not work, and I cannot start the container at all with this option in the config.

 

From this: https://discuss.linuxcontainers.org/t/limitations-not-applied-inside-of-containers/11395/3

 

Quote

For soft memory limits, I believe it’s something like cgroup2.memory.low whereas the hard limit would be cgroup2.memory.max.

 

Just tried lxc.cgroup2.memory.max = 4G and it at least allows me to start the container, I think the limits are enforced as I tried to make a 4G file in /run and the container died :D

Link to comment
1 hour ago, ich777 said:

Do you have cgroup2 enabled on Unraid?

Yes sir, did it after the upgrade to 6.11.0.

This was my first play around with lxc and was looking at moving some VMs to containers instead.

Was really hoping that cpu and memory limits would be visible in container, which doesn't seem to be the case.

Link to comment
  • 2 weeks later...
On 6/8/2022 at 8:40 PM, ich777 said:

Added automatic installation of a Debian Bullseye container with a Desktop environment reachable through noVNC and VNC.

 

Update the plugin

  1. Go to the LXC page and click on "Add Container" and at the bottom you have now the ability to enter a Name for the container (MAC address will be generated automatically and Autostart is disabled by default):
    image.thumb.png.700c34853a53cfd639e57778522b94a2.png

     
  2. After you clicked on "Create VNC Container" you will see something like this:
    image.png.059cd049e5a004da8511465eed4c3996.png

    ATTENTION: Don't close this window or interrupt the process since it installs everything to the container from this point on.

    This Process can take a very long time depending on your internet connection, speed of your drives and general performance from your server since it has to install a full Desktop environment from scratch.

     
  3. After everything is finished the "DONE" button is displayed and it should look something like this:
    image.png.078c9c499e729b81494e5b1ad5d330ef.png
    You see now that you can reach it via noVNC through: LXCContainerIP:8080/vnc.html?autoconnect=true and through any VNC compatible client through: LXCContainerIP:5900

     
  4. Close the window with the "DONE" button and go back to your LXC page to see the IP from the newly set up container and connect to it, in my case with: 10.0.0.172:8080/vnc.html?autoconnect=true :
    image.thumb.png.8c24b7ce30eec1686349b77ef222eb42.png

     
  5. After connecting to the container you should be greeted with the Desktop:
    image.thumb.png.581907f5321d54c6da456e9f0ac7f80f.png

     
  6. I would also recommend if you plan to use noVNC to set the scaling to "Remote Resizing", click the little arrow on the left, click on the gear icon and select "Remote Resizing" to always fill the desktop to the browser screen:
    image.png.c4f77d3af674e94f2f332baf7cd868ad.png

     
  7. Now I would strongly recommend that you change the root password by opening a terminal in the Desktop environment and typ in:
    su
    ...enter the root password "Unraid" (without double quotes) and then type in:
    passwd
    ...enter the current password "Unraid" (without double quotes) and the new password twice (you will get no display output while typing, this is the default behavior).
    After that you can close the terminal.

     
  8. I would also recommend to change the default user password from your "debian" user by opening a terminal in the Desktop environment again and typ in:
    passwd
    ...enter the current password "debian" (without double quotes) and the new password twice (you will get no display output while typing, this is the default behavior).
    After that you can close the terminal.

 

 

Now what's left for you to do is set the locale, timezone and customize the container how you like... :)

(Please use the command "su" from above to become root so that you don't need sudo in front of the commands)

 

 

Please note that this is not a custom image or something like that, it installs the base LXC Debian Bullseye image from the LXC container repository and installs everything from scratch after that through Debian & GitHub repositories.

hi, i have go to the step 4, also try 'vnc viewer' with IP:5900 , but always show black screen .

I use the Intel-GPU-TOP and gvt-g ,my CPU is 'intel 9900ES' , did I miss any steps?

Link to comment
3 hours ago, insomnia417 said:

hi, i have go to the step 4, also try 'vnc viewer' with IP:5900 , but always show black screen .

Delete the container and try to generate it again.

 

This feature may be removed in the future again anyways because there is also a Docker container available that does just that, search in the CA App for "Debian Bullseye".

Link to comment
16 hours ago, insomnia417 said:

hi, i have go to the step 4, also try 'vnc viewer' with IP:5900 , but always show black screen .

I use the Intel-GPU-TOP and gvt-g ,my CPU is 'intel 9900ES' , did I miss any steps?

Finally, I solved my problem. The biggest problem is the network problem! Finally, I tried to use my VPN to directly connect to the official Debian source, so that I could quickly and stably install all dependencies without unknown problems. Because after installing the LXCVNC button, everything was determined by the system default, so I could not change the official source halfway,

The following is a Chinese literal translation for Chinese compatriots, because I think there are few countries in the world except China that are closed to the Internet
终于,我解决了我的问题, 最大的问题就是网络问题!我最后尝试使用我的VPN直连debian官方源,才保持快速稳定地安装完所有依赖不出现不知名的问题,因为安装LXCVNC的按钮以后,一切都是由系统默认决定的,所以我没法中途改变官方源,

国人请修改软路由或者V2为全局直连外网!

  • Like 1
Link to comment

Thank you for this great plugin :D

 

I think i got it working as far as the user juan11perez

Now i would like to have gpu acceleration inside the vnc xsession.

Did someone already achieve this, or has an idea?

 

debian@DebianVNCR1:~$ ls -l /dev/nvidia*
crw-rw-rw- 1 root root 195,   0 Dec 16 00:16 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 Dec 16 00:16 /dev/nvidiactl
crw-rw-rw- 1 root root 195, 254 Dec 16 00:16 /dev/nvidia-modeset
crw-rw-rw- 1 root root 240,   0 Dec 16 00:16 /dev/nvidia-uvm
crw-rw-rw- 1 root root 240,   1 Dec 16 00:16 /dev/nvidia-uvm-tools
debian@DebianVNCR1:~$ nvidia-smi

Fri Dec 16 12:16:12 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.11    Driver Version: 525.60.11    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:29:00.0 Off |                  N/A |
| 35%   35C    P0    20W / 100W |      0MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

debian@DebianVNCR1:~$ glxinfo
name of display: :99.0
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Error: couldn't find RGB GLX visual or fbconfig
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".

Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Xlib:  extension "GLX" missing on display ":99.0".
Edited by varona
spelling errors
Link to comment
1 hour ago, varona said:

Did someone already achieve this, or has an idea?

Have you installed the driver in the container too?

 

The message says that your Display is missing GLX, are you using a virtual Display? Maybe some kind of VNC server? Keep in mind that you have to use some kind of virtual display which is capable of using GLX.

Link to comment

To answer the questions
This is the DebianVNC container configured by you.
Afterwards i added the gpu to the container config file and installed the driver in the container.
I figured out, the vnc server running, is probably a TurboVNC 2.2.6
Virtual Displays are still a new topic to me. I plan to study this Dokumentation in the future, but still didn't get to it. https://rawcdn.githack.com/TurboVNC/turbovnc/2.2.6/doc/index.html 

Link to comment
3 hours ago, varona said:

Virtual Displays are still a new topic to me.

If you want to do something like that I would rather recommend that you use the steam-headless Docker container form @Josh.5 because this would involve some real tinkering.

You can however achieve that in the LXC container too but it's really complicated, you can search my old repositories and search for the Debian-Nvidia-Steam container (deprecated that in favor to the Steam-Headless container) to get some clues how to do that.

What do you want to do with the container or for what do you need HW acceleration? For a specific app or do you want to have HW acceleration for the desktop itself?

 

3 hours ago, varona said:

This is the DebianVNC container configured by you.

I would rather recommend that you use a Docker container for that, if HW acceleration is not needed.

For example look at my Debian Bullseye container from the CA App, it's basically the same as this LXC "template" for VNC.

  • Thanks 1
Link to comment

Hm, somehow the snapshot feature isnt working correctly for me. I tried to create a snapshot and a window popped up and . . . . . appeared on and on and on until forever. I never got a message like "done" or "finished" or something,and it kept loading, though after hours i just closed the popup and there is the snapshot. Is this intentional?

Link to comment
8 minutes ago, Joly0 said:

Hm, somehow the snapshot feature isnt working correctly for me. I tried to create a snapshot and a window popped up and . . . . . appeared on and on and on until forever. I never got a message like "done" or "finished" or something,and it kept loading, though after hours i just closed the popup and there is the snapshot. Is this intentional?

No, of course not.

This completely depends for what you are using the container and what is installed in the container.

Maybe it ran into the php timeout and continued forever to display the ....

When a backup is taking too long such things can happen.

Have you yet tried to create a snapshot from the command line and see how long does it take from this exact container?

Link to comment
35 minutes ago, ich777 said:

No, of course not.

This completely depends for what you are using the container and what is installed in the container.

Maybe it ran into the php timeout and continued forever to display the ....

When a backup is taking too long such things can happen.

Have you yet tried to create a snapshot from the command line and see how long does it take from this exact container?

Through command line it takes a few minutes, roughly 5-7 minutes or so, but not that long.

Link to comment
1 minute ago, Joly0 said:

Through command line it takes a few minutes, roughly 5-7 minutes or so, but not that long.

This is really strange, I've now created a backup from one of my bigger LXC containers and that took about 15 minutes and the DONE button appeared after it finished.

What browser are you using? Did you let the tab in the foreground?

Link to comment
5 hours ago, ich777 said:

This is really strange, I've now created a backup from one of my bigger LXC containers and that took about 15 minutes and the DONE button appeared after it finished.

What browser are you using? Did you let the tab in the foreground?

Browser is firefox, i could try it again with the tab in foreground

Link to comment
  • 3 weeks later...
On 12/19/2022 at 7:48 AM, ich777 said:

If possible that would be nice for testing purposes... Maybe that's caused by some weird power saving measurement from the browser for background tabs.

Sry for the super late reply. Yes, in foreground it does work without a problem

Link to comment
  • 2 weeks later...

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.