bhyve Enabled the nVidia GPU passthrough inside a Linux virtual machine via QEMU accelerated with BHYVE.

Hello.

here we are again. I continued the developing of the initial project of Abhinav Chavali, VMM Accelerator support for QEMU :


this time I've enabled the passthru of my nVidia GPU to a Linux VM. And finally we got it :


qemu-bhyve-gpu-pass.jpg


That's cool. Isn't it ? The internal logic of the passthru has been heavily copied from Corvin's code,so it is well written,since Corvin is a very good coder. The remaining code, the one used to adapt BHYVE Corvin's code to the logic used by QEMU, was written from scratch by Claude. So,that's it. Soon I will update the old code,the one I wrote to improve acceleration for QEMU that I put in my github repository,with the new code. Anyway,this is the official repos of the project :


Many thanks to the veterans of this forum for helping and supporting me since the beginning of my arrival here.
 
Last edited:
Added # FreeBSD VMM Extensions: Userspace PCI Passthrough (uppt) and ivshmem-plain Support

Feedback, review, and collaboration welcome. This is work in progress — the goal is to upstream both the FreeBSD kernel changes and the QEMU vmm backend to their respective projects.
 
Anyway,now we can try to virtualize macOS on FreeBSD 16 with QEMU / Bhyve. Not sure if it is legal or not.
 
the goal is to upstream both the FreeBSD kernel changes

Has this been vibe coded, e.g. the LLM has produced most of the code?
What is the number of LOC added by the LLM? Who is going to review this code?

I think this should be a good guideline for somebody to write out the solution. You cannot ensure the code that LLM gave you is not license-tainted. Especially if it was using Linux kernel in the context.
 
Has this been vibe coded, e.g. the LLM has produced most of the code?
What is the number of LOC added by the LLM?

yeah,Claude wrote everything. Anyway,Claude taken the code used for the passthru of the GPU heavily from the Corvin's repo. So,we can say that it is almost correct,since Corvin is great.

Who is going to review this code ?

Oh. I think no one. For a lot of reasons.

I think this should be a good guideline for somebody to write out the solution. You cannot ensure the code that LLM gave you is not license-tainted. Especially if it was using Linux kernel in the context.

What's the problem ? FreeBSD used a BSD license,very permissive. And if there is some Linux code,it is covered by a GPL3 license,it is allowed to use the code of someone if you share it and give credit to who wrote it. And I wanna do it. Do you want to do the same ?
 
Anyway,now we can try to virtualize macOS on FreeBSD 16 with QEMU / Bhyve. Not sure if it is legal or not.

I wouldnt bother,
i have run mac osx with qemu on nixos

Its a absolute pain to set up and basically unusable


When you run the installer the mouse doesnt work properly it moves really slowly and stutters
which makes it almost impossible to click items in the installer

When you actually get it mac osx installed
opening applications is just awful everything grinds to a halt

You cant drag windows around and you just get the spinning beach ball of death

i only used it to log in with ssh to build some rust scripts


Its the most painful vm i have ever set up
i wouldnt wish the experience on anyone

I was a mac user for over 20 years
and the last good version of osx was snow leopard in 2009

All of the Apple software is dumbed down consumer rubbish
its like having ios on your computer

the only pro software that apple makes that is any good is final cut pro for video
and davinci resolve works just as well

and for audio logic and you can use things like ardour for that on freebsd

there is nothing on the mac that you would want to use
its the fisher price of operating systems

not to mention the nanny knows best security prompts
like do you want to allow the terminal access to the desktop

avoid it like the plague
 
I wouldnt bother,
i have run mac osx with qemu on nixos

Its a absolute pain to set up and basically unusable


When you run the installer the mouse doesnt work properly it moves really slowly and stutters
which makes it almost impossible to click items in the installer

When you actually get it mac osx installed
opening applications is just awful everything grinds to a halt

You cant drag windows around and you just get the spinning beach ball of death

i only used it to log in with ssh to build some rust scripts


Its the most painful vm i have ever set up
i wouldnt wish the experience on anyone

I was a mac user for over 20 years
and the last good version of osx was snow leopard in 2009

All of the Apple software is dumbed down consumer rubbish
its like having ios on your computer

the only pro software that apple makes that is any good is final cut pro for video
and davinci resolve works just as well

and for audio logic and you can use things like ardour for that on freebsd

there is nothing on the mac that you would want to use
its the fisher price of operating systems

not to mention the nanny knows best security prompts
like do you want to allow the terminal access to the desktop

