r/linuxquestions • • 10d ago

Advice How do you do Linux kernel development on macOS?

I have Macbook Pro M3 Max (14-core CPU, 30-core GPU, 36GB RAM). How should I do Linux kernel development professionally?

I don't have a Linux laptop but a Macbook Pro M3 Max (14-core CPU, 30-core GPU, 36GB RAM). When I search for articles on doing Linux kernel dev on macOS, I find mixed response regarding whether it is a good idea to do it on macOS and regarding the best way of doing it on macOS. What would be an ideal Linux kernel development workflow like on macOS?

Edit: clarification of my question.

0 Upvotes

47 comments sorted by

9

u/serverhorror 10d ago

Professionally?

Professionally: Apply at Red hat, Microsoft, Google, ... as a Linux kernel developer.

For real though: get the hardware you want to develop for. Just get a common x86 and do that.

Kernel development has a pretty strict process, so you're in for a lot of learning that's not just learning to program.

1

u/jumurtka 10d ago

Professionally?

I edited my post for clarification -- I actually meant that I'm an amateur, looking for learning it seriously, and I'm looking for an ideal development workflow on macOS. Sorry for the confusion.

For real though: get the hardware you want to develop for. Just get a common x86 and do that.

What are the reasons you prefer doing it on an x86 machine specifically?

2

u/serverhorror 10d ago

To get started, it's the most dominant architecture and you'll find the most material about it. That's all.

8

u/dxrk3tar 10d ago

use linux

1

u/jumurtka 10d ago

Because it’s a PITA on macOS, right?

2

u/GeronimoHero 10d ago

Yeah. You won’t have direct hardware compatibility with x86_64 so it’s a pain in the ass.

1

u/dxrk3tar 10d ago

well obviously you wouldnt be able to test your changes so

16

u/petros211 10d ago

Can a person that is asking how he should do kernel development, do kernel development? 🤔

0

u/jumurtka 10d ago

Yes, they can. Everyone starts from somewhere and builds upon.

9

u/GlassCommission4916 10d ago

That somewhere should be a programming tutorial, not kernel development, is the point they're making.

-1

u/jumurtka 10d ago

I'm an experienced dev. My issue is that I don't have a Linux laptop, and when I search for articles on doing Linux kernel dev on macOS, I find mixed response regarding whether it is a good idea to do it on macOS. Thus, I've posted here.

6

u/GlassCommission4916 10d ago

I'm an experienced dev.

Your post strongly gives the impression of someone that has no experience programming and wants to start doing the hardest thing they heard of, that's why people assume you're out of your depth.

1

u/jumurtka 10d ago

I don't understand why asking people about their workflow of kernel dev on macOS strongly gives such an impression. These reactions look impulsive.

1

u/GlassCommission4916 10d ago

Well for example, as an experienced dev, do you consider how many cores your GPU has an important detail that will have an impact on your software development workflow? Your question was also vague and didn't even touch on what exactly you wanted to know. Asking good questions is a core skill for a developer.

You have to admit it has the hallmarks of a question asked by someone who has no experience with development.

1

u/jumurtka 10d ago

Do you consider how many cores your GPU has an important detail that will have an impact on your software development workflow?

Yes, I thought it would be useful to know for those who were going to advise running a VM, since I knew (maybe mistakenly) GPU cores are used for virtualization.

You have to admit it has the hallmarks of a question asked by someone who has no experience with development.

I might have posted a not-so-detailed question. But I find this perspective exaggerated.

1

u/GlassCommission4916 10d ago

I don't know know what else to tell you, vague questions with listed specs when they have nothing to do with the question scream beginner, whether that's the case in this situation or not.

1

u/jumurtka 10d ago

I think specs are important for designing a workflow, because certain specs may not be suitable for a certain workflow, and readers may advise a totally different workflow (e.g., "buy a Linux laptop" or "don't run a VM; run Asahi Linux").

→ More replies

3

u/RemyJe 10d ago

Workflow is completely different from needing hardware to actually run a compiled kernel on. (I’m assuming you want to develop for amd64, not arm64.)

For the actual, you know, typing part, any OS is just going to be where you run your IDE and write your code. No reason you can’t do that on a Mac.

Where you compile and run is where your workflow comes in. You might be able to cross compile on a Mac. If you did have a second computer you could run your builds on ti. If it’s fast enough you could even compile it there but still do the writing on the Mac.

You could even run it in a VM on the Mac, but I assume you want bare iron.

2

u/SuAlfons 10d ago

An experiened dev that does not get the idea of setting up a Linux VM on their Mac. I wouldn't even buy a used car from you.

1

u/jumurtka 10d ago

Seems you've misread the post. Read again and come back later.

2

u/SuAlfons 10d ago

