Tuesday, December 28, 2004

A Debian Linux install

Warning: this post is primarily about fiddling with a new Linux install. If you don't like that sort of thing, don't bother reading further.

A year and a half ago my primary desktop machine started acting strangely in Windows. The computer worked well with an ancient video card I had on hand, but crashed at random intervals with anything newer, and thus I bought a new machine to replace it. Since then the computer has lain dormant, but recently I decided that it might be fun to try out Linux (I last used Unix in college). So, after reading up on Linux for a while, I dusted off the old box and decided to try installing it this past weekend (a fun Christmas activity, I know).

While I'd seen commercial installations recently, I wanted to try out a version that was completely free, yet well-entrenched, so I settled on the Debian Project's latest stable release (3.0 / "woody"). After figuring out what hardware I had (my previous install of Windows helped with this), I downloaded the latest CD images, burned them to CD, and got going.

A few sources were of critical importance in helping me with the install:
While doing the install I ran into a number of problems that weren't covered by the two sources above, but was able to find solutions to just about all of them online via Google. Below I've included a list of some of the larger problems I encountered, and how I solved them. (Note: I'm a Linux novice; thus if you are encountering these same problems I'd take my solutions with a very large grain of salt. For those of you experienced at Linux, I provide the following as material for you to laugh hysterically at.)
  • The installer didn't recognize my network card (which was an Intel Pro/10+ PCI), and I wasn't able to find that name in the modules list that the installer provided, so I continued the install without any of the optional modules, hoping that the vanilla kernel would have the right modules (bad idea). It turns out that the module for the card is EEPro100, and in order to use the network I had to use "modconf" (as root) to install the module.

  • Probably as a result of the first problem, my network connection wouldn't work even after installing the ethernet card module. I'm connected over a cable modem that uses DHCP; I found pump described online as a DHCP solution, so I installed the package for that (using "apt-get install", which installed it from one of the Debian CD's I'd burned), ran it (using, as root, "pump -i eth0"), and the network worked.

  • One of the abilities I wanted to have was to use the Linux box as a Windows file sharing and print server, and thus I set about configuring Samba. Samba was already installed (I'd selected the package option on install), so I used the Samba Howto to learn how to configure the files (primarily /etc/samba/smb.conf). Even after getting the configuration files set to what I thought was proper, I couldn't see the computer from my Windows machine. It turns out that the Samba daemons weren't started; after running both "nmbd" and "smdb" as root I was able to see the machine from Windows.

  • Even after I'd gotten Samba running, I still wasn't able to log in from my Windows machine. The problem was that Samba wasn't using the Linux password file, so I had to add myself as a user to Samba using the "smbpasswd" program (as root, with the -a option to add a user).

  • Samba and the network still wouldn't start automatically after rebooting, though; I had to manually run pump, and then the two Samba daemons to get the server to start. After reading this post I added the lines "auto eth0" and "iface eth0 inet dhcp" to my "/etc/network/interfaces" file, which got the network starting automatically, but Samba still failed to start. I found out that the DHCP-client package was installed as well as pump, and was being used as the default program over pump. Since I couldn't get DHCP-client configured correctly, but pump was working properly, I uninstalled the DHCP-client package ("apt-get remove" as root), rebooted, and everything worked fine.

  • I also wasn't able to get SWAT (Samba's graphical configuration interface; available via http://localhost:901/) working initially, and thus I configured everything by hand. Eventually I got SWAT working by using the SWAT howto (the primary change was adding a line about SWAT to the /etc/inetd.conf file, I believe).

  • A concurrent problem was that X-windows also refused to start, giving me an error like "no screens found". GDM was set to act as a graphical login on boot, which was nice except that it kept running into errors and thus asking if I wanted to run a configuration program (xf86cfg?) every time I booted. The configuration program looked quite useful, except for the fact that it didn't recognize my mouse, and while they had keyboard alternatives for the mouse, none of them let me click and drag a menu item, so all I could do was quit the configuration program.

  • Undaunted by the lack of graphical configuration programs (this is Linux after all!), I discovered xf86config, a program that walked me through the setup of a configuration file (the proper version of which needed to be moved to /etc/X11/XF86Config-4). After this failed to yield a setup that worked (the mouse didn't function) I found this page which led me to install (using apt-get install) the "discover" "mdetect" and "read-edid" packages; of these, mdetect allowed me to determine where my mouse was connected ("/dev/psaux"), and I manually reconfigured the XF86Config-4 file to include this (in the "InputDevice" section's "Device" line).

  • After getting the mouse's /dev location right, it still didn't work properly; it was jumping all over the place. I have a two button mouse with a clickable scroll wheel in the center, and after much browsing (solution found in this useful manual) I figured out that the "protocol" should be set to "ImPS/2" (again in the "InputDevice" section). To get the scroll wheel to work I had to have "ZAxisMapping" "4 5" as an option in the same section.

  • I also figured out that "dpkg-reconfigure xserver-xfree86" (as root) started an easier configuration program than xf86config. Unfortunately, I selected the option to enable frame buffering, which apparently didn't work with my old Matrox Mystique video card (which, btw, requires the mga driver), and the server wouldn't start. So, I had to comment out the "Option "UseFBDev" "true"" line to get the server to start again.

  • I also found that X-windows was only recognizing the lowest resolution screen resolution I included in the XF86Config-4 file; even ctrl-alt-+ / ctrl-alt-- and the quick resolution changer applet (the quickres-applet package) wouldn't change it. I believe this was caused by my listing the screen resolutions in ascending order in the configuration file ("640x480", then "800x600", etc); once they were reversed I was able to select various resolutions normally.

  • Only about three-quarters of the way through this configuration process did I finally learn how to shut down and restart the X-windows system without restarting the computer (gdm started automatically on startup, as I desired). To shut down gdm I now just switch to another console (e.g. "ctrl-alt-F1"; "alt-F7" returns you to the X-server) and run the command "/etc/init.d/gdm stop" as root. To restart gdm I simply run "gdm" as root. Learning this has saved me many reboots.

  • To upgrade my packages I used the apt-get howto to update my /etc/apt/sources.list file to include the debian http servers for the stable release, and then ran "apt-get -update" followed by "apt-get -upgrade".

  • All of this manual file editing was done using vi, which I had never used before (I was an emacs guy, but it wasn't installed); I found a very useful command summary here. I was also familiar with pico, but couldn't find it; apparently Debian installs nano by default, which functions identically. I'm now using nano for its relative simplicity.

  • At one point in the X-windows configuration process I managed to make both my mouse and keyboard non-responsive once I'd logged in graphically (preventing me from doing anything locally on the machine). From this I learned that I couldn't telnet into the Linux machine from my Windows box, but I could connect using SSH via a SSH client (I found and used PuTTY, which is free for Windows). Unfortunately, at the time I only knew of the telnet protocol (it's been a long time since I've used Unix), and thus after trying to telnet in, and failing, I did a hard-reset. If I'd used SSH to log in remotely, I could have stopped gdm and prevented a reboot. Next time I'll know better.
I'm happy to report that after three days of fun-filled fiddling my new Debian Linux box is now completely up and running; in fact, I wrote this entire post using AbiWord (a free MS Word-like word processor) and Mozilla in my Gnome desktop environment.

No comments: