10
Conrad
5y

So I think I saw a post on here about dvds in virtual machines. Got me thinking, and here's my results trying to play a dvd using linux running inside a vm.

Setup:
Windows 10 Professional
Hyper-V VM running Debian 4.19
Xming website release for video (also works with the free version)
PulseAudio for windows to play sound

So, pretty straightforward, right? Insert DVD, tell Hyper-V to map the dvd drive to the virtual one and run `vlc dvd:///dev/sr0'
But of course, DVDs have copy protection (read: playback protection), so I downloaded the dvdcss package file from videolan's ftp server and installed it. This still didn't work though, vlc said it couldn't decode the dvd. Then, to make sure my dvd was okay I played it with vlc in windows, which worked fine. When I tried again inside the vm it suddenly "worked". Maybe running it inside of a vm prevents some access to the dvd drive required for decoding? Go figure.

The video was very corrupted though, and vlc puked out a lot of errors.

So in conclusion, playing a dvd in a vm is weird, unwatchable, inefficient and only works if you can also play it on the host.

And yes the audio is just as choppy as the video, no idea what causes this. I can play normal videos fine (for some reason that doesn't really work with the free version of xming) although it uses about 200% cpu since there's no hardware acceleration, and the framerate isn't necessarily what it is supposed to be.

Comments
  • 2
    Not imgur because it's annoying but here's the high quality version of the screenshot if you want to read the error messages:

    https://s1.imagebanana.com/file/...

    Really, devRant, why do you think scaling down a screenshot to 25% and turning it into a jpeg is a good idea?
  • 0
    Haha, fun project :) But why?
  • 2
    Interesting idea :D
    But isn't the whole idea of hyper v that you should not "feel" a difference between real and virtual hardware?

    How do these glitches appear then?

    The most "logical" thing would be a lower read rate of the data from the dvd. Normally we talk to the drive directly, but with hyper v in between maybe there happens some buffering (but not fast enough)?

    Could you try a Win 10 VM or Win 7 on your Win 10 Host?
  • 3
    @ScriptCoded for science. I was curious how good hyper-v is at this stuff

    @AtuM I think there was a video card passthrough option for gen2 vms, but they removed it. Better GPU support in vms would be nice. Virtual Box's is good enough to play Minecraft though, used it once to play multiplayer on just one PC

    @nitwhiz the worse read performance is possible, but that doesn't explain how playing it in Win10 decrypts it for the vm. Also the problem with Win10 in a VM is that you need a license to use Extended Sessione or whatever they're called (really just remotedesktop into the VM instead of the normal Hyper-V console without audio etc). I might try it sometime if I get around to it, have a 3€ professional license from rakuten lying around which might work.
  • 1
    The whole "can decode once played" is not just in vms.
    If you use linux natively and try to rip the whole dvd with dd you get an io-error. If you play it once using vlc i also am able to rip it with dd afterwards.

    May guess is that the libdvdcss module uses some direct calls to the dvd drive to maybe transmit the key for decryption. I guess that the hypervisor blocks that kind of direct access or the virtual driver doesn't support it.
    Same guess for choppy playback as @nitwhiz . The vm/virtual driver probably can't control the disk speed or gets reported a wrong maximum disk speed.

    Would be interesting to see, if the vm could play the second layer of a duallayer dvd (DVD DL). 🤔
  • 1
    @LinusCDE Makes sense. I think it's possible that the hypervisor only exposes data access functions to the vm and nothing like speed detection or transmitting decryption keys. The video length is detected correctly, but I haven't skipped ahead that far. Wouldn't be surprised if switching to the second layer was handled by the drive though
  • 0
    @Conrad Could well be that way. I had some trouble copying a DL DVD though. At least when burning, it gets complicated.
    Though Drive-Passthrough on that matter went well with Virtualbox.

    The DVD is DL when the size is bigger than 4,7 GB. Some movie dvds are dl.
Add Comment