PJ-Singh-001 / Cubic

The Official Web Site for Cubic (Custom Ubuntu ISO Creator) (https://github.com/PJ-Singh-001/Cubic)
762 stars 45 forks source link

Change Kernel version in Virtual Environment #320

Open emptyhead opened 1 month ago

emptyhead commented 1 month ago

Describe the question Is there a way to change the Kernel the Virtual Environment is using?

What you have tried From my limited understanding of linux the only way to change the kernel is by selecting it from GRUB which of course isn't possible here. I'm trying to build a kernel module for an unsupported wifi device (realtek 8812au). The Virtual Environment is using the kernel from my installed OS (6.5.0-35) but doesn't have access to the matching headers. I've tried manually installing the matching headers but the module still fails to build.

Expected behavior I'd like if either the virtual environment had access to the headers on my system which match the kernel the virtual environment is using (6.5.0-35) or if the virtual environment could use the kernel on the ISO (6.8.0-31) which is showing both image and matching headers are installed.

OS Information (please complete the following information): OS version: Kubuntu 23.10

Cubic Information (please complete the following information):

Notes I would just like to say thanks for this program, it is excellent. I am very new to linux so my apologies if I'm doing something stupid. I do wish I could figure this niche problem out without having to bother you, but alas I can't. Not wanting to appear to hold you to ransom, but if it is possible to change the kernel version so I can use this I'll be sending a donation :)

ArrayBolt3 commented 1 month ago

I believe the virtual environment uses systemd-nspawn to create the virtual environment. This is a container, not a VM, so the VE will share its kernel with the host. To change the kernel, you'd have to install a different kernel on the host and then boot into it.

You may be able to do what you're trying to do more easily by building the driver in question in a VM with the kernel you need, and then transfer it to Cubic's custom-root so you can install it thereafter?

emptyhead commented 1 month ago

Thank you. That sounds worth investigating. Much appreciated. Is it normal behaviour for a container to not have access to the headers from the host machine then, or could this be considered a bug?