gadget_cdrom icon indicating copy to clipboard operation
gadget_cdrom copied to clipboard

Proper DVD Emulation

Open remlei opened this issue 11 months ago • 2 comments

As you may now, Vanilla WIndows ISOs does (windows 7 or later) does not work with gadget_cdrom, for some reason, once the windows iso boots up and goes to the GUI section, the cdrom suddenly goes poof out of existence, making the windows pe environment to install windows complaining for missing installation files. There's a workaround for it so OK I guess.

Fast forward today, people from pikvm finally able to handle DVD ISO and able to install windows from start to finish for using a Vanilla Windows ISO. Based on this issue they were able to achieve it.

I hope you can port the changes on pikvm to here.

remlei avatar Jan 24 '25 05:01 remlei

FWIW, the issue doesn't link to any commits.

The commits to pikvm's pikvm and kvmd projects are mostly just changing terms (CD-ROM -> CD/DVD) and adjusting warning messages:

  • https://github.com/pikvm/pikvm/commit/001dedd71143bbc7fc242cda3e8ea73ba35762d2
  • https://github.com/pikvm/kvmd/commit/2acd613a38556c5796c5d873320865d8f0f56c7a

The real magic seems to be a kernel patch applied to their 'packages' project (which makes sense, as this was a kernel limitation):

  • https://github.com/pikvm/packages/commit/3e56a4d1dbae0df4c5c1cc971bc98be9e8cda7f7

This may or may not apply cleanly to the kernel being used by gadget_cdrom. Additionally, I haven't researched the lineage of this patch. It may be written by pikvm themselves, as there doesn't seem to be any other attribution.

chrisirwin avatar Jan 24 '25 14:01 chrisirwin

@chrisirwin Hello, I'm PiKVM dev. I saw the link to my Issue and decided to check that here :)

I wrote this patch myself based on few sources:

I tried to leave as many comments as possible to make it easier for people to follow me. I plan to bring this patch to the upstream, but we need to get rid of 0xff in SCSI parameter validation firstly and add some credits. I've been testing this implementation for a long time and it seems that it works in all important cases, I was even able to install windows on a mac mini using the official ISO.

mdevaev avatar Jan 26 '25 06:01 mdevaev