LTSP - Laptop Configuration HowTo A Guide to setting up a Laptop as both LTSP Server and LTSP Diskless Workstation Client. Written 05/25/2002 Author V. Stevn Bartley Reviewed by Jim McQuillan Introduction Due to a laptop's mobility, it is common for a laptop user to move their machine from one location to another. In some instances, this requires that the laptop be connected to different networks with different IP Subnets. This can present a problem if you are planning on using your laptop as a LTSP Server. There is an even greater problem if you have been using your laptop in conjunction with VMware to provide both the functions of LTSP Server and those of LTSP diskless workstation. Due to the workstation's dependency on the server's IP address for use in it's boot process, it is necessary for the server's IP address to remain constant. In the described scenario of conecting the laptop to different subnets, the server's IP address would change with each different connection. This change of address would require modification to the LTSP configuration files to continue allowing the workstation to boot from the server. To overcome this problem, the following documentation will describe the processes in modifying the laptop's setups and the configuration of DHCP and VMware to allow the laptop to use a "dummy0" network interface for the connection between the workstation and the server. Goals: This document will attempt to outline the processes necessary to make the modifcations to LTSP that are necessary to allow a laptop to perform the function of both LTSP server and LTSP diskless workstation. Assumptions: A laptop capable of running Linux has been installed with Linux, updated with all necessary patches and security updates. Vmware has been installed. LTSP have been loaded and configured to allow operation as an LTSP server. The system used for testing the contents of this outline is a IBM ThinkPad 600x loaded with RedHat version 7.3 using the 2.4.18-3 kernel as a starting point. All available patches and security updates have been applied. VMware 3.0 has been installed and LTSP version 3.0.1 has been installed and configured using the LTSP Linux Terminal Server Project documentation. For the purposes of this document, we are going to use the following subnet information. The primary/phisical network will be on the 192.168.0.* subnet using netmask 255.255.255.0. The dummy/LTSP network will be on the 192.168.10.* subnet using the netmask 255.255.255.0. The LTSP packages used in this installation were: ltsp_core-3.0.4-0.i386.rpm lstp_kernel-3.0.3-0.i386.rpm ltsp_local_apps-3.0.0-0.i386.rpm ltsp_x_core-3.0.1-1.i386.rpm ltsp_x_fonts-3.0.0-0.i386.rpm Additional packages used to complete the configuration as outlined in this document are: dhcp-2.0pl5-8.src.rpm (Used to recompile the dchp daemon to support dummy0 network card configuration.) eb-5.0.6-pcnetfastiii.lzdsk (Used with Vmware as floppy drive file for network boot.) VMware-workstation-3.1.1-1790.i386.rpm (Requires license from Vmware. www.vmware.com) 1.Disclaimer Neither the author nor the distributors, or any other contributor of this document are in any way responsible for physical, financial, moral or any other type of damage incurred by following the suggestions in this text. 2.Copyright and License This document is copyright 2002 by Stevn Bartley, and is released under the terms of the GNU Free Documentation License, which is hereby incorporated by reference. Chapter 1. Initial Configuration Check. Configuration and loading of the Linux system should have been completed following the appropriate documentation available from your distribution provider. Following the installation of the Linux operating system, you will need to install and configure VMare following the installation instructions provided via www.vmware.com. Do not be concerned with configuring a specific vmware client yet. This document will cover the process for accomplishing this later on. To test that all is working, you should verify that your system is capable of booting into Linux in both Graphical and Text only sessions. Verify that you have the ability to access the Internet for downloading necessary files. You should use the online update tools available for your distribution to update your Linux distribution to it's most up to date format possible. Any and all applicable patches and security updates should have been applied. You should be able to install the LTSP packages using the "LTSP -- Linux Terminal Server Project" documentation available on the www.ltsp.org web site. Once you have your system updated and all applications verified, proceed to the next chapter. If you encounter problems during this phase, please review your distribution, LTSP or applications documentation. Chapter 2. Laptop Special Considerations. This chapter will serve to outline the needs and reasons for a different configuration when using a laptop as both LTSP server and LTSP client using VMware as the network conduit for the workstation. It is important to understand how the LTSP packages modify the Linux system to allow specific functions necessary in accomplishing the goal of booting diskless workstations. This information is spelled out in complete detail in the LTSP Linux Terminal Server Project documentation on www.ltsp.org. It is recommended that you review this document before proceeding to fully understand how the client boot process works in relation to the server configuration. Chapter 3 will focus on DHCPD. The default configuration of DHCPD with RedHat 7.3 does not allow DHCPD to be bound to a non-physical/dummy network device. This chapter will specify the steps necessary to configure DHCPD to alow for binding to a dummy device. Next, Chapter 4 will focus on VMware. VMware needs to be configured correctly to allow it's use in connecting a LTSP client workstation to the VMware host LTSP server using the dummy device. Chapter 3. Reconfiguration of DHCPD to allow binding to dummy0. The DHCPD daemon is used to issue an IP address to the diskless workstation when the workstation requests it. Since the physical network adapter is used to connect the laptop to a real network, we do not want to bind the DHCPD service to this device. Binding DHCPD to the physical (eth0) device would result in LTSP and VMware being tied to the IP subnet being used by this network device. The result of this would be that the LTSP server's IP address would change as the laptop was moved from network to network and the LTSP client would be unable to reach the server thus causing the client to fail in it's boot attempt. The first step in the solution to this issue is to modify the DHCPD service to allow the use of a "dummy0" network interface. By creating this dummy interface and binding DHCPD to it, the physical network connection can be modified on the eth0 device wihtout affecting the LTSP server information. To accomplish this reconfiguration, you will need to use the source package for DHCPD. The package used on this system was dhcp-2.0pl5-8.src.rpm. You can acquire this file at: http://rpmfind.net/linux/RPM/redhat/7.2/i386/dhcp-2.0pl5-8.i386.html. This is the current source rpm for rebuilding dhcp. Follow the instructions below for rebuilding dhcp on the laptop. Preparation: Before proceeding, you will need to prepare the system to be able to accomplish all of the steps outlined. You will need to have a directory for use in the compilation of the dhcp packages. It is recommended to use a directory similar to /opt/projects/ltsp/dhcp and this directory path will be used in the rest of the configuration steps. O.K. On to the actuall nuts and bolts. The first thing we are going to do is to create the actaul network device "dummy0". In the /etc/sysconfig/network-scripts directory, you will find a list of ifcfg-**** scripts. You should see a script file ifcfg-eth0 that when you look at it, shows the configuration information for the eth0 network device. We are going to create an ifcfg-dummy0 script. This script should contain the following information. DEVICE=dummy0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.10.1 NETMASK=255.255.255.0 BROADCAST=192.168.10.255 MACADDR=00:11:22:33:44:55 ARP=yes NOTE: The MACADDR shown can be any random sequence of numbers organized as shown. Use of the defaults shown in our example works well. Save this script and set the permissions for this script to match those of the ifcfg-eth0 script. After completing this step, test that the device is able to be used and shows the correct numbers for IP information. You can test this with the command: "ifup dummy0" Follow this with the command "/sbin/ifconfig dummy0"to see the interface output and verify that the interface information is correct. Verify that the IP address for the dummy0 device shows 192.168.10.1. Now, once you complete the next step to recompile DHCPD, if you take out your eth0 card, your system will continue to allow the DHCPD service to be running on dummy0 and thus allow LTSP to function once it has been configured for this device. Acquire and place the dhcp-2.0pl5-8.src.rpm file into the /opt/projects/ltsp/dhcp directory you created above. To install this rpm, type the command: rpm -ivh dhcp-2.0pl5-8.src.rpm. This will install the source file into the /usr/src/redhat/SOURCES directory. Change directories to the /usr/src/redhat/SOURCES directory and list the contents (cd /usr/src/redhat/SOURCES;ls -al [enter]). You should see files matching these: dhcp-2.0-buildroot.patch dhcp-2.0-js.patch dhcp-2.0pl5.tar.gz There may be other files as well but these are the ones we are going to work with. Now, copy these three files to the /opt/projects/ltsp/dhcp directory you created earlier. (cp dhcp* /opt/projects/ltsp/dhcp [enter]) Now, change directories to the /usr/src/redhat/SPECS directory and list it's contents. (cd /usr/src/redhat/SPECS;ls -al [enter]) You should see the following file listed. dhcp.spec This file contains information on how to apply the patches we copied. It is recommended that you review this document so that you have an understanding of what we are going to do next. O.K. Now, we are going to apply the patches to DHCP. Patch0 and Patch1 are the only ones we need. Patch2 is for sparc systems only. So, change directories to the /opt/projects/ltsp/dhcp directory. (cd /opt/projects/ltsp/dhcp [enter]). Now, untar the tgz file you copied there earlier. (tar pzxvf dhcp-2.0pl5.tar.gz [enter]) Now, change directories to the dhcp-2.0pl5 directory. (cd dhcp-2.0pl5 [enter]) The first step is to test the application of the patch to ensure that it will work correctly. To test the buildroot.patch, type: patch -p0 --dry-run <../dhcp-2.0-buildroot.patch [enter]. You should receive a line stating "patching file dhcp-2.0pl5/Makefile.conf" and then you should receive a prompt. If you do not get the correct reply, try the command with -p1. After you receive the correct message, proceed with applying the patch without the --dry-run command. (patch -p0 ../dhcp-2.0-buildroot.patch [enter]). After you receive the prompt again, proceed to apply the second patch. Test the application first by typing (patch -p1 --dry-run <../dhcp-2.0-js.patch [enter]). You should receive a message "patching file common/lpf.c). If all is well, proceed without the --dry-run command. Type (patch -p1 <../dhcp-2.0-js.patch [enter]). Now, you should receive a message "Hunk #1 succeeded at 248". O.K. Now, the files are in place to allow for recompile. Before you do so, however, we need to modify the configuration to allow for Dummy Interfaces to be recognized. To make this modification, change directories to the includes/cf directory. (cd includes/cf [enter]). Now, edit the linux.h file. In this file, locate the "SKIP_DUMMY_INTERFACES" line. Comment this line out by placing a // in front of the line and then save the file. Note: Normally, when dhcpd starts up, it looks for interfaces that it should bind to. The standard dhcp will ignore any dummy interfaces. By commenting out the SKIP_DUMMY_INTERFACES line, dhcpd will no longer ignore the dummy interface we created earlier and can then be bound to that interface. Now, to recompile dhcpd. To do so, change directories back two directories. (cd ../.. [enter]). In this directory, you can run the configure command to configure the system for compilation of dhcpd. (./configure [enter]). When this has completed, you need to run "make" to start the recompile. (make CC="gcc -pipe" DEBUG="$RPM_OPT_FLAGS -D_PATH_DHCPD_DB=\\\"/var/lib/dhcp/dhcpd.leases\\\" -D_PATH_DHCLIENT_DB=\\\"/var/lib/dhcp/dhclient.leases\\\""[enter]). Now, change directories to the server directory. (cd server [enter]). In the server directory, there should be a file "dhcpd". Before proceeding, make a backup copy of the current system's dhcpd file. (cp /usr/sbin/dhcpd /usr/sbin/dhcpd.save [enter]). Now, copy the server directories dhcpd file to the /usr/sbin/directory. (cp dhcpd /usr/sbin/dhcpd [enter]. When prompted choose yes to overwrite the existing dhcpd file.) O.K. Now, you need to modify the file /etc/sysconfig/dhcpd. First, change directories to /etc/sysconfig. (cd /etc/sysconfig [enter]). Edit the file dhcpd to contain the following" DHCPDARGS=dummy0 and save the file. Now, edit the /etc/dhcpd.conf file to reflect your new class-c IP that you setup for dummy0. Change directories to /etc. (cd /etc [enter]). Now, edit the dhcpd.conf file and ensure that each line thin the file that refers to the LTSP server's IP address reflects the correct address. Using our example IP, this would be 192.168.10.1. Now, edit the /opt/ltsp/i386/etc/lts.conf file to reflect the 192.168.10.1 IP address of the LTSP server. Next, edit /etc/exports, /etc/hosts and /etc/hosts.allow. /etc/hosts.allow: portmap: 192.168.0., 192.168.10. Need to show examples of these files. Now, type "exportfs -ra [enter]" to export the file system. Next, restart dhcpd byp typing "service dhcpd restart [enter]" Chapter 4. Configuring VMware for use as LTSP client. The first step in configuring VMware is to run the vmware-config.pl. This step is where you will be binding VMware to interface dummy0 instead of eth0. Before you can accomplish this, you will need to edit the vmware-config.pl file to allow it to recognize the dummy0 interface. To do this, change directories to /usr/bin. Copy the default vmware-config.pl file to a backup. (cp vmware-config.pl vmware-config.pl.save [enter]). Now, edit the file. In this file, you are looking for two instances of . The line following these two instances will look like this: if (/^[a-zA-Z]/( { Change these lines to be: if (/^eth\d+\s+[^:]/||/^dummy/) { Next, run the vmware-config.pl script to configur vmware. When prompted to configure the bridged device, modify it to be bound to dummy0. Now, restart xinetd. (/etc/rc.d/init.d/xinetd stop;/etc/rc.d/init.d/xinetd start [enter]). hey stevnblinhome good evening.:) jammcq: need help in understanding setups for laptop to do demo's. are there any docs on setting up vmware for this? using vmware to start client which netboots from vmware host. stevnblinhome: no real docs on it, but you start with a pcnet32 floppy image is that from rom-o-matic? yes k. when setting up client, what method of networking to allow client access to host filesystem? stevnblinhome: bridged k. stevnblinhome: in the vmware configuration editor, setup your floppy device to be a file, and point to that pcnet32 image k. running vmware 2.0.4. is ok? what is your server ? rh7.3 ltsp 3.0.1 I thought you needed vmware 3.0 to use the 2.4 kernels ? no. have patch that works with 2.0.4 actually have not tested on rh7.3 yet but am using on rh7.2 currently. I think 2.0 will be ok k. jammcq: no pcnet32 on rom-o-matic. only pcnetfastiii. same? stevnblinhome: might be 'lancepci' yeah, I think it's lancepci that is there. got it. thx nope, I was wrong, it's pcnetfastiii.lzrom k. jammcq: How big does the virtual disk have to be for ltsp to work? stevnblinhome: no virtual disk. don't configure a hard disk stevnblinhome: it's diskless, remember ? correct. but not understaning how you configure vmware client side without specify file size. huh ? When building virtual Linux machine in vmware. oh, are you going through the wizard ? yes. dont? oh, for virtual thin client, I don't do that k. jammcq: unclear on question of configure system to allow your virtual machines to access the host filesystem. Do I need this to be set to yes? no, you don't need that didnt think so. thx that is for vmware to automatically configure samba for you ah. what about host only networking? no, you want bridged jammcq: help with dhcpd.conf and vmware. not understanding how I get dhcpd to bind to the vmware bridge. stevnblinux: hmm, I don't remember having any problem with that did you bind to the eth0 interface ? jammcq: that is the trouble. I am not sure how dhcpd.conf works when you install vmware. the vmware install assigns an ip to the virtual vmnet card. How then, do you use dhcp to assign an ip to it? stevnblinux: which form of networking did you choose when running vmware-config? jammcq: told it yes to wanting networking for Virtual Machine.Then it wanted NAT network to be configured to use private subnet. Set to use same subnet as my eth0 is on.Said no to host-only networking. said no to access host filesystem. pattieja: too.:) stevnblinux: NAT configuration? don't do NAT with vmware ps -ef shows vmnet-bridge, vmnet-natd, vmnet-netifup, vmnet-dhcpd is that in version 3.x? yes. ahh. we only have 2.x jammcq: didnt see option to not use it. ok. went back through vmware-config.pl and selected edit mode instead of wizard mode. removed nat configuration. now only network under vmware is bridged. stevnblinux: yes, bridged is all you need YEAHH ok. got dhcpd to assign ip. okay then :) got message "You passed an undefinded mode number" after Ramdisk. can't use the LPP kernel with vmware assuming needs to have diff video settings? ahh. jammcq: now, hanging at Mounting root filesystem: what IP address did you give to the workstation ? 192.168.0.15 ahh. hosts. hmmm?? hosts is correct. 192.168.0.16 ws001. dhcpd is correct. still hangs at mountig root filesystem. did you exportfs -a or restart nfs ipchains, iptables, /etc/hosts.allow ? maybe try: showmount -e robbie: did now and it is working.:) restart of nfs did it. ok. one more issue now. kernel boots. XServer errors. XServer set to auto. laptop uses NeoMagic 256 video card. Any ideas on what to set XServer to? stevnblinux: you need to set the X4_BUSID in lts.conf for the vmware video card to figure out the value of X4_BUSID, you need to set RUNLEVEL = 3, then run XFree86 -scanpci and it will spit out lots of pci info ok. it did. what am I looking for? well, the X4_BUSID needs to be set like this: X4_BUSID = "PCI:0:15:0" perfect. see if you can see which line is the video 0:15:0. VMware LEGACY SVGA ok, add that line to lts.conf, just the way I showed you k. k. now, get x screen. black background. large X mouse cursor. no login screen. When I move mouse, leaves permanent trail of X's. ooh, that's not good lol. am i supposed to leave XServer auto? in addition to X4_BUSID? yes k. did. is there a way to specify 16bit to XServer? the default is 16bit, what depth to you have your laptop screen set to ? 16 max on this system is 1024x768 @16 should be fine. Have you tried loading up a windows client in the vmware ? and you have neomagic ? set X_MODE_0 to 800x600 in lts.conf ? yes, that's a good idea no i havnt tried the windows client. yes. have neomagic. I have neomagic on my dell laptop, and it works fine with vmware sessions here's what I have in my lts.conf for my vmware session: hmmm XSERVER = auto X4_BUSID = "PCI:0:15:0" X_MODE_0 = 800x600 looks same. hmm, it would be interesting to load up a windows session, and see if it behaves the same way. I'm guessing it is related to your X config on your laptop, not the virtual workstation settings when it says building XF86Config-4, is it pulling any information from the laptop's XF86Config-4? or is it building from ltsp? it's entirely ltsp at that point. the workstation doesn't even know that you are running X on the laptop that is what i thought. k. slight change of issue with it. had a lightbulb go on.:) had setup my desktop for iceWM. Had been running in that this morning. Switched back to KDE. slightly different results. Get standard X background with large X mouse cursor and mouse moves without leaving trail. still no login screen though. ok, now you've got to get your display mgr setup. do this: netstat -anp | grep ":177 " I get nothing. well, time to do some digging which display manager are you running ? kde 3.0.0-10 no, that's your window manager, what is your 'display manager' ? NeoMagic 256 * jammcq is testing stevn ?? lol no, that is your video chipset k. help!!!! stevnblinux: xdm, gdm, kdm ? or wdm or robbie, you spoiled it k. enough making fun of the dimwit in the corner.:) this is not wasted time, teaching stevn to know the difference stevn, you come from an SCO environment, correct ? :) learning all the time. Now, how do I know which one? correct. actually stevnblinux i recommend a good reading of the ltsp docs about 3 times, keep it in the toilet :) way before x. getty on a dumb terminal on sco is roughly equivalent to the display manager on Linux, only it's graphical so. how do I figure out which I am using? ps -el | grep dm k. I thought I was doing it right but figured since there was no valid response to that I must be wrong. ps -el | grep dm responds with only cardmgr. No other "dm" processes. what runlevel are you in ? 5 hmm, should have a display mgr running try ps -elf same. rh 7.3 make a diff? k. hold on a sec. went to power off vmware. got message about needing VMware Tools to operate in anything over 640x480 w 16 colors. Does this apply to linux guest? If so, should i set to runlevel 3 and install the tools before proceeding? don't worry about that k. ok. manually started kdm. restarted vmware client and it worked. Any idea's of why no dm running on system yet am up in kde to run vmware? when you boot up your laptop, does it go to a graphical login, or a text login ? text. manually startx. which I would have thought would automatically also start kdm are you sure your laptop is in runlevel 5 ? my vmware session is set to runlevel 5. my laptop /host is set to runlevel 3. well, there ya go. that's why kdm isn't starting ??? so, kdm wont get started when I start and x session from runlevel 3? and=an so, does that mean I have to have my ltsp server booting in runlevel 5? yes, but you don't have to have X automatically launch on the laptop k. so I modify inittab to 5. then how to get to boot to text mode? well, we don't know if it is going to run kdm or gdm, so we should just edit both files edit the /etc/X11/xdm/Xservers file comment out the entry that looks like this: :0 local /usr/X11R6/bin/X then, edit the /etc/X11/gdm/gdm.conf file down near the bottom, in the '[servers]' section, comment out that entry actually, i wouldn't be surprised if they are already commented out k. done. ok, change the 'initdefault' entry in inittab, and you should be good to go rebooting it now. so, is there a way to specify the dm for the client to be diff than what is run on the server? Thinking along line of kde on server and gnome on client for visually different systems. you are mixing dm and wm dm is kdm, xdm or gdm. You can run any of those but only one of those can run k. then, you can choose whatever window manager you want, per user stevnblinux says duh to himself.:) feeling befuddled k. up. now, ps shows kdm hey look, if this were easy, everybody would be doing it :) :) exactly. worked..... jammcq: Once again, I am thankful for your help. gotta go to a meeting now. ttyl. have fun eveining all.:) hey stevnblinhome hey, are you aware of anyone who has created mailing/promotion material for ltsp that would be willing to share designs? looking to create some mailers/flyers that promote/compare linux ltsp to ms solutions. hmm, not really, but there's a guy in Ireland who has helped me with press releases. hey may have some ideas. lemme see if I can remember his name k. ah, John McCreesh jpmcc@users.sourceforge.net cool. will contact him with my ideas. see what he might be willing to share. I used to use a product called "MyBrochure's". Back in my ms days. Anyone know of a comparable product on Linux?