个人工具

UbuntuHelp:UbuntuLTSP/LTSPLocalAppsFirefox

来自Ubuntu中文

跳转至: 导航, 搜索

Parent: UbuntuLTSP

This page is specific to Ubuntu versions 9.04

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


NOTE: This Howto applies to Ubuntu Version 9.04 ONLY. The Ubuntu 9.10 Howto is considerably easier and can be found at UbuntuLTSPKarmicLocalAppsFirefox Here's a quick Howto to get Firefox with the Adobe Flash Plugin running as a local app (running on the thin client directly instead of running in the server) in Ubuntu 9.04 (Jaunty) While this process has been successfully tested under both the GNOME and KDE desktop environments, this Howto assumes an operating 32-bit LTSP setup is already functioning with the GNOME desktop environment. If you are using a 2-interface LTSP setup (one NIC from the Internet, one NIC to the thin clients), your thin client will probably not be able to access the Internet on Firefox as a local app even after following this Howto. If this is true it is because your LTSP server is not set up as a gateway to allow direct Internet access through the LTSP server. Instructions for enabling this ability are available at UbuntuWiki:ThinClientHowtoNAT. You may follow the NAT Howto either before or after installing Firefox as a local app. 1. First you will need to update the ltsp chroot by opening a terminal window, copying the following code and pressing enter.

sudo chroot /opt/ltsp/i386 apt-get update

Then install the firefox and flash plugin packages you want as localapps in the ltsp chroot

sudo chroot /opt/ltsp/i386 apt-get install firefox flashplugin-installer

2. Due to a bug that causes permission problems (https://bugs.launchpad.net/ubuntu/+source/ltsp/+bug/347957) you will need to create the script that will set up the proper permissions. An easy way to do this is to open an instance of Nautilus (the GNOME filemanager) as the "root" user.

sudo nautilus

A nautilus window should appear with a message warning you that you are accessing the system as root. Navigate to the following folder: /opt/ltsp/i386/etc/init.d Open any file in the folder that ends in ".sh" Click File -> "Save as" and name this file "chmod-resolv.sh" Now delete all the text in the file and replace it with the two lines of code below.

  1. ! /bin/sh

chmod 644 /etc/resolv.conf Save the file and close the nautilus window. 2a. Make sure the script is owned by root and executable by copying and pasting the following code into the terminal window

sudo chown root:root /opt/ltsp/i386/etc/init.d/chmod-resolv.sh
sudo chmod 755 /opt/ltsp/i386/etc/init.d/chmod-resolv.sh

2b. Now you need to add some lines of code to the lts.conf file located in the i386 folder at /var/lib/tftpboot/ltsp/i386/lts.conf

sudo gedit /var/lib/tftpboot/ltsp/i386/lts.conf

If you don't have an lts.conf file yet you can create one by opening an instance of nautilus as root, navigating to /var/lib/tftpboot/ltsp/i386. Then by right clicking in the folder and selecting "new file" you can create a blank file and name it "lts.conf" If you are creating your lts.conf you MUST make sure the first line of your lts.conf is

[Default]

or the code will NOT WORK Copy and paste the code below into your lts.conf file:

LOCAL_APPS=True
LOCAL_APPS_MENU = True
LOCAL_APPS_MENU_ITEMS = firefox
SEARCH_DOMAIN = ubuntu-ltsp5 || Change this for your own network
DNS_SERVER = 192.168.1.1  || Change this for your own network
RCFILE_01=/etc/init.d/chmod-resolv.sh

If you don't know your Search Domain or your DNS Server you can find both listed in /etc/resolv.conf If you created your lts.conf it should now look something like:

[Default]
LOCAL_APPS=True
LOCAL_APPS_MENU = True
LOCAL_APPS_MENU_ITEMS = firefox
SEARCH_DOMAIN = ubuntu-ltsp5 || Change this for your own network
DNS_SERVER = 192.168.1.1  || Change this for your own network
RCFILE_01=/etc/init.d/chmod-resolv.sh

You can always add menu items later if you install additional local apps by separating the items with a comma. For example, if you decided to install the vlc and mplayer in the future your local apps menu items line would look like:

LOCAL_APPS_MENU_ITEMS = firefox,vlc,mplayer

3. Now you need to rebuild the client image

sudo ltsp-update-image

4. Finally, restart the dhcp server

sudo /etc/init.d/dhcp3-server restart

You can verify that Firefox is running a local app by testing the performance of any flash game. I suggest winterbells (http://www.ferryhalim.com/orisinal/g3/bells.htm) as a choice. If you run into trouble you may want to check out this blog post. Again, if you are using a 2-interface LTSP setup, your thin client will probably not be able to get to the internet at this point. The solution is to set your LTSP server up as a router so you can access the internet through it. Instructions are at UbuntuWiki:ThinClientHowtoNAT.