Published:

30 Jun 2009

Categories:

Software
Tutorials

Comments:

None

Run Internet Explorer 6 (or IE7, or IE8) images in VirtualBox on Mac OS X

These days I’m looking to save money anywhere I can. How about you? Whereas VMWare Fusion (as awesome as it is) runs around $80 USD per copy, Sun’s VirtualBox is a free, open-source product for virtualization that runs on Mac OS X, Linux, and Windows.

If you’ve not yet read the related post, “Run Internet Explorer 6 (or IE7, or IE8) images in VMWare Fusion on Mac OS X,” you should. This is a follow up on how to take those virtual machines (which we’ve already done a lot of work on), and convert them for use VirtualBox.


Prerequisites

  • You need to have access to a Mac OS X machine.
  • A broadband connection would be quite helpful.
  • A USB flash drive (or some other way to copy files to the VM before you have network access enabled).

VMWare Fusion uses the .vmdk disk format for its virtual drives. VirtualBox uses the .vdi format. Although VirtualBox can use the existing .vmdk images, you get better performance if you convert them to .vdi.


Downloading and Preparing stuff

  1. Download and install VirtualBox. It should live in the /Applications directory.
  2. Download and install Q (a Mac version of Qemu). It should live in the /Applications directory.
  3. Download and decompress an IE6, IE7, or IE8 VMWare Fusion image that I’ve posted previously. If you need ALL of them, you can save yourself the bandwidth by downloading the IE6 image, making a copy of the file, and upgrading that copy to IE7 or IE8.

Extracting the disk image

  1. When you decompress the VMWare Fusion image, you should end up with a folder containing 3 files: Two text files, and a .vmware file.
  2. Right-click (or command-click) the .vmware file and choose “Show package contents.” This will open up a new window.
  3. Find the .vmdk file and drag it some place that’s easy to find. In this tutorial, we’ll use the desktop.

Converting the VMWare image to a VirtualBox image (Optional)

This step is optional. VirtualBox can read the VMWare Fusion disk image format if you’re short on time. However, you get better performance if you convert to the native VirtualBox format.

  1. Fire up Terminal.app. It lives inside your /Applications/Utilities directory.
  2. Move to your desktop directory:
    cd ~/Desktop
  3. We’ll convert the .vmdk file into a raw hard drive file, then convert that raw file into the native .vdi format:
    /Applications/Q.app/Contents/MacOS/qemu-img convert -O raw IE6-XP.vmdk IE6-XP.raw && /Applications/VirtualBox.app/Contents/MacOS/VBoxManage convertdd IE6-XP.raw IE6-XP.vdi && rm IE6-XP.raw
  4. Wait. Depending on your computer, this will probably take 20-45 minutes.
  5. Once it’s done, you can delete the IE6-XP.vmdk file.

Configuring the VM

  1. Move the new .vdi file to wherever you’ll want your virtual machines to live.
  2. Launch VirtualBox. You’ll be presented with the “Welcome to VirtualBox” dialog.
  3. Click “New.” A “Create new virtual machine” dialog box will pop up. Click “Next.”
  4. Name your virtual machine. I named mine “IE6-XP.”
  5. Operating system is “Microsoft Windows.” Version is “Windows XP.” Click “Next.”
  6. Determine the amount of RAM you want to allow the virtual machine to use. I have 4 GB of RAM, so I allow 512 MB. Adjust as necessary, but I wouldn’t go below 192 MB. Click “Next.”
  7. Here, you select the disk image to use. Choose “Use existing hard disk.” There is a pull-down menu that says “<no media>”. Click the icon to the right of it.
  8. The “Virtual Media Manager” dialog should pop up. Click “Add.”
  9. Find where you saved the .vdi file to, and select it. Once that’s done, click the “Select” button. This will close the Virtual Media Manager” dialog.
  10. Back on the “Create new virtual machine” dialog, the pull-down menu that used to say “<no media>” should now say something along the lines of “IE6-XP.vdi (Normal, 16.00 GB).” Click “Next,” then “Finish.”
  11. From there, click “Settings” along the top of the application.
  12. Click the “Audio” tab, and deselect “Enable audio.” We don’t have the drivers for this, so we’ll save ourselves the nag-ware.
  13. Click the “Network” tab, and choose “Intel PRO/1000 MT Desktop” from the Adapter Type pull-down.
  14. Leave everything else as default, and click OK.
  15. Click “Start” along the top of the application to start the virtual machine.

