Thin Client/9.2

From PC-BSD Wiki
Revision as of 14:07, 22 August 2012 by Vater (Talk | contribs)

Jump to: navigation, search

(Sorry for the inconvenience)

Contents

The pc-thinclient script has been improved for PC-BSD 9.1. The 9.0 version allowed your PC-BSD system to automatically configure a network of [1][1] where each computer has a network interface card capable of [2][2] booting. Once connected to the thin client server, users receive a login window. Once authenticated, they can access and modify the contents of their home directory, which is saved on the thin client server, as well as run any applications which have been installed on the PC-BSD system. This functionality is referred to as a PXE Boot Desktop Server.

In PC-BSD 9.1, pc-thinclient builds upon this functionality by adding the following features:

  • the ability to create an installation server. Now when you first initialize the pc-thinclient script, you will be asked if you want to setup a PXE Boot Desktop Server or a PXE Boot Install Server.
  • when setting up an install server, all the necessary bits for PXE booting are taken care of and the installer files are copied from your DVD, allowing you to do PXE installs within minutes.
  • the ability to create unattended installations via PXE boot.

This section demonstrates how to configure and use both the PXE Boot Desktop Server and the PXE Boot Install Server.

Creating a PXE Boot Desktop Server

To prepare your PC-BSD system for a PXE Boot Desktop Server configuration, perform these tasks first:

  1. If the diskless clients will require Internet access, install two network cards where one NIC is connected to the Internet and the other is connected to a private LAN from which the thin clients can PXE boot from.
  2. The PC-BSD system should have lots of RAM installed, especially if multiple clients will be connecting. It is recommended to use a 64-bit system with as much RAM installed as possible.
  3. If the /usr/ports/ directory is empty or does not exist, you can install the ports collection using the "Fetch Ports Tree" button in the Tasks tab of System Manager. If you do not want to install the ports collection, instead use the pkg_add -r isc-dhcp42-server command to install the required DHCP server.
  4. Set aside a few hours as the system will need to rebuild its "world" and the applications it needs in order to support the PXE environment. The script will automatically build a 32-bit environment (even on a 64-bit system) as most PXE boot clients are 32-bit.

To configure the PC-BSD system as a PXE Boot Desktop Server, run the following script as the superuser:

pc-thinclient
/usr/local/bin/pc-thinclient will install the components to convert this system into a thin-client server. 
Continue? (Y/N) y
Do you wish to make this a remote X desktop server or install server?
(r/i) r

If your intent is to install a PXE Boot Desktop Server, input r and press enter.

If you have not yet installed a DHCP server and the ports tree is not installed, this message will appear and the script will abort:

/usr/local/bin/pc-thinclient: Missing /usr/ports/net/isc-dhcp42-server, please fetch the FreeBSD ports tree or install dhcp-server.

Either install the system ports tree or the DHCP server as described in Step 3 above, then restart the pc-thinclient script.

If you installed the system ports tree instead of the DHCP server, a menu will appear where you can select the configure options for the DHCP server. Use your arrow keys to navigate to an option and the spacebar to toggle between selecting and deselecting the highlighted option. If you are unsure, leave the options at their default settings. When finished, press enter to start the build of the DHCP server. Once the DHCP server is installed, the script will build the tools needed in the PXE environment:

Fetching FreeBSD environment... This may take a while...
Extracting PC-BSD environment... This may take a while...
Copying /usr/ports -> /usr/home/thinclient/usr/ports
<snip very long output>
Setting up system for PXE booting...
What NIC do you wish DHCPD to listen on? (I.E. re0) 
nic) em0

Input the FreeBSD device name of the interface that is attached to the local network containing the diskless workstations. In the example shown here, the user has input the em0 interface. If you are unsure of the device name, type ifconfig from another terminal.

The script will now configure the specified interface and start the required services:

Starting /etc/rc.d/nfsd...OK
Starting /etc/rc.d/inetd...OK
Starting /usr/local/etc/rc.d/isc-dhcpd...OK

You will now need to enable remote desktop.
This can be done via the PC-BSD Control Panel -> GDM Configuration
or by manually editing /usr/local/etc/gdm/custom.conf
Your system is now setup to do PXE booting! Please reboot for all changes to take effect!