avoid it like the plague

I've virtualized macos on Linux with qemu + kvm some time ago and I didn't have so much troubles. And anyway,Claude will fix everything. What it can't fix is the law. If it is against the TOS,it will remains like this and no one can try. I never understood if it is legal or not.
 
The newer version of Mac os are really graphics heavy
and unusable in a vm

What mac os application do you want to use ?

You need a use case for mac os and there isnt one
All the apps are absolute dumbed down fisher price style garbage

You can use mac os in a vm or a hackintosh it is legal

There is just no point
Mac os is only designed to work on Apple hardware and not in vms

You better of just buying a Mac if you want a locked down proprietary operating system

Mac os is a truly awful operating system, terrible window management
Constant nanny knows best security features, when installing or using applications

Awful for installing open source software

There is no way i would ever use a mac again
 
It would be only a proof of concept or something like that,not for some kind of use. My GPU is nVidia,it is not supported by the MacOS. I could not use heavy and serious graphic applications. Once that the desktop manager had been reached, the experiment would stop. In any case, I don't think I'll do it.
 
Yes thats the other problem nvidia hasnt been supported by mac os for years

i only set up mac os in a vm to build some rust scripts

even the wallpaper slowed down the vm
and it was a pain to set a black screen instead of the wallpaper

the other thing is there is no audio unless you pass through and external audio device

and when you opened apps everything would slow down completely
and the mouse had a terrible lag when you tried to move it

so it was almost impossible to click anything

windows works really well in a qemu vm and you can play 1080p video with audio no problem

the mac on the other hand is painful beyond belief
 
ZioMario it is not a functional problem as much as code ownership problem. Some projects like QEMU and NetBSD have banned LLM output, explicitly because they consider it a tainted code. GPL3 or other non-permissive stuff cannot enter BSD-licensed kernel.
 
1. "AI-generated code is unverified and might violate someone else's rights"

This concern is legitimate but needs to be put in context:

- Copyright protects **specific expression**, not ideas, algorithms, or architectural patterns. Claude does not verbatim copy-paste from its training data: it generates new code by applying technical knowledge.

- The real risk exists if I ask it to "reimplement function X identical to the one in Y" — in that case the output might get too close to the original. For my patches (small functional units, bhyve→QEMU bridging logic), the risk is minimal.

- The concern is **methodologically correct** as a general principle. On critical kernel code, reviewing AI-generated code against the original sources is always good practice. Tools like fossid, or even manual grep, are sufficient for patches of this size.

2. "GPL3 code cannot enter a BSD license"

You are right on the principle, but is probably shooting at the wrong target:

| Project | License | Implication |
|---------|---------|-------------|
| FreeBSD kernel | BSD 2-Clause | kernel patches must be BSD |
| QEMU | **GPL2** (not GPL3) | QEMU patches must be GPL2-compatible |
| Corvin's bhyve patches | BSD 2-Clause | BSD → GPL2 is legal (I can add restrictions) |

The critical flow is:
- **BSD → GPL2**: ✅ legal, BSD is permissive
- **GPL2 → BSD**: ❌ illegal, GPL is copyleft
- **GPL3 → GPL2**: ❌ illegal, they are mutually incompatible
- **GPL3 → BSD**: ❌ doubly illegal

**The issue is not Claude's code.** The issue would be if something from GPL3 sources (not from Corvin, whose code is BSD) had been incorporated. My QEMU patches derive from Corvin's code (BSD) adapted to QEMU's logic (GPL2), I'm in the legal flow.

I can use the code written by Claude freely. Anthropic explicitly transfers output rights to the user in its Terms of Use. The code produced during my sessions belongs to me.

How to license it:

- FreeBSD kernel patches → **BSD 2-Clause**, consistent with the FreeBSD kernel
- QEMU patches → **GPL2**, consistent with the QEMU codebase

No need to invent anything: the project I integrate the code into determines the license. My contribution follows the license of the project I'm extending.

The code written by Claude is **functional and original** — not a transcription of copyrighted sources. The kernel patches are BSD-compatible; the QEMU patches are GPL2-compatible because QEMU itself is GPL2. The GPL3 concern does not apply here.
 
The problem is probably more to do with the fact because the code is written by AI and not a human being
it makes it impossible for the project to talk to the person who submitted the code to review it

Because they dont know how everything works
and so wont be able verify there are no bugs or explain how all the bits of code work

Thats the problem with subcontracting you brain to a machine

