Building FFmpeg for Windows on Linux - Part 1 - Setting Up the Virtual Environment
The first part of this tutorial will cover setting up the virtual instance of Ubuntu 10.10 on a Windows 7 64-bit laptop using VirtualBox. The steps below will outline the entire process to get your virtual evironment ready to compile FFmpeg.
- Download and install VirtualBox for Windows hosts
http://www.virtualbox.org/wiki/Downloads - Download Ubuntu Desktop Edition 10.10 64-bit ISO
http://www.ubuntu.com/desktop/get-ubuntu/download - Create a new VirtualBox virtual machine and install Ubuntu from the downloaded ISO
- VM Name and OS Type
- Name: Ubuntu 10.10
- Operating System: Linux
- Version: Ubuntu (64 bit)
- Memory: 512 MB (Default) - I increased this to speed up the process a bit. If you have more RAM to allocate to this VM, go ahead and do so.
- Virtual Hard Disk
- Boot Hard Disk: Checked
- Create new hard disk: Selected
- Storage Type: Dynamically expanding storage
- Virtual Disk Location: Default
- Virtual Disk Size: 8.00 GB (at least 6 GB is recommended)
- Add the Ubuntu ISO as a CD Drive
- Select the newly created VM and click Settings
- In the Settings dialog, select Storage from the left side menu
- In the Storage Tree, select Empty under IDE Controller, then click the folder icon to the right of the CD/DVD Device drop-down to open the Virtual Media Manager
- Click the Add button to add the Ubuntu 10.10 ISO that you downloaded above
- Select the ISO that you just added and click the Select button
- Verify that the ISO has been added to the CD/DVD Device and click the OK button to close the Settings dialog and accept the changes.
- Start the VM and follow the Ubuntu installation instructions
- When Ubuntu first loads from the CD (ISO), it will prompt you to either Try Ubuntu or Install. Select Install.
- Preparing to install Ubuntu
- Download updates while installing: Unchecked. We will install updates after the installation
- Install this third-party software: Unchecked. This is not necessary for our purposes.
- Allocate drive space: Erase and use the entire disk (use defaults on next screen [select drive])
- Click the Install Now button
- During installation, select the appropriate options for timezone and keyboard layout
- Who are you? Create a username and password, be sure to either write down this information or remember it so you can login to Ubuntu later.
- Sit back and wait for Ubuntu to finish installing, it takes about 10-15 minutes depending on the allocated resources of the VM.
- Once the installation has finished, you'll be prompted to restart. Go ahead and restart, and if it prompts you to remove installation media, do so by opening the menu Devices -> CD/DVD Devices and click Ubuntu 10.10 ISO to un-check it.
- After restart, login to Ubuntu with the username/password entered during installation
- VM Name and OS Type
- Run all Ubuntu updates, either via Update Manager or apt-get. Either option will take some time to download and install updates. Get and install updates until there are no updates left.
- Update Manager
- Open the Update Manager in Ubuntu under the System -> Administration menu (it may open automatically after having been logged in for a minute)
- When the Update Manager opens, click the Install Updates button and enter your password when prompted to Authenticate
- Wait for the updates to install, this may take several minutes
- After the updates are installed, restart and log back in
- apt-get
Open a terminal (Applications -> Accessories -> Terminal) and enter the following commands
~$ sudo apt-get update
~$ (output removed)
~$ sudo apt-get upgrade
~$ (output removed)
- Update Manager
- Install VM Additions - this will make it a little easier to interact with your guest operating system
- In the VM host window, select Devices -> Install Guest Additions... to "insert" the VM Additions Cd into the VM
- Mount the CD in the guest VM by selecting Places -> VBOXADDITIONS_x.x.xx_xxxxx
- This should cause a "Places" window to open which indicates "The media has been detected as 'UNIX software'. Click the Open Autorun Prompt, then click the Run button when prompted to confirm
- Enter your password if prompted to perform administrative tasks and click the OK button
- VM addittions will open a new terminal window and be uncompressed, built and installed
- When it is finished, press Return (Enter) to close the build window
- Restart to finish enabling VM additions
- After restarting and logging back in, you can "eject" the VM additions CD by right-clicking the desktop icon, and selecting Eject, then under the VM host window, select Devices -> CD/DVD -> VBoxGuestAdditions.iso to un-check the ISO.