PDA

View Full Version : Flash on FreeBSD Guide, Common Problems and Solutions


ikbendeman
October 10th, 2010, 20:04
***I know there are threads all over the place for this... But I thought it would be good to start one and try to make it all inclusive. For now, I'll just start with instructions for installing Flash 10 on FreeBSD 8.0.

Flash on FreeBSD 8.0

1) Loading the Linux Compatibility Layer

Before we begin installing flash, the Linux compatibility layer (linux) needs to be loaded. You can do this by running (as root):
kldload linux

To make this persist across reboots, you can either run (as root)
# echo 'linux_load="YES"' >> /boot/loader.conf
# echo 'linux_enable="YES"' >> /etc/rc.conf

or add the following to your kernel configuration file and rebuild your kernel

For i386 /usr/src/sys/i386/conf/GENERIC
options COMPAT_LINUX
options LINPROCFS
options LINSYSFS

For amd64 /usr/src/sys/amd64/conf/GENERIC
options COMPAT_FREEBSD32
options COMPAT_43
options COMPAT_LINUX32

2) Installing Flash

Install ports emulators/linux_base-f10* and www/linux-f10-flashplugin10.

Using make:
# cd /usr/ports/emulators/linux_base-f10
# make install clean
# cd /usr/ports/www/linux-f10-flashplugin10
# make install clean

Using portmaster (you don't have to use --no-confirm or -d, I just like to):
# portmaster --no-confirm -d www/linux-f10-flashplugin10

This should install all dependencies as well, however, as of 2010.10.10, www/linux-f10-flashplugin10 isn't automatically installing [port]x11-toolkits/linux-f10-gtk2 as it should be, so make sure you install this port as well. I have submitted problem report ports/151370 for this.

*Older guides recommended setting OVERRIDE_LINUX_BASE_PORT and OVERRIDE_LINUX_NONBASE_PORTS equal to f10 in /etc/make.conf. This is no longer necessary as linux_base-f10 is now the default.


3) Setting Up linprocfs and linsysfs
I believe that linprocfs is the only one that is actually required for flash to work properly, however, setting them both up shouldn't be a big deal and will ensure that all other linux apps work properly. Add the following to /etc/fstab
linsys /usr/compat/linux/sys linsysfs rw 0 0
linproc /usr/compat/linux/proc linprocfs rw 0 0

These will automatically be mounted next time you (re)boot your system. For now though, run the following as root
# mount /usr/compat/linux/proc
# mount /usr/compat/linux/sys


4) Browser Specific Installation Instructions
a) Opera

Install ports [port]www/opera and www/opera-linuxplugins and you should be good to go!
Using make (ports)
# cd /usr/ports/www/opera && make install clean
# cd /usr/ports/www/opera-linuxplugins && make install clean

Using portmaster
# portmaster --no-confirm -d www/opera www/opera-linuxplugins

NOTE: If you are using Opera, you can skip the section on configuring nspluginwrapper! Do not configure Opera to use the nspluginwrapped version of flash or you WILL have problems.

b) Other Browsers (e.g. Firefox)

Install the browser you wish to use (I'll use www/firefox as an example) and install www/nspluginwrapper.

Using make
# cd /usr/ports/www/firefox && make install clean
# cd /usr/ports/www/nspluginwrapper && make install clean

Using portmaster
# portmaster --no-confirm -d www/firefox www/nspluginwrapper



5) Configuring nspluginwrapper
I'll say it again. If you are using Opera you do NOT need to use [port]www/nspluginwrapper[/man]. That said. you are now ready to configure nspluginwrapper! You have two options here, you can configure nspluginwrapper as root, so that all users on your system will have access to flash. Or you can configure nspluginwrapper on a per-user basis. (You may need to run "rehash" before running nspluginwrapper if you're getting a "nspluginwrapper: command not found." error when trying to run it.)

a) As root
# nspluginwrapper -v -i /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so
This will install the wrapped plugin to /usr/local/lib/browser_plugins/npwrapper.libflashplayer.so, so make sure your browsers are looking to /usr/local/lib/browser_plugins/ to find it.

b) As User
# nspluginwrapper -v -i /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so
This will install npwrapper.libflashplayer.so into /home/${USER}/.mozilla/plugins/ so point your browser there.

ikbendeman
October 10th, 2010, 20:12
Common Problems

1) Opera can't find the plugin no matter what I do!
For some reason, as of this writing, x11-toolkits/linux-f10-gtk2 isn't listed as a dependency for www/linux-f10-flashplugin10 even though it should be. Install this port. I have submitted a PR.