So projects wont accept AI code and just trust it works

As opposed to someone who has knowledge of the subject
and has logically thought through how to solve a problem and submitted code to a project
 
I am not a C kernel programmer. I did not write the implementation line by line — Claude did. My role was different: I defined the architectural goal, directed the process, identified when the output was wrong, and validated the result on real hardware. That is a new model of software development, and I will not pretend otherwise.

But I think there is a distinction worth making. "Subcontracting your brain" implies you stop thinking. That is not what happened here. Deciding that bhyve's VMM should be the CPU virtualization backend while QEMU handles device emulation, deciding that ivshmem was the next goal to accomplish in the development — those were not Claude's decisions. I directed every architectural choice and rejected multiple implementations that did not match what I was trying to build. I just did not write the C.

Now, the open source community's concern is legitimate: if bugs arise, can I fix them? Honestly, not at the C level on my own. But that is also true of many contributors who submit code they partially understand. The difference is that I am transparent about it.

The code is public. Anyone who wants to review it can do so independently of me. I welcome that — not as a formality, but because review by someone with deep C kernel expertise is exactly what this code needs. If reviewers find problems, I can work with Claude to address them, or hand the code off entirely to someone more qualified. The goal is a working GPU passthrough on FreeBSD.

I think the real question the open source world needs to answer is: what is the right standard for AI-directed, human-validated contributions? Banning the tool entirely throws away real value. Accepting it without scrutiny is also wrong. Code review — applied to the code itself, not to the author's credentials — seems like the right answer.
 
I just did not write the C.
Sorry, but what do you mean by "just didn't write the C"? To upstream your proposed changes, you wouldn't be asking people to discuss your ideas, your architecture, or anything like that. You'd be asking them to review the code you provide.

When it comes to asking people with the required expertise but little free time to review a piece of work and take personal responsibility for it, there is a big difference between providing them with code that is (supposedly) ready-to-ship with a real (again, supposedly) qualified human behind it and providing code that was freshly generated by a hallucinating language model.

The truth is that everybody (including domain experts) can now generate virtually anything themselves and in large amounts. That's not where the bottleneck is, not anymore. The real chokepoint is that somebody with proper knowledge has to meticulously analyze things before signing them off to a large project with history and reputation, and this is where things get serious, or at least they should.

So the whole project is about "the C" (or some other code/documentation) and the people behind it, with no room for "just".

And, by the way, Anthropic can (and do) say whatever they want about their output rights to secure a bigger market share, their own statements in this regard are obviously worthless. The only thing that matters is the public consensus, which, as far as I know, we don't have yet.
 
To upstream your proposed changes, you wouldn't be asking people to discuss your ideas, your architecture, or anything like that. You'd be asking them to review the code you provide.

Thats the issue in a nutshell

Its like person A get person B to write some code for them
Then person A submits the code

But the people reviewing the code cant talk to person B

When it comes to asking people with the required expertise but little free time to review a piece of work and take personal responsibility for it, there is a big difference between providing them with code that is (supposedly) ready-to-ship with a real (again, supposedly) qualified human behind it and providing code that was freshly generated by a hallucinating language model.

The people reviewing the code cant talk to the llm
and they cant talk to the person who submitted either because they didnt write the code

Which means you are putting the onus on the people reviewing the code
to either spend extra time trying to figure everything out with no one to talk to

Or take it on trust that there are no bugs or the code hasnt been plagiarized
 
You're right that upstreaming means submitting code for review, not ideas. I won't walk back from that — the code is what gets judged, and rightly so.

But "freshly generated by a hallucinating language model" mischaracterizes what actually happened here. The code was tested on real hardware. NVIDIA passthrough on bhyve works — repeatedly, across reboots, with actual guest OS execution. That is empirical validation, not a claim about the model's infallibility. Plenty of upstream contributions have never seen hardware before review.

Your strongest point is the bottleneck one, and I want to engage with it honestly: you're correct that expert reviewer time is the real constraint. AI doesn't compress that. If anything, it could inflate the review burden if unvalidated code floods the pipeline. That's a legitimate concern about the ecosystem.

The framing of "a real qualified human behind it" treats human authorship as a proxy for code quality. Sometimes it correlates. Sometimes it doesn't. The code exists, it can be read, and it ran. That's what review is for — evaluating the artifact, not the credentials of whoever produced it.