Installing the drivers and Guest Additions

  1. When the virtual machine starts, the viewport will be very small. Windows also may be asking you to find drivers. Make it go away for now.
  2. In the “Devices” menu, choose “Install Guest Additions.” This will load a virtual CD-ROM.
  3. The setup should begin automatically. If it doesn’t, go to the Start Menu, choose “My Computer,” then double-click on “VirtualBox Guest Additions.”
  4. Go through the process and install the software, then restart your VM.
  5. While that restarts, switch back to Mac OS X and download the driver for the Intel PRO/1000 MT ethernet card. Download the version for Windows XP (32-bit). Copy it to your USB flash drive.
  6. When the virtual machine comes back up, you’ll need to connect your USB flash drive to your virtual machine. To do this, you’ll need to drag the flash drive icon to the trash from Mac OS X (but leave it physically connected). In VirtualBox, go to the menubar and choose Devices > USB Devices > USB Flash Drive.
  7. Navigate to the installer on your flash drive, and install the Intel drivers.
  8. Lastly, go to Start Menu > Run, then in the dialog type the following so that you can keep the additional drivers on your VM:
    D:\VBoxWindowsAdditions-x86.exe /extract /D=C:\Drivers

Done!

You should be all set! If you want to get all super-hacky, you can check out “Create IE VBox” for geekier details.


Published:

7 Jan 2009

Categories:

Browsers
Software
Tutorials

Comments:

12 total

Run Internet Explorer 6 (or IE7, or IE8) images in VMware Fusion on Mac OS X

By now, most front-end web developers have heard of the Standalone Internet Explorers (Wikipedia article). Although these are incredibly useful, they’ve always been hacky at best.

Because of that, we need to go the long way. We’ll download the “officially sanctioned” VirtualPC images containing a time-limited version of Windows XP SP3 and Internet Explorer 6.0, and then we’ll convert these images to the kind that work with VMware Fusion (which works on Mac OS X). This should only need to be done every 3 or 4 months when the images expire.

These instructions are loosely based on the ones found at Running IE6, IE7 and IE8 on your Mac.


Prerequisites

  • You need to have VMware Fusion installed on your Mac.
  • You need to have access to a Windows XP machine, as this is where the converting will happen.

For those in a hurry

These are the pre-converted, ready-to-go images that you can simply unzip and run. They DO require VMware Fusion, but DO NOT require Windows. I will update these as often as I need them, but I don’t promise to update them forever. That’s why we have this tutorial. Please read the README file inside these packages to get (a) the expiration date of the image, and (b) the password for the user accounts.


Installing Qemu (FIRST-TIME ONLY)

  1. Download a small application to our Windows machine called Qemu. At the time of this writing, you want to download the regular version 0.9.1. Once it’s done, unzip it someplace that’s easy to get to via the command line (e.g. c:\qemu).
  2. Go into the Qemu folder, then into the bin folder and copy all of the files in the bin folder back to the original Qemu folder (you can simply copy-paste).

Downloading and Preparing stuff

  1. On Microsoft’s website, they have a page entitled Internet Explorer Application Compatibility VPC Image where you can download various time-limited images that allow you to test combinations of Windows XP SP3 or Vista, along with Internet Explorer 6.0, 7.0, and the 8.0 betas. In this example, we’re going to install the IE6/XP image but you can do whatever you need to do.
  2. We’ll need to unpack this download in Windows, so if you haven’t already, make sure you’re doing this part in Windows.
  3. Double-click it (in Windows) to begin unpacking it. It will warn you that it has an expiration date. On that date, we’ll have to download a fresh VPC image from Microsoft and do this all over again.

