Score:3

Is it possible to develop the Ubuntu kernel on the same computer that one works on?

de flag

Is it possible to develop the Ubuntu kernel on the same computer that one works on?

How?

Note: Really couldn't discover the answer from the website.


https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel#Testing_the_new_kernel

partially suggests to test it on the same machine. But it does not say anything about what to do if the system does not work after reboot. However, it also doesn't specify whether upgrading via dpkg is anything similar to installing it from a USB stick.

raj avatar
cn flag
raj
What do you mean by "develop Ubuntu"? Could you explain? Developing a kernel? A part of GUI? A particular application? I'm pretty sure you can do this. However **testing** the code you develop is another thing and this will probably require a separate computer or a VM.
Raffa avatar
jp flag
What do you mean by develop and why you think it might not be possible to do on the computer one works on and what's different about the computer one works on that makes it debatable?
mavavilj avatar
de flag
@Raffa Because if the new build breaks, then one may also lose the earlier.
mavavilj avatar
de flag
@raj Yes, but I couldn't find info on the official website. I also didn't understand whether it's possible to setup a VM that behaves exactly the same as a native installation. A good answer should consider the kernel and user space cases.
Raffa avatar
jp flag
I guess you need to dive into terminology a little bit ... Developing an OS using another running OS i.e. designing, writing code, making graphics, compiling ... etc. will not interfere with the running OS ... The new OS can then be tested in a VM or on bare metal at a different machine used for testing ... So, developing is normally done in a running OS and it can be Ubuntu as well ... Plus this is a general question and unless you narrow it down to a clear reproducible situation, I doubt it can be answered squarely.
mavavilj avatar
de flag
@Raffa The core issue is that I cannot find an official recommendation about what to do.
cn flag
sure by why would you? use a virtual instance and you can make easy copies of your work. If the current one breaks use the previous one.
mavavilj avatar
de flag
@Rinzwind How do I set up such?
Raffa avatar
jp flag
That's a very general and wide criteria ... Think what is it that you want ... e.g. customize the installation ISO like e.g. https://itsfoss.com/create-custom-linux-mint-iso/ or is it another specific thing? what is it? ... Do you get what I mean? I hope I explained well. Tell us exactly what you intend to do step by step ... and notice each step might take a whole separate post/question to answer it ... It's that big ... So, narrow it :-)
cn flag
install virtual box, install ubuntu in that and edit that version
mavavilj avatar
de flag
@user535733 Or answer that it is possible, but not recommended, and there is or isn't an official doc for it.
karel avatar
sa flag
@Raffa I think it's OK now.
Doug Smythies avatar
gn flag
For over a decade I have done kernel development on the same computer I run the test kernels on. I've never had a problem where simply re-booting to a known proper Ubuntu release kernel didn't provide an escape path. However, the computer is a dedicated test computer, just in case. I can not use a VM for a lot of the work I do.
Score:3
cn flag

Generally, you protect your machine from development mistakes the same way you protect it from all other mistakes.

  • Do risky operations in a virtual environment.
  • Backups and handy reinstall media.
  • Safe and secure habits.

For some hardware-specific kernel development, a virtual environment simply is not possible. Then you must mitigate your risk other ways. For example, by simulating the hardware. Or by asking another person to review your code. Or by using different hardware for your testing.

The key to good risk management (keeping your system running well) is to be honest about the likelihood and severity of your risks, and to be creative and open to effective mitigations.

in flag
On the first point, it’s worth noting that QEMU can be passed a Linux kernel image to boot into directly (instead of needing a virtual disk image with a bootloader and everything else a ‘normal’ distro needs). This is essentially the de-facto standard method among most kernel developers for testing kernel code that does not require specific hardware and does not involve interaction with a bootloader.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.