2) Flash works but it plays videos way too fast!
This happened to me whenever I tried flash without my sound card module being loaded and the card being configured. See the handbook section (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sound-setup.html) on how to do this.

3) My browser detects flash but it doesn't work or my browser doesn't detect flash at all.
Make sure you have linprocfs (and linsysfs) mounted. See section on this above.

jb_fvwm2
October 11th, 2010, 00:40
One can view flash *most of the time* with the following and not even the linux compat layer. ( Other non-browser ways also work).

(Some sites do not play the flash though, I've never tried the Linux compat layer(s). )

/usr/ports/multimedia/gnash
and
/usr/ports/www/seamonkey

lyuts
October 11th, 2010, 11:18
One can view flash *most of the time* with the following and not even the linux compat layer. ( Other non-browser ways also work).

(Some sites do not play the flash though, I've never tried the Linux compat layer(s). )

/usr/ports/multimedia/gnash
and
/usr/ports/www/seamonkey

I remember using gnash and I didn't like how it heavily loaded CPU up to about 90%.

ikbendeman
October 13th, 2010, 06:04
One can view flash *most of the time* with the following and not even the linux compat layer. ( Other non-browser ways also work).

(Some sites do not play the flash though, I've never tried the Linux compat layer(s). )

/usr/ports/multimedia/gnash
and
/usr/ports/www/seamonkey

Never tried seamonkey but gnash just did NOT work for me.

qsecofr
October 22nd, 2010, 06:21
Uh oh!
FreeBSD8.1-p1. Dual boot with Win7 EasyBCD boot manager.
I've edited /etc/fstab as instructed above. But it renders my system unbootable. Seems /usr/compat/linux/sys does not exist. Single user boot does not work. I'm prompted for pathname of shell, but USB keyboard does not respond. Same for safe mode. I can escape to a loader prompt and use command more /etc/fstab Is there a way to edit or cat redirect and overwrite fstab so I can safely boot?

jb_fvwm2
October 22nd, 2010, 10:53
I'm just guessing, but do you have a ps/2 keyboard to use temporarily ? Can you load the usb drivers at the boot loader prompt? "rw,noauto" *might* be useful in this case to correct those fstab entries

mount -o force ...
df might work (I forget precisely the method(s)) if you can find fstab and an editor afterwards

wblock@
October 22nd, 2010, 15:17
Uh oh!
FreeBSD8.1-p1. Dual boot with Win7 EasyBCD boot manager.
I've edited /etc/fstab as instructed above. But it renders my system unbootable. Seems /usr/compat/linux/sys does not exist. Single user boot does not work. I'm prompted for pathname of shell, but USB keyboard does not respond. Same for safe mode. I can escape to a loader prompt and use command more /etc/fstab Is there a way to edit or cat redirect and overwrite fstab so I can safely boot?

mount -u /

And then you'll probably need to mount the other filesystems to get an editor:
mount -t ufs

Remove the "linsys" line from /etc/fstab. Try to mount linproc:
mount linproc

If it doesn't mount, remove that line also. Then boot and install emulators/linux_base-f10.

ikbendeman
October 22nd, 2010, 20:49
Uh oh!
FreeBSD8.1-p1. Dual boot with Win7 EasyBCD boot manager.
I've edited /etc/fstab as instructed above. But it renders my system unbootable. Seems /usr/compat/linux/sys does not exist. Single user boot does not work. I'm prompted for pathname of shell, but USB keyboard does not respond. Same for safe mode. I can escape to a loader prompt and use command more /etc/fstab Is there a way to edit or cat redirect and overwrite fstab so I can safely boot?

Sorry about that... for some reason, this happened to me on amd64 as well, change /usr/compat/linux/[sys,proc] to /compat/linux/[sys,proc] and it should work and/or symlink /usr/compat to /compat... it used to be that /compat was a symlink to /usr/compat (I thought?)

ikbendeman
October 22nd, 2010, 20:50
mount -u /

And then you'll probably need to mount the other filesystems to get an editor:
mount -t ufs

Remove the "linsys" line from /etc/fstab. Try to mount linproc:
mount linproc

If it doesn't mount, remove that line also. Then boot and install emulators/linux_base-f10.

I don't think that's the issue, i think it's that /compat used to be a symlink to /usr/compat, now it seems to be the other way around (at least in amd64)... unless I'm getting confused... again

qsecofr
October 23rd, 2010, 02:43
I repaired /etc/fstab by using ed and deleting the last two lines. The suggestion above to mount -u /; mount -t ufs appeared to succeed, but ls /usr was an empty list. Neither ee nor vi were visible under the mounted / directory. I've made a backup of the file just in case I goof up again.. ;-)

Next time I'll follow the steps in order. After editing my kernel config file, I thought: "why not edit /etc/fstab too and save a reboot. What could go wrong afterall?" ;-)

Yes, I had a PS2 keyboard, and that did work when booting to single-user. I suspected as much given the "USB" in my first post. But the confusion arose when escaping to a boot loader prompt and said USB keyboard did work.

wblock@
October 23rd, 2010, 02:49
I repaired /etc/fstab by using ed and deleting the last two lines. The suggestion above to mount -u /; mount -t ufs appeared to succeed, but ls /usr was an empty list. Neither ee nor vi were visible under the mounted / directory. I've made a backup of the file just in case I goof up again.. ;-)

There are some things in /rescue. vi, for one.

qsecofr
October 23rd, 2010, 05:26
I must be doing something incorrectly. I went back and started from the beginning. The ports are now installed. Before editing /etc/fstab I did mount /compat/linux/proc but receive the error "unknown special file or file system." Same for mount /usr/compat/linux/proc. There exists an empty directory on my system ls -la /usr/compat/linux/proc and /compat is symlinked to /usr/compat. Maybe it's already mounted and the manual mount is redundant, but wouldn't that throw a different error?

Update:
Maybe I'm a bit dense. I edited /etc/fstab as above first, and then afterward, before reboot, mounted the filesystems manually. No error. df shows them mounted.

qsecofr
October 25th, 2010, 05:03
My poor improvisation notwithstanding, this how-to worked just fine. Thanks for posting it.

If I might, I'd like to encourage a revision to advise against freelancing like I did. A recommendation to mount manually the linux filesystems before editing /etc/fstab might save someone else a minor headache. If I had stopped to think of the ramifications of an incorrect fstab, I'd have not had any difficulties following this guide.

nix
October 25th, 2010, 08:39
Common Problems

1) Opera can't find the plugin no matter what I do!
For some reason, as of this writing, x11-toolkits/linux-f10-gtk2 isn't listed as a dependency for www/linux-f10-flashplugin10 even though it should be. Install this port. I have submitted a PR.



I also stumbled upon this one and found out that there is file opera checks for plugins to ignore. You can find its location in about:config and search for "Plugin Ignore File". Either clearing this file or creating new empty one resolves the issue for me.

biniar
November 10th, 2010, 01:16
/compat/linux/sys <--The normal mount point for linsysfs.
/compat/linux/proc <--The normal mount point for the linprocfs.

El_Barto
November 22nd, 2010, 21:03
I have been trying hours to get flash working and being able to watch Youtube

Reading endless web pages etc, till I found this link (http://www.wwwpages.com/fgoodies/1349-fireflash.html)

It did the trick for me.

Andrey
November 23rd, 2010, 15:22
Downloaded the file http://get.adobe.com/ru/flashplayer/completion/?installer=Flash_Player_10.1_for_Linux_%28.tar.gz% 29, unzipped...

# nspluginwrapper -v -i /home/ftp/flash/libflashplayer.so
*** NSPlugin Viewer *** ERROR: libssl3.so: cannot open shared object file: No such file or directory
nspluginwrapper: no appropriate viewer found for /home/ftp/flash/libflashplayer.so


libssl3.so there is /usr/local/lib/firefox3

What should I do help please?

wblock@
November 23rd, 2010, 17:15
Downloaded the file http://get.adobe.com/ru/flashplayer/completion/?installer=Flash_Player_10.1_for_Linux_%28.tar.gz% 29, unzipped...

FreeBSD is not Linux, so that is not going to work. The Handbook (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/desktop-browsers.html#MOZ-FLASH-PLUGIN) shows exactly how to get Flash working. There are also all of the earlier messages in this thread.

Andrey
November 23rd, 2010, 21:35
FreeBSD is not Linux, so that is not going to work. The Handbook (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/desktop-browsers.html#MOZ-FLASH-PLUGIN) shows exactly how to get Flash working. There are also all of the earlier messages in this thread.

Ok but where can I get www/linux-f10-flashplugin10 port?
here it is not ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.1-release/Latest/

wblock@
November 23rd, 2010, 23:39
Ok but where can I get www/linux-f10-flashplugin10 port?
here it is not ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.1-release/Latest/

That would be a package, a precompiled port. It won't be there due to licensing, which doesn't allow redistribution.

So update your ports tree (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html) and install the www/linux-f10-flashplugin port. Then follow the instructions on setting it up (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/desktop-browsers.html#MOZ-FLASH-PLUGIN).

Andrey
November 24th, 2010, 16:59
That would be a package, a precompiled port. It won't be there due to licensing, which doesn't allow redistribution.


Download the latest ports from 11/24/2010
ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz

#cd /usr/ports/www/linux-f10-flashplugin10
#make
#make install
#nspluginwrapper -v -i /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so

and the same result :(

*** NSPlugin Viewer *** ERROR: libssl3.so: cannot open shared object file: No such file or directory
nspluginwrapper: no appropriate viewer found for /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so

I have installed FreeBSD 8.1/i386

wblock@
November 24th, 2010, 17:09
#cd /usr/ports/www/linux-f10-flashplugin10
#make
#make install
#nspluginwrapper -v -i /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so

That last line is wrong, and some steps are missing. Please see Handbook section on installing Flash (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/desktop-browsers.html#MOZ-FLASH-PLUGIN). You may also need to complete the Linux emulation setup if you haven't done that already.

Andrey
November 24th, 2010, 17:56
That last line is wrong, and some steps are missing. Please see Handbook section on installing Flash (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/desktop-browsers.html#MOZ-FLASH-PLUGIN). You may also need to complete the Linux emulation setup if you haven't done that already.


I installed linux emulation, may still something missing?

linux-f10-atk-1.24.0 Accessibility Toolkit, Linux/i386 binary (Linux Fedora 10)
linux-f10-cairo-1.8.0_1 Vector graphics library Cairo (Linux Fedora 10)
linux-f10-expat-2.0.1 Linux/i386 binary port of Expat XML-parsing library (Linux
linux-f10-flashplugin-10.1r102.65 Adobe Flash Player NPAPI Plugin
linux-f10-fontconfig-2.6.0 An XML-based font configuration API for X Windows (Linux Fe
linux-f10-gtk2-2.14.7_2 GTK+ library, version 2.X (Linux Fedora 10)
linux-f10-jpeg-6b RPM of the JPEG lib (Linux Fedora 10)
linux-f10-pango-1.22.3_1 The pango library (Linux Fedora 10)
linux-f10-png-1.2.37_1 RPM of the PNG lib (Linux Fedora 10)
linux-f10-tiff-3.8.2 The TIFF library, Linux/i386 binary (Linux Fedora 10)
linux-f10-xorg-libs-7.4_1 Xorg libraries (Linux Fedora 10)
linux_base-f10-10_2 Base set of packages needed in Linux mode for i386/amd64
Lluit-1.0.5 Locale and ISO 2022 support for Unicode terminals


/etc/rc.conf linux_enable="YES"

# df -h
Filesystem Size Used Avail Capacity Mounted on
....
linsysfs 4.0K 4.0K 0B 100% /usr/compat/linux/sys
linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc


# ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so \
/usr/local/lib/browser_plugins/
# nspluginwrapper -v -a -i
Auto-install plugins from /usr/local/lib/browser_plugins
Looking for plugins in /usr/local/lib/browser_plugins
*** NSPlugin Viewer *** ERROR: libssl3.so: cannot open shared object file: No such file or directory
Auto-install plugins from /root/.mozilla/plugins
Looking for plugins in /root/.mozilla/plugins

wblock@
November 24th, 2010, 20:23
Looks like you're missing at least security/linux-f10-openssl.

Andrey
November 24th, 2010, 23:05
No it does not work, ERROR: libssl3.so again...

wblock@
November 25th, 2010, 02:05
You're missing ftp/linux-f10-curl, security/linux-f10-cyrus-sasl2, devel/linux-f10-nspr, security/linux-f10-nss, net/linux-f10-openldap, security/linux-f10-openssl, and databases/linux-f10-sqlite3. Maybe others.

Thing is, the ports system is supposed to install dependencies as needed, so it's hard to say how you got where you are. Sometimes these situations are from mistaken use of "force" or "ignore error" options.

Andrey
November 25th, 2010, 18:24
Thanks wblock, linux-f10-nss solved it all installed, but Flash is still not working, Mozilla 3.6.4 does not see npwrapper.libflashplayer.so in about:plugins if I copied it to /etc/local/lib/firefox3/plugins file appears in the browser but the video still does not work ...

I try
#mkdir -p /usr/compat/linux/proc
#mount /usr/compat/linux/proc
#/etc/rc.d/abi start
#nspluginwrapper -a -r
#nspluginwrapper -a -i
no result...

wblock@
November 25th, 2010, 19:35
Thanks wblock, linux-f10-nss solved it all installed, but Flash is still not working, Mozilla 3.6.4 does not see npwrapper.libflashplayer.so in about:plugins if I copied it to /etc/local/lib/firefox3/plugins file appears in the browser but the video still does not work ...

Not sure why you did that. Remove that copy, then as your normal user, not root, run nspluginwrapper. Also make sure you have linux_enable="YES" in /etc/rc.conf.

Andrey
November 25th, 2010, 21:22
I have linux_enable="YES" in /etc/rc.conf.

I did as a normal user, npwrapper.libflashplayer.so now copied correctly, but instead of video black box again...

Should I set a "YES" in /boot/defaults/loader.conf ?
linprocfs_load="NO" # Linux compatibility process filesystem
linsysfs_load="NO" # Linux compatibility system filesystem
linux_load="YES" # Linux emulation

wblock@
November 25th, 2010, 21:40
Should I set a "YES" in /boot/defaults/loader.conf ?
linprocfs_load="NO" # Linux compatibility process filesystem
linsysfs_load="NO" # Linux compatibility system filesystem
linux_load="YES" # Linux emulation

No, never change /boot/defaults/loader.conf or /etc/defaults/rc.conf. Those are the defaults. They are overridden by what you have set in /boot/loader.conf and /etc/rc.conf.

The only other thing that comes to mind for Flash would be to update to the latest www/firefox, but it should work anyway.

DutchDaemon
November 26th, 2010, 01:19
Andrey, keep formatting (http://forums.freebsd.org/showthread.php?t=8816) your posts, please.

Andrey
November 26th, 2010, 03:12
DutchDaemon, sorry...

wblock, can you give me please a version of libflashplayer.so which works with Mozilla 3.6.4 ?
because I 300M source code plus the dependent libraries for a week does not compile :(

wblock@
November 26th, 2010, 03:37
wblock, can you give me please a version of libflashplayer.so which works with Mozilla 3.6.4 ?
because I 300M source code plus the dependent libraries for a week does not compile :(

The version you built should work. The key is probably in how you managed to build it without installing the required Linux emulation ports. There may be other missing ports.

There should also be a package for the newer Firefox.

Andrey
November 26th, 2010, 04:21
security/linux-f10-openssl . - was installed...

I install old www/linux-flashplugin9 version, video work, but no sound... Linux requires ALSA?

I will go to the Adobe office with AK-47 :)

Andrey
November 28th, 2010, 00:56
wblock, thank you for be patient with me! you gave me good advice!
You were right a couple of modules have been missed. During "make install", we can see what modules are missing this important point I missed...

linux-f10-flashplugin-10.1r102.65 works fine with FireFox 3.6.4 - video and sound work!

spencer3096
February 19th, 2011, 08:48
At first I was getting the following errors with www/linux-f10-flashplugin10:
$ firefox3
LoadPlugin: failed to initialize shared library /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so [/usr/local/lib/npapi/linux-f10-
flashplugin/libflashplayer.so: unsupported file layout]

So I reinstalled the port, mounted linsysfs, and then followed the Handbook's instructions again for FreeBSD 8 and www/firefox. This time, I came across a new error:
$ firefox3
LoadPlugin: failed to initialize shared library /usr/home/admin/.mozilla/plugins/npwrapper.libflashplayer.so [Cannot execute objects on
/usr/home]

All of my partitions except for / are on ZFS[1], and I had exec=off specified for /usr/home.
I was able to fix the issue with the following:zfs exec=on halo/usr/home
Everything works quite well, now.


[1] A slight modification of this howto: http://forums.freebsd.org:8080/showthread.php?t=10334

shitson
March 15th, 2011, 02:03
For future reference this is a good guide for people who have no joy after following the details listed in the handbook. It seemed for me that the location that firefox3 was looking for plugins was no concurrent with the handbook...

Link: http://ultraz-sr.blogspot.com/2010/03/flash-plugin-for-firefox-35-on-freebsd.html

ikbendeman
October 24th, 2011, 20:30
/compat/linux/sys <--The normal mount point for linsysfs.
/compat/linux/proc <--The normal mount point for the linprocfs.

I could be wrong, but the default location changed at some point, I believe possibly 8.0? I'm not sure whether this is the legacy or new location, but either way, I have them symlinked on my box. I'd recommend the same to ensure compatibility with all applications.

zeissoctopus
October 28th, 2011, 02:32
For amd64 /usr/src/sys/amd64/conf/GENERIC
options COMPAT_FREEBSD32
options COMPAT_43
options COMPAT_LINUX32


My customized kernel in fresh 9.0-RC1 amd64 run Linux emulation without any problem with 2 options.
options COMPAT_FREEBSD32
options COMPAT_LINUX32