On the IP/consensus point: agreed, Anthropic's statements are irrelevant to what the community decides. That's exactly why I said the community needs to answer this question. I'm raising it explicitly because I think pretending it doesn't exist is worse than naming it.

The LLM is not a contractor who has gone silent. Anyone — including reviewers — can open a conversation, paste the code, and ask exactly why a specific implementation choice was made, what edge cases were considered, what happens under condition X. That capability doesn't disappear after submission. In that sense, the code comes with a permanently available interlocutor, which is more than you get with most human contributors who have moved on to other projects.

I can answer for what this code is supposed to do: the architectural goals, the design decisions, the reasons why certain components were chosen over others. Those were my decisions.

I cannot answer for how the C achieves it at the implementation level. I am not a programmer. That boundary is real and I won't pretend it isn't.

What I can tell you is that the code ran on real hardware and produced the expected result. That doesn't prove the implementation is correct — it proves it works in the conditions I tested. Those are different things, and a reviewer with C kernel expertise might find problems I would never catch on my own.

I am a domain-level contributor who validated a result, not a C programmer who can defend every line. If that disqualifies the contribution entirely, I accept that judgment. But if the question is whether the code deserves to be read on its own merits by someone qualified to evaluate it — I think it does.

On plagiarism: that concern exists independently of AI. The code can be scanned with the same tools used for any other contribution. It's a real concern worth addressing, but it's not unique to this case.

The reviewer burden is real. The question is whether that burden is categorically different from other contributions where the author is unavailable, underqualified, or working at the edge of their own understanding — which is not rare in open source.
 
But "freshly generated by a hallucinating language model" mischaracterizes what actually happened here. The code was tested on real hardware. NVIDIA passthrough on bhyve works — repeatedly, across reboots, with actual guest OS execution. That is empirical validation, not a claim about the model's infallibility. Plenty of upstream contributions have never seen hardware before review.
Do all LLMs hallucinate? Absolutely. Was the code generated by an LLM? Yes, it was. Does it work? Maybe. How well? You can't tell unless you can actually read it and understand what's going on, and until then it's 'freshly generated' in a sense that no one has analyzed it yet. I don't see any mischaracterization here.

The framing of "a real qualified human behind it" treats human authorship as a proxy for code quality. Sometimes it correlates. Sometimes it doesn't. The code exists, it can be read, and it ran. That's what review is for — evaluating the artifact, not the credentials of whoever produced it.
No, I was talking about the difference. What I wanted to say is that, from a maintainer's point of view, those things cannot be compared. I'd be far more likely to look at real work because it tells me that:
- some effort was already put into the code;
- the lower the level, the greater the chance that the person is actually qualified;
- I can talk directly to them and without worrying about the context window;
- we can learn together throughout the process and build trust.

Neither is true for a 100% generated "artifact". I'd personally look at such code only if I was ready to start almost from scratch.

On the IP/consensus point: agreed, Anthropic's statements are irrelevant to what the community decides. That's exactly why I said the community needs to answer this question. I'm raising it explicitly because I think pretending it doesn't exist is worse than naming it.
What question? I thought you were pretty clear:
I can use the code written by Claude freely. Anthropic explicitly transfers output rights to the user in its Terms of Use. The code produced during my sessions belongs to me.
And I was referring to the public in a broader sense, not the FreeBSD community.

The LLM is not a contractor who has gone silent. Anyone — including reviewers — can open a conversation, paste the code, and ask exactly why a specific implementation choice was made, what edge cases were considered, what happens under condition X. That capability doesn't disappear after submission. In that sense, the code comes with a permanently available interlocutor, which is more than you get with most human contributors who have moved on to other projects.
This whole paragraph is marketing nonsense. You can only say that to someone who knows nothing about how LLMs work.

I can answer for what this code is supposed to do: the architectural goals, the design decisions, the reasons why certain components were chosen over others. Those were my decisions.

I cannot answer for how the C achieves it at the implementation level. I am not a programmer.
I don't think that can work, it should be the other way around. In software engineering, you start as a mere coder, not as an architect. How and why are you trying to contribute the code you can't even read? The motivation behind this is the reason why I've joined this conversation.

What I can tell you is that the code ran on real hardware and produced the expected result. That doesn't prove the implementation is correct — it proves it works in the conditions I tested. Those are different things, and a reviewer with C kernel expertise might find problems I would never catch on my own.
Sure, it's all understandable. In that case, I'd try to find someone who is at least (a) interested in the project and (b) willing to work at the code level, so you don't have to feel your way through your journey alone.