Converting the image

  1. You’ll want to copy the XP SP3 with IE6.vhd file into the Qemu folder. This will allow us to use simpler, more consistent commands to convert the image.
  2. In your Windows VM go to Start Menu > Run, type the cmd command, and click OK.
  3. Using your deftly intimate knowledge of MS-DOS, use commands like cd to navigate to where you unpacked Qemu.
  4. If you don’t know MS-DOS commands from a hole in the wall, you can download Open Command Window Here from Microsoft, install it, find the Qemu folder in the normal Windows Explorer, right-click, and choose “Open Command Window Here”. One method is shorter and harder, while the other is easier and slower. Take your pick.
  5. Type the following command in your MS-DOS window:
    qemu-img.exe convert -f vpc "XP SP3 with IE6.vhd" -O vmdk IE6-XP.vmdk

    Note that “XP SP3 with IE6.vhd” is the path to the IE6 VPC file you downloaded, while “IE6-XP.vmdk” is the new file that VMWare Fusion will use.

  6. Wait. This will probably take 5-10 minutes.

Configuring the VM

  1. Move the new .vmdk file to your Mac.
  2. Open VMWare Fusion (or shutdown the Windows VM you may already have running) and click File > New.
  3. Go through the wizard and when you get to the “Virtual Hard Disk” page, expand “Advanced disk options”, check “Use an existing virtual disk” and use the dropdown to find the new .vmdk image you just copied back to your Mac.
  4. Finish the wizard and start it! If prompted to upgrade the virtual hard drive, click “Yes.”

Installing the drivers and VMWare Tools

  1. With VMWare Fusion running, download and decompress vmware_xpsp3_drivers.tar.gz. Copy all of the resulting files to c:\windows\system32\drivers. Make sure you install these BEFORE the VMware tools!
  2. Download vmware_mouse.reg and double-click it to load its settings into the Windows registry. VMware doesn’t correctly overwrite these setting upon install of the VMware tools, and the mouse can start doing wonky things. These registry settings fix it.
  3. In VMware, click Virtual Machine > Install VMWare Tools.
  4. Follow the instructions. If Windows asks for additional drivers, point it to c:\windows\system32\drivers.
  5. Make sure that you shutdown the VM and configure your memory (etc.) settings appropriately.

Published:

28 Jun 2008

Categories:

Code
Software
Tutorials

Comments:

4 total

Installing FFMPEG and FFMPEG-PHP in Fedora 8 running on Amazon EC2

I’ve spent a bit of time working with Amazon EC2 recently. One of the things I’ve been working on is getting a stable build of FFMPEG and FFMPEG-PHP running on a Fedora 8 image in Amazon EC2. This is essentially going to be a tutorial to get things up and running. Of course, your milage may vary.

These instructions apply to a 32-bit Fedora 8 installation. The hardware I primarily use happens to be on EC2, but these instructions aren’t specific to EC2. You may need to tweak things a smidge for an x64 system.


Preparing the LAMP stack (and a few other things)

For FFMPEG-PHP to work, you need to have a web server with PHP support up and running. You’ll definitely need GD for image processing and mbstring is helpful in conjunction with PHP5’s built-in iconv support for managing multiple character sets in ID3 tags.

  1. Install PHP, necessary extensions and supporting software.
    yum -y install php-devel php-gd php-mbstring gcc gcc-c++ libtool svn git yasm gsm-devel libogg-devel libvorbis-devel libtheora-devel;
  2. Also, I like to create a directory with symlinks to important files so that I can access everything more efficiently. These will be used throughout this tutorial.
    mkdir /www-config; \
    ln -s /etc/init.d/httpd /www-config/httpd; \
    ln -s /etc/httpd/conf/httpd.conf /www-config/httpd.conf; \
    ln -s /var/log/httpd/ /www-config/logs; \
    ln -s /usr/lib/php/modules/ /www-config/php5-extensions; \
    ln -s /etc/httpd/conf.d/php.conf /www-config/php.conf; \
    ln -s /etc/httpd/conf.d/ /www-config/apache-conf; \
    ln -s /etc/php.ini /www-config/php.ini; \
    ln -s /etc/php.d/ /www-config/php-ini; \
    ln -s /var/www/html/ /www-config/public-html; \
    /www-config/httpd restart;

PHP 5.x should now be installed and you should have a directory prepared that lets you easily access important files for managing your configuration.


Installing FFMPEG