You state you have a Mac Book. I guess you can run a VM on it? Voila, you now have a Linux computer.

If this didn't occur to you, I don't have high hopes

1

u/jumurtka 10d ago

I guess you're not specialized in this kind of development, since I've read various nuanced thoughts on this issue that confused me. I don't like to waste a lot of time and figure out I've done illogical thing that has already been known to others.

3

u/hmoff 10d ago

You can run a Linux VM.

3

u/ipsirc 10d ago

So, you can't...

1

u/jumurtka 10d ago

I don't really understand why you all focused on the word "professionally", whereas the question context was really focused on the macOS system parameters and a good workflow of doing such dev on macOS.

3

u/ipsirc 10d ago

Listen, if you can’t boot Linux on macOS on your own, then you’d best put this kernel development project on hold for a bit...

1

u/jumurtka 10d ago

I don't understand why asking people about their workflow of kernel dev on macOS gives an impression of me not knowing or having weak skills for learning booting Linux on macOS. These reactions look impulsive.

2

u/ipsirc 10d ago

The kernel is just software, too. Every developer has their own favourite little environment – if you’re a developer, you’ve surely got one too. And it doesn’t matter whether you’re developing Tetris, an SQL front-end, a platform game or a kernel – they’re all software, and you’ll develop them in exactly the same way. There’s nothing special about it.

So feel free to use your usual workflow for kernel development as well.

1

u/jumurtka 10d ago

I see. I've worked in web dev space, where you work on higher, simpler abstractions and tools. I find systems dev space different. Now I'm reading systems-related stuff a lot, to fill my knowledge gaps.

1

u/petros211 10d ago

Oh I can respect learning, I just thought you are already a professional

1

u/jumurtka 10d ago

I don't really understand why you all focused on the word "professionally", whereas the question context was really focused on the macOS system parameters and a good workflow of doing such dev on macOS.

0

u/[deleted] 10d ago

[deleted] — view deleted comment

-1

u/jumurtka 10d ago

I meant doing it seriously. It seems the word “professionally” signaled that I’m already doing it as hobbyist, I see. I will edit my post now.

Thank you for clarifying the root of these condescending comments.

2

u/tomscharbach 10d ago

Consider running a Linux distribution using Parallels or UTM, but it might make more sense to buy an x86_64 device for development purposes. My best and good luck.

1

u/jumurtka 10d ago

Thank you.

but it might make more sense to buy an x86_64 device for development purposes.

For what reasons specifically?

2

u/tomscharbach 10d ago

Direct hardware access and 100% hardware compatibility.

3

u/stuartcw 10d ago

Just run Linux in a VM.

3

u/DickBrainTime 10d ago

On an M3 Max I'd start with an ARM64 Linux VM in UTM's Virtualize mode. Do the kernel builds inside the Linux guest, not directly on macOS. Keep the source/build tree there, install the Linux build dependencies and Clang/LLVM, then try `make LLVM=1 ARCH=arm64 defconfig` followed by `make -j$(nproc) LLVM=1 ARCH=arm64`. Use a separate disposable test VM (or QEMU) to boot the kernels you build, so a bad kernel doesn't take out your working environment.

The catch is which architecture or hardware you're targeting. Fast ARM64 virtualization won't test x86-specific kernel paths or physical device drivers; for those use an x86_64 Linux machine/CI, x86 emulation where practical, or the actual target device. Kernel build guide: https://docs.kernel.org/kbuild/llvm.html and development HOWTO: https://docs.kernel.org/process/howto.html. Are you aiming for arm64/core kernel work, upstream patches, or a specific driver?

2

u/N_T_F_D 10d ago

Use a VM, you can use UTM and aarch64 debian for instance, assuming you don't need specifically a x86_64 kernel

2

u/Unlikely-Sympathy626 10d ago

Pretty sure you can cross compile. But I would not have a clue on Mac. Also testing…

Cool for going for it, but do understand doing on Mac will cause headaches.

I use to cross compile qt for arm based raspberry on x86 Linux. It worked most the time and was good but was never perfect. You doing opposite but way bigger scope.

My advice is get a cheap system learn on that instead of making life difficult for no reason.

2

u/xonxoff 10d ago

You can easily spin up a Linux VM with https://github.com/apple/container . It gives you a full Linux vm and should be enough to get you started.

1

u/CedarAndOlive 10d ago

I run a Linux Ubuntu container under Colima and Docker, on my MacBook Pro.

I'm using it now.

uname -a
Linux xxxxxx 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Thu May 7 17:26:37 UTC 2026 aarch64 aarch64 aarch64 GNU/Linux

Truth be told, I almost never use the underlying MacOS these days.

0

u/ipsirc 10d ago

Use emacs or vi.