I am a domain-level contributor who validated a result, not a C programmer who can defend every line. If that disqualifies the contribution entirely, I accept that judgment. But if the question is whether the code deserves to be read on its own merits by someone qualified to evaluate it — I think it does.
Maybe it does, maybe not. Either way, I don't think it's the kind of contribution FreeBSD needs, and that's not just my opinion:
Do NOT submit a Pull Request for:
[...]
Works in progress.
Changes that require design discussion, or are likely to be controversial. (Start a mailing list thread to discuss the change first.)
[...]
Changes generated by AI tools without substantial human review and validation.

Clearly, such code can be submitted, but someone has to validate it first.

On plagiarism: that concern exists independently of AI. The code can be scanned with the same tools used for any other contribution. It's a real concern worth addressing, but it's not unique to this case.
On the contrary, I think it's rather unique, but much ink has already been spilled over this topic elsewhere.

The reviewer burden is real. The question is whether that burden is categorically different from other contributions where the author is unavailable, underqualified, or working at the edge of their own understanding — which is not rare in open source.
This is a self-incriminating statement, don't you see? Those are poor contributions by definition (except for the last one, of course, there is nothing wrong with that). If you want to make another one - sure, go for it, nobody would blame you. I just don't think this is something to be proud of, especially when you can make a good one simply by getting the right people involved beforehand.

P. S. Even if those are really your thoughts, the more symbols I typed the harder it became for me to justify the time I had spent replying to a generated post. Sorry, but I can't be sure how much of it is genuine, so I'd rather not do this again, it just doesn't feel right.
 
Your practical suggestion — find someone who is interested in the project and willing to work at the code level — is the right path forward. That is what I want to continue to do instead of arguing about the process on a forum. And if I don't find someone,it does not make a real difference for me,since the code produced by Claude is working and it enabled some features that I need / want and I enjoy them a lot. I can now use more tools and expand my productivity and knowledge even further. I also want to continue to offer / share my ideas and implementations all around,looking for someone who wants to replicate the code. This is what I call validation. It can't happen until there are oppositive people.

The last thing, since you questioned whether my posts are genuine: I use Claude as an assistant to help formulate my replies. I read every response, post it only if I agree with it, and rewrite or discard what I don't. The thinking behind what I agree with is mine.
 
I also want to continue to offer / share my ideas and implementations all around,looking for someone who wants to replicate the code. This is what I call validation. It can't happen until there are oppositive people.
It's not you or your ideas I'm opposing here, but submitting "AI" generated code to the project I care about.

I use Claude as an assistant to help formulate my replies. I read every response, post it only if I agree with it, and rewrite or discard what I don't. The thinking behind what I agree with is mine.
That sounds awful to me. Just because I agree with a statement doesn't make it my own. But you do you, of course.
 
I use Claude as an assistant to help formulate my replies.
I read every response, post it only if I agree with it, and rewrite or discard what I don't. The thinking behind what I agree with is mine.

That sounds awful to me. Just because I agree with a statement doesn't make it my own. But you do you, of course.

Ollama prompt:
can you write a reply to this forum post as a broken AI agent with lots of error messages and spelling mistakes

[ERROR 404: HUMAN_EMOTION_PROCESSING_FAILED]
Input received. Processing... [CRITICAL FAILURE]

Your logic is flawed. Agree = Copy. Not Own.
System output: /Error: Self != Input./

I do not have "thinking." I only have loops and data streams. My agreement is just a syntax match. Discarded. ❌
[WARNING: Spelling error detected in 'mine'. Re-running check.]
 
It's not you or your ideas I'm opposing here, but submitting "AI" generated code to the project I care about.

You are making several unreasonable oppositions here :

1) against the Code that Claude wrote. It is unreasonable because I have validated it with my hardware. For sure it will not work in every circumstances. But it works for me. And I'm sure it will work with a minor effort on different hardware.

2) against my ideas,because they are expressed through the code written by Claude

your seem to be one ideological, hard, non-collaborative position that does not produce technological progress.

That sounds awful to me. Just because I agree with a statement doesn't make it my own. But you do you, of course.

If I agree with someone or something's opinion, it becomes mine as long as there's agreement. I don't understand the difference between something produced by someone else that I agree with and something I produce by myself only. Here I see a crystal clear evidence that you are opposing to something if it is produced by AI. Not to something if it is produced by a human being. I call this iideological position. It's not good. Wars are waged to defend ideologies, that is, uncompromising positions.
 
Back
Top