Linux distributions have loads of benefits. Most are free, they're generally lightweight, and boast lots of customization. However, there's usually a bit of required tweaking to get Linux running. Unfortunately, certain out of the box features aren't native in Linux. Notably, DVD decryption isn't standard. In fact, watching DVDs on Linux, may technically be considered illegal.

While there's a lot Linux can do by default, there are some limitations out of the box. Luckily, there are all in one solutions to installing restricted extras, but DVD playback requires more work. Want to play them on Linux? Here are your options.

A Bit of Background

If you've ever purchased a digital copy of a movie from the likes of iTunes, Amazon, or Google Play, you've likely encountered digital rights management, or DRM. This sort of copy protection is intended to prevent piracy. What you might not know is that most commercially produced DVDs and Blu-rays also come with their own form of encryption: Content Scramble System, or CSS (not to be confused with the other CSS). DVD and Blu-ray players contain CSS licensing support and copy protection such as region coding.

So to play a CSS-encrypted disc on Linux, you need to crack the CSS.

DVDs: The Paid Option

When you buy a computer, often it arrives with pre-installed software including a media player like CyberLink PowerDVD. If you're running Ubuntu or a derivative, there's the officially licensed Fluendo DVD Player, but it is offered as a separate download. It's a convenient package which installs via the software center, no command line required. Fluendo offers complete DVD playback, including Dolby Digital 5.1 output, stereo downmixing, Dolby Digital pass-through, menu support, and more.

However, Fluendo may be simple, but there's a price: $15.

The Free Method for DVDs

Luckily, you can get those DVDs working on Linux gratis with some slight tinkering. Free media players including VLC can handle DVD playback in Linux, but require the installation of the libdvdcss library. Essentially, libdvdcss breaks DVD CSS encryption.

Open a terminal (Ctrl + Alt + T) and enter the following commands if using Ubuntu 12.04 through 15.04:

        sudo apt-get install libdvdread4
    
Linux DVD

This installs the required files, but now we need to enable these. For that, enter the following command:

        sudo /usr/share/doc/libdvdread4/install-css.sh
    
DVD Linux

Now we've installed and enabled the proper command.

If running Ubuntu 15.10 and higher, simply run this command:

        sudo apt-get install libdvd-pkg
    
Linux DVD

All should be set, and you should be able to play any DVD using your preferred media player. I tested using both VLC and the default Videos application in Ubuntu.

Space Jam DVD VLC

Playing Blu-ray Discs on Linux

Watching Blu-rays is a bit different. Probably the easiest method is simply installing VLC. By default, VLC includes the packages libbluray1 and libaacs0, both required for reading Blu-Ray discs. then just navigate to Media > Open Disc and select the button beside Blu-ray.

For increased functionality, there's also a means of installing a script that should work for most Debian-based distros:

        wget paste.debian.net/download/5249
    

Once that installs, enter:

        bash 5249
    

Then you'll be prompted to add the repository for the latest iteration of VLC. This is completely optional, but you now should be able to play Blu-Rays. Unfortunately, Blu-Ray playback on Linux is pretty hit or miss. Some titles work fine while others simply don't. There's yet another solution but this requires MakeMKV.

With MakeMKV installed, run the app

        /usr/bin/makemkv
    

Navigate to File > Open Disc and select your Blu-Ray drive. MakeMKV will open the disc and list the various video files. Head to the file menu and click "Stream."

Troubleshooting

Did You Try Turning It Off and On Again?

When installing software, sometimes a reboot is necessary. Yes, it may be the most clichéd IT support answer, but turning your machine off and back on again may be the answer. If using an older release (Ubuntu 12.04 to 15.04), after installing and enabling packages you may need to restart.

Regionset

Experiencing lockups or getting messages that you are unable to play a DVD? It's likely that you'll need to set a region code. Even after the above install, I still had to set a region code. Here's how to launch regionset:

        sudo regionset /dev/X (e.g. /dev/sr0)
    
Regionset Linux

Still can't play a DVD? Disabling DVD menus may alleviate any issues. Many players, including VLC, offer this functionality. To turn off DVD menus, navigate to Media > Open disc and check the box next to No disc menus. If you're like me and really enjoy watching DVD extras and hearing director commentary (yes, I'm that guy), this isn't ideal but it's a solid workaround.

VLC-No-Menus

Herky Jerky

If you're suffering from jerky playback, there's a fix for that too. Provided that you tried playing a DVD without properly setting up CSS decryption, the wrong CSS key may be used. So an easy solution is to just delete the ~/.dvdcss/ folder. There's also a lengthier solution that requires enabling Direct Memory Access (DMA) transfer.

First, enter the mount command:

        mount | egrep 'udf|iso9660'
    

This should tell you where your DVD player is. To enable DMA, use the hdparm comand and the hdparm.conf configuration file. Check your hdparm settings with the following command:

        sudo hdparm /dev/hdc
    

If this returns a message like...

        using_dma  = 1 (on)
    

...then DMA is already on. However, while DMA is enabled, you can specify for DMA to be run at boot. To do so, edit the /etc/hdparm.conf script. Run this command:

        gksudo gedit /etc/hdparm.conf
    

And add these lines to the hdparm.conf:

            /dev/hdc { <span class="anchor">dma = on <span class="anchor">}</span></span>
    

But if DMA is not enabled, you can enable it by running:

        sudo hdparm -d1 /dev/hdc
    

Tales From the Decryption

Still having problems? Persistent decryption problems may be fixed with the following command (my DVD drive is found at sr0, but this can vary so replace the location of your DVD drive if necessary).

        chmod 660 /dev/sr0; chgrp cdrom /dev/sr0
    
DVD Linux Decryption Error

By following these steps, you should be able to play most, if not all, of your DVDs and Blu-Rays. What programs are you using, and what's on your watch list?