# Firefox and Flashplayer on DragonFlyBSD Unfortunately, a Flash plugin is not natively available for DragonFlyBSD. When you want to watch Flash sites, you must install Linux versions of Firefox and the Flash player to run under emulation. ## Installing Linux emulation layer on DragonFlyBSD First, you have to install the Linux emulation. This is described in [the DragonFly handbook](linuxemu.html). Of course, you can install a more up-to-date-package of the Suse package, like meta-pkgs/suse100. To do the next steps, you must have your Linux emulation up and running. Do the following steps as "root". ******'NOTE: You can also just install the firefox-linux package and flashplayer from pkgsrc, which is actually the preferred way.******' ## Installing Firefox You should create a subdirectory where you can put in all your Linux applications. In this Howto, it's /usr/local/linuxapps. * Create the directory for you Linux applications mkdir /usr/local/linuxapps * Download a Linux version of Firefox from http://www.mozilla.org and drop the file to /usr/local/linuxapps. * Do a . cd /usr/local/linuxapps * Extract firefox . tar xvfz firefox-*gz * A subdirectory /usr/local/linuxapps/firefox is created then. It contains a firefox "installation" * Delete the firefox installation tarball . rm firefox-*gz * Firefox is now ready to use. You can start it with . /usr/local/linuxapps/firefox/firefox * You may want to make a desktop link/shortcut ## Installing Flashplayer * Download the Linux version of the Flash player from http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version#ShockwaveFlash&promoidBIOW and drop the file to /usr/local/linuxapps. Surf to the download site with your newly installed firefox, then you'll get offered the Linux version of the Flashplayer. * Extract the install_flash_player-file here. . tar xvfz install_flash_player*gz * A subdirectory with the Flash player "installation" in it is created. Enter that flashplayer directory (for example, install_flash_player_7_linux) . cd install_flash_player_7_linux * Copy the file libflashplayer.so into your firefox/plugins directory . cp libflashplayer.so ../firefox/plugins * Copy the file flashplayer.xpt into your firefox directory . cp flashplayer.xpt ../firefox * Delete your Flashplayer installation tarball . cd .. rm install_flash_player*gz * Start Firefox now and surf to a flash site. If you don't know one, try http://autobahn.nrw.de/olsim3_1/koeln.html * Firefox will complain now about a missing plugin. Let Firefox seek for the plugin and go through the installation of the Flashplayer extension. * Now restart your Firefox browser # Alternative: Using nspluginwrapper with the native Flash plugin The method described here consists on using ***nspluginwrapper***, from ***pkgsrc***, with a native browser which, in theory, will perform much better if compared to a generic emulated browser. Procedure tested against DragonFlyBSD 2.6/i386, Firefox 3.6, and flash9 on the pkgsrc-2010Q1 branch. **Note** : Linux emulation support on 64Bit DragonFly is not functional at the time of writing - so you'll need to run 32Bit DragonFly if you want this to work for now. ## Step 1: Setup Linux Emulation Environment Nspluginwrapper requires that the Linux emulation infrastructure is in place in order to correctly deal with the linux format flash plugin. ### Install linux compatibility packages and multimedia/libflashsupport This installs the needed linux packages for flash support, as well as installing the core linux emulation environment, and can be done as follows: # cd /usr/pkgsrc/multimedia/libflashsupport # bmake package clean ### Configure DragonFlyBSD to run Linux binaries In order to use Linux emulated binaries, the linux compatibility layer needs a bit of setup. First, load the linux emulator kernel module: # kldload linux # kldload aac_linux # note - not 100% sure if needed here.. Next, mount linprocfs: # mount -t linprocfs none /usr/pkg/emul/linux/proc Then, run Linux ldconfig to setup the linux-side library linker paths: # /compat/linux/sbin/ldconfig The above steps should enable the linux emulation system to work - this can be tested by running a linux command - for example: # uname -sr DragonFly 2.6-RELEASE # file /usr/bin/uname /compat/linux/bin/uname /usr/bin/uname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for DragonFly 2.0.600, stripped /compat/linux/bin/uname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped # uname -sr DragonFly 2.6-RELEASE # /compat/linux/bin/uname -sr Linux 2.6.16 # file /bin/ls /compat/linux/bin/ls /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for DragonFly 2.0.600, stripped /compat/linux/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped # /bin/ls -l /compat/linux/bin/ls -rwxr-xr-x 1 root wheel 82640 May 6 00:38 /compat/linux/bin/ls # /compat/linux/bin/ls -l /bin/ls -rwxr-xr-x 1 root wheel 82640 May 6 00:38 /bin/ls This example shows the different binary formats, as well as the uname and path overrides provided by the emulation layer, as well as some some subtle ls formatting subtleties between the two systems. To enable linux emulation at boot, set linux_enable='YES' in your rc.conf, and create an fstab entry for the proc filesystem. ### Install nspluginwrapper and ns-flash Now that the Linux emulation system has been configured and tested, it's time to setup the actual flash portion: # cd /usr/pkgsrc/www/ns-pluginwrapper # bmake package clean This should be all that is needed - however, during my tests, I did come across some errors that were related to not having setup the emulation layer properly - these errors contained something like "Elf type '0' binary unknown" - which means that nspluginwrapper is having trouble interfacing with the linux emulation subsystem. You can check the installation with: # nspluginwrapper --list /usr/pkg/lib/netscape/plugins/npwrapper.libflashplayer.so Original plugin: /usr/pkg/lib/netscape/plugins/libflashplayer.so Wrapper version string: 1.2.2 /usr/pkg/lib/netscape/plugins/npwrapper.libflashplayer.so Original plugin: /usr/pkg/lib/netscape/plugins/libflashplayer.so Wrapper version string: 1.2.2 No idea why it lists the plugin twice. From there - use it! * Check about:plugins in your FireFox url bar - you should see: File: npwrapper.libflashplayer.so Version: Shockwave Flash 9.0 r283 * Try it out! even when working, you might still recieve the following message when starting firefox: LoadPlugin: failed to initialize shared library /usr/pkg/lib/netscape/plugin s/libflashplayer.so [Shared object "libdl.so.2" not found, required by "libflash player.so"] which, apparently, can be ignored - as it still worked. ## Audio/Video sync issues with this method Untested - the following was mentioned by ahornung@ on the docs@ list 9/30/2010: About this: with the libflashsupport out of pkgsrc there's an audio<->video sync problem. Johannes Hofmann (jh33) has found and fixed the issue, but since libflashsupport is distributed as a binary, it didn't make its way into pkgsrc and might never do so. He is providing a fixed version (yes, it's a trustworthy source) here: http://flpsed.org/libflashsupport.so.gz and here, I think: http://leaf.dragonflybsd.org/~hofmann/libflashsupport.so ## Further testing for nspluginwrapper, trying other versions, etc If you want to try out another flash version, etc - or possibly for other linux-only plugins - the following steps apply and were previously tested using flash7 and the seamonkey browser. * download the Flash 7 plugin from: http://fpdownload.macromedia.com/get/flashplayer/installers/archive/fp7_archive.zip and unzip it. r73/install_flash_player_7_linux_r73.tar.gz is reported to work. * Extract it somewhere of your choice and run, **as normal user** : nspluginwrapper -i /path/to/your/flash7/libflashplayer.so seamonkey Remember that you need to create ~/.mozilla/plugins first as nspluginwrapper won't do this for you. It will just silent fail. Now enjoy! :)