Running Handbrake in Ubuntu on a Windows 7 Host

I have kids that are now of Disney-watching age. They love their DVD’s but do not know how to take care of them. A DVD is a frisbee, coaster, and also just happens to play movies, too. To correct this I have been backing up their DVD’s to .mp4/.mv4 files and playing them instead.

Handbrake has been my go-to choice for backing up DRM-protected movies but I have had problems running it directly in Windows 7. For starters I cannot get the 64-bit version to run and the 32-bit version renders at an abysmal 7 frames per second.

I had a few hours of play time the other day and I decided to attack DVD backups from a different direction. I decided to try running Handbrake in Ubuntu (Linux) using Oracle’s Virtual Box on Windows 7. It took a while to piece together but these are my step-by-step instructions on how to configure the VM. Oh, and as it turns out Handbrake runs much much faster in Ubuntu …

Requirements:

  • 8 GB RAM (or more)
  • Windows 7 (or newer)
  • 20GB of free hard drive space
  • DVD-ROM Drive

Install Virtual Box

  1. Install Oracle VirtualBox. VirtualBox can be downloaded here. I am using VirtualBox 5.0.16 installed on a Windows 7 host computer for this walk through

Create Ubuntu Client on VirtualBox

  1. Download an .iso (disk image) of Ubuntu. I downloaded a copy of 64-bit Ubuntu Desktop 14.04 from here.
  2. Start VirtualBox; Click “New”; Select Type: Linux and Version: Ubuntu (64-bit)
    • Memory size should be at least 3000 MB
    • Virtual Hard Disk should be at least 20 GB

  3. Click “Start”
  4. Select .iso file from (1).
  5. Click “Start”.
  6. Follow the wizard to install Ubuntu.

Install Guest Additions

Guest additions will allow us to run Ubuntu full screen from within VirtualBox and share folders between Windows (host) and Ubuntu (Client).

  1. Select Devices -> “Insert Guest Additions CD Image” from the VirtualBox window. This will mount VirtualBox guest additions so that it might be installed into your Ubuntu client.
  2. Press CTRL+ALT+T to bring up a terminal.
  3. First, navigate to mounted guest additions image. “scott” will be whatever user you are logged into Ubuntu as. The name of the mount might change depending of the version of the Guest Additions provided with your VirtualBox.

     
    cd /media/scott/VBOXADDITIONS_5.0.16_105871
    

    Now, install guest additions.

     
    sudo ./VBoxLinuxAdditions.run
    
  4. Restart Ubuntu.
  5. Ubuntu should now be able to run full screen. Goodbye tiny window.

Enable shared folder

Guest additions also allows you to share folder between your Windows Host and Ubuntu Client.

  1. Create a folder “C:\shared” in Windows (your host machine)
  2. Select Devices -> Shared Folders -> Shared Folder Settings from the VirtualBox window.
  3. Clicked “Shared Folders” in left menu.
  4. Click the Add Folder icon on the right margin.
  5. Select the location of the “shared” Windows folder for “Folder Path”.
  6. Set “Folder Name” to “shared”.
  7. Check “Auto-mount” and “Make Permanent”.
  8. Click “OK”.
  9. Press CTRL+ALT+T to bring up a terminal.
  10. Now we’re going to grant yourself membership to the VirtualBox shared folder group in order to access it.

    First, list all groups in Ubuntu. You should see vboxsf listed.

     
    cut -d: -f1 /etc/group
    

    Next, list which groups you are a member of; You shouldn’t see yourself.

     
    groups
    

    Finally, add your account to vboxsf shared folder group. “scott” is the account you will be logging into Ubuntu with.

     
    sudo usermod -a -G vboxsf scott
    
  11. Restart Ubuntu.
  12. The “shared” folder is now mounted as media/sf_shared.

Configure DVD-ROM Passthrough

This will enable Ubuntu to read from the hosts drive; Not doing this will result in region errors when reading from the drive.

  1. Shut down Ubuntu if it is running.
  2. In Oracle VM Virtual Box Manager Window right-click on “Ubuntu” in left pane and select “Settings”.
  3. Select “Storage” from the left pane.
  4. Select your DVD-ROM and click the “Passthrough” checkbox.
  5. Click “OK”.
  6. You should now be able to read DVD’s from the host computer’s DVD-ROM.

Install Handbrake

  1. Press CTRL+ALT+T to bring up a terminal.
  2. First, add handbrake release repository.

     
    sudo add-apt-repository ppa:stebbins/handbrake-releases
    

    Next, get gets package info from internet.

     
    sudo apt-get update
    

    Finally, install handbrake gui and command-line interface.

     
    sudo apt-get install handbrake-gtk handbrake-cli
    

Enable DVD decryption

This installs libdvdcss, an open source library for decrypting DVD’s. These instructions are specific to Ubuntu 14.04 and might change.

  1. Press CTRL+ALT+T to bring up a terminal.
  2. Install DVD ripping library.

     
    sudo apt-get install libdvdread4
    

    Register libdvdcss

     
    sudo /usr/share/doc/libdvdread4/install-css.sh
    
  3. Restart Ubuntu.
  4. Handbrake should now be able to rip movies to your shared drive! Okay you got me. Batman Begins is definitely not a movie I show my kids – but it’s the only DVD I had on hand for this example.