Before rebooting, check the box Enable XDMCP in Control PanelGDM Configuration. If you forget this step, clients will not be able to receive an X session when they connect.

The thin client script installs and configures the following services:

NFS: the Network File System is a protocol for sharing files on a network. It has been configured to allow clients on the network attached to the interface that you specified to connect to the thin client server. Its configuration file is located in /etc/exports.

TFTP: the Trivial File Transfer Protocol is a light-weight version of FTP used to transfer configuration or boot files between machines. The PXE network cards on the diskless computers will use TFTP to receive their configuration information. This service was enabled in /etc/inetd.conf with a home directory of /home/thinclient.

DHCP: the Dynamic Host Configuration Protocol is used to configure IP addressing info on the diskless workstations. It has been configured to assign addresses for the network attached to the interface that you specified. Its configuration file is located in /usr/local/etc/dhcpd.conf.

The thin client script also creates the pxeboot user with the default password thinclient. This username and password is used to save the working Xorg configuration files for each of the diskless computers. It is highly recommended that you change this password right away by running this command as the superuser:

passwd pxeboot

Connecting to the PXE Boot Desktop Server

After a successful installation and reboot of the PXE Boot Desktop Server, the DHCP service will be running on the NIC you specified. Make sure that this NIC and a PXE capable client are connected to the same hub or switch. When you boot up the client, PXE should automatically obtain an IP address and begin to load PC-BSD. If it does not, review the boot order settings in the BIOS on the client to make sure that PXE is listed first.

After the boot process has finished, the client will be brought to this prompt:

No saved xorg-config for this MAC: <MAC_Address>
Do you wish to setup a custom xorg.conf for this system? (Y/N)

If you wait 10 seconds, this message will timeout, and the client will bring up X in 1024x768 mode. However, if this is not the resolution that you wish to use, type "Y" at the prompt and hit enter to bring up the Xorg Configuration screen. In this menu, you will be able to setup your own custom xorg.conf file, auto-detect settings, and test the new configuration. When finished, choose "Save working config" to send this configuration to the PXE Boot Desktop Server. This will prompt for the password of the pxeboot user. Once authenticated, the file will be saved by the client's MAC address in /home/pxeboot/mnt/xorg-config/<mac>.conf. The next time you boot the client, it will automatically use the saved xorg.conf file and bring the system to the login screen.

The client's boot environment is located in /home/pxeboot. This is mounted read-only during the PXE boot process to allow the client to bootup and create an XDCMP connection to the server.

Creating a PXE Boot Install Server

The installation of the PXE Boot Install Server starts the same, except this time you select i when prompted:

pc-thinclient
/usr/local/bin/pc-thinclient will install the components to convert this system into a thin-client server. 
Continue? (Y/N) y
Do you wish to make this a remote X desktop server or install server?
(r/i) i

You will also need a DVD of the PC-BSD version that clients will install. pc-thinclient will prompt you for the DVD so that it can copy the installation files from it:

Fetching FreeBSD environment... This may take a while...
Extracting PC-BSD environment... This may take a while...
Please insert your PC-BSD DVD to copy install archives
Press ENTER when ready
Copying archives, please wait...

Once the files have finished copying, you will be prompted for the NIC to listen on:

Setting up system for PXE booting...
What NIC do you wish DHCPD to listen on? (I.E. re0) 
nic) em0
Starting /etc/rc.d/nfsd...OK
Starting /etc/rc.d/inetd...OK
Starting /usr/local/etc/rc.d/isc-dhcpd...OK
To perform system installations, place your custom pc-sysinstall scripts in:
/usr/home/thinclient/installscripts
An example script is provided in the above directory
For unattended installations, save your pc-sysinstall script as:
/usr/home/thinclient/installscripts/unattended.cfg
Your system is now setup to do PXE booting! Please reboot for all changes to take effect!

Connecting to the PXE Boot Install Server

This should be as simple as directing the client PC to boot via PXE, and then using the proper IP address.

References


  1. http://en.wikipedia.org/wiki/Diskless_node
  2. http://en.wikipedia.org/wiki/Preboot_Execution_Environment