FFMPEG can be fairly complicated to get running properly, so here’s what I’ve gotten working thus far.

  1. Download FFMPEG source. Export the latest FFMPEG trunk from Subversion, then change to the source directory.
    svn export svn://svn.mplayerhq.hu/ffmpeg/trunk /ffmpeg-trunk-source; \
    cd /ffmpeg-trunk-source;
  2. Install x264. Export the latest x264 trunk from Git. Enter the directory, make, install, and go back to the parent directory.
    git clone git://git.videolan.org/x264.git; \
    cd x264; \
    ./configure --prefix=/usr --enable-shared --enable-pthread; \
    make; \
    make install; \
    cd ..;
  3. Install liba52. Download the latest version of liba52 (Currently 0.7.4). Decompress the package, enter the directory, run configure, make, install, and go back to the parent directory.
    wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz; \
    tar -zxvf a52dec-0.7.4.tar.gz; \
    cd a52dec-0.7.4; \
    ./configure --prefix=/usr --enable-double; \
    make; \
    make install; \
    cd ..;
  4. Install FAAC. Download the latest version of FAAC (Currently 1.26). Decompress the package, enter the directory, create the configure file, run configure, make, install, and go back to the parent directory.
    wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz; \
    tar -zxvf faac-1.26.tar.gz; \
    cd faac; \
    autoreconf -vif; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ..;
  5. Install FAAD. Download the latest version of FAAD (Currently 2.6.1). Decompress the package, enter the directory, create the configure file, run configure, make, install, and go back to the parent directory.
    wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz; \
    tar -zxvf faad2-2.6.1.tar.gz; \
    cd faad2; \
    autoreconf -vif; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ..;
  6. Install LAME. Download the latest version of LAME (Currently 3.98b8). Decompress the package, enter the directory, run configure, make, install, and go back to the parent directory.
    wget http://downloads.sourceforge.net/lame/lame-3.98b8.tar.gz; \
    tar -zxvf lame-3.98b8.tar.gz; \
    cd lame-3.98b8; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ..;
  7. Install libmpeg2. Download the latest version of libmpeg2 (Currently 0.4.1). Decompress the package, enter the directory, run configure, make, install, and go back to the parent directory.
    wget http://libmpeg2.sourceforge.net/files/mpeg2dec-0.4.1.tar.gz; \
    tar -zxvf mpeg2dec-0.4.1.tar.gz; \
    cd mpeg2dec-0.4.1; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ..;
  8. Install Xvid. Download the latest version of Xvid (Currently 1.1.3). Decompress the package, enter the directory, run configure, make, install, and go back to the parent directory.
    wget http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz; \
    tar -zxvf xvidcore-1.1.3.tar.gz; \
    cd xvidcore-1.1.3/build/generic; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ../../../;
  9. Install AMR/3GPP. Download the latest version of AMR (Currently 7.0.0.1). Decompress the package, enter the directory, run configure, make, install, and go back to the parent directory.
    wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.1.tar.bz2; \
    tar -jxvf amrnb-7.0.0.1.tar.bz2; \
    cd amrnb-7.0.0.1; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ../;
  10. Compile FFMPEG. Configure, make, and install the software, including all options that enable enhanced functionality.
    ./configure --prefix=/usr --enable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-liba52 --enable-liba52bin --enable-libamr-nb --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid; \
    make; make install;

Installing FFMPEG-PHP

Once you have FFMPEG functioning properly, you can install the FFMPEG-PHP extension.

  1. Download and install FFMPEG-PHP source. Enter the directory, download the source, run phpize, configure, make, install, and go back to the parent directory.
    cd /ffmpeg-trunk-source; \
    wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2; \
    tar -jxvf ffmpeg-php-0.5.3.1.tbz2; \
    cd ffmpeg-php-0.5.3.1; \
    phpize; \
    ./configure --prefix=/usr; \
    make; \
    make install; \
    cd ..;
  2. Add FFMPEG-PHP to the PHP configuration.
    echo "extension=ffmpeg.so" > /www-config/php-ini/ffmpeg.ini
  3. Restart Apache.
    /www-config/httpd restart

FFMPEG and FFMPEG-PHP should now be installed and ready to go. Make sure to check your error log if something isn’t working properly.

cat /www-config/logs/error_log