Contents |
Monday, December 12, 2005 |
Linux and the Sony Vaio: A Report "OH MY GOD, IT ACTUALLY WORKED" by |
|
I have to admit that I did a crazy thing. Well, it all started when a co-worker bought a Sony Vaio 505FX and brought it into work. It was the cutest, thinnest little notebook Id ever seen that still had an (almost) full-size keyboard and a trackpad. The dimensions are 10.2" x 8.2" by 0.94", but it looks even smaller than that. I fell in love with it instantly, but at first I was skeptical. Would I actually be able to type on that keyboard? Would I be able to use the trackpad? And, most importantly, would it run Linux? Well, my co-worker let me borrow it for about a half an hour, which I spent typing and mousing into "Notepad". I was surprised at how well my fingers adapted to the keyboard, and I didnt have too many problems with keys being in funny places. Also, Im used to trackpads (my Mac PowerBook has one), although this one seemed just a tad on the jittery side. No big deal there. Then, I took a trip over to the Linux Laptop Page at http://www.cs.utexas.edu/users/kharker/linux-laptop/ . The 505FX wasnt listed, but its bigger brother, the PCG-737 was. The documentation for the 737 was pretty standard: Pentium CPU, NeoMagic chipset, PCMCIA support, yada yada yada. In other words, the thing was for the most part constructed out of commodity hardware. I guessed that if Sony was going to make one laptop out of standard parts, then it would be likely that the others would too.Now, the Vaio comes with an internal modem, but not an internal CD drive, floppy drive or ethernet adapter. The external floppy comes bundled, so thats no problem. The CD doesnt, but I figured I could do without it; the only thing I would really ever use it for is the initial installation, and I remembered that there was some sort of network install available for Linux. If worst came to worst I could always borrow the CD from my co-worker and do the installation that way. After that I would no longer need the drive - If I ever needed to use a CD ROM drive again, I could mount the drive on my desktop machine as a shared network volume using Samba. That left Ethernet. On the Vaio, ethernet connectivity is made available through PCMCIA cards (Nowadays called "PC cards", which I find confusing, although I understand why they changed it. As one friend quipped "PCMCIA stands for People Cant Memorize Computer Industry Acronyms.") I read to the Linux PCMCIA HOWTO, and it was pretty much the same story: If its commodity hardware, then it should work. Now, I already had a modem/ethernet card from Global Village, a pretty nice one too. The only problem was, that it was originally designed for a Mac. Worse, it seemed that Global Village was somewhat adverse to publishing any technical specifications about their hardware; At least, scouring through the manuals and their web site I didnt find any. The Mac issue didnt concern me too much; After all, PCMCIA is supposed to be a standard, right? The other issue was somewhat troublesome however. I mentioned this to my friend Stig, who said that he had an extra card that he wanted to sell, which was known to work with Linux. He would be in town in a week or so, and would bring it along with him. After waffling for a few days, I decided to go ahead and get the Vaio. I got it at the San Bruno CompUSA (Thats the closest large computer store from here.) I decided not to order it over the network because I wanted to be able to return it easily if it didnt work. I also decided to buy a 3-year extended warranty. The last time I "saved money" by not buying an extended warranty, the device (a boom box) jammed solid about a month after the warranty ran out. I told this to the salesman, and he apparently liked my story so much, he offered to extend the warranty to 5 years at no charge. (Then again, maybe they do that to everybody...I dunno.) Got home, and decided to try out the Global Village card anyway. I figured that it would either recognize it automatically, in which case I could save myself some money, or it wouldnt, in which case I would be no worse off than when I started. Now, I currently have a RedHat 5.1 Linux CD. Version 5.2 has been out for several months, which has some better support for laptop screens, or so I hear. I hadnt gotten that one - I tend to buy every other version instead of every one. So, I figured Id try the installation with the 5.1 CD anyway. I decided to look in the RedHat manual to see what options were available for getting the data from my desktop machine (which has a CD-ROM drive) onto the notebook (which doesnt). It turned out that there were basically five different installation options: CD-ROM, external hard drive, NFS shared volume, Samba shared volume, and FTP. The last option looked particularly interesting: If I could install via FTP, then I could install the latest version of Linux right off of the Internet, without using my 5.1 CD at all. Since I was installing 5.2, I knew that I wouldnt be able to use the boot floppy that comes with 5.1. However, this turned out to be rather easy to solveyou can download the disk image for the boot floppy from the RedHat FTP site. Following the instructions in the 5.1 manual, I then proceeded to make a 5.2 installation boot floppy using the downloaded disk image. The manual also mentioned that if I was installing using PCMCIA, I would need a supplementary floppy with extra drivers. I downloaded that image too, and copied it to another floppy. Next, I plugged in the Global Village card, the floppy drive, inserted the installation floppy, and hit the power switch. It went through the usual RedHat installation startup screen. I selected "expert" mode (since I wanted to know exactly what was going on). It then went through the usual DiskDruid partitioning setup. After that, it started asking me some questions: What ethernet driver did I want to use? I didnt know which driver was the right one, so I tried each one, using the "Autoprobe" setting. None of them worked. So I gave up for the night and went to bed. Next morning I got a visit from Leo Schwab, who brought his Linux laptop (an HP Omnibook 800) over with him, which had a LinkSys ethernet card. "Leo," I said, "can I borrow your Ethernet card? Thanks." Popped the card in, plugged the other end into the network hub, and restarted the whole installation process. This time it didnt even ask which Ethernet driver I wanted to use, it recognized it right away. I selected "install from FTP". At this point, it asked me to set up my network configuration. I set it to an unused IP address, gave it a netmask, domain, etc. In most cases, the default entry (i.e. where the installer "guesses" the netmask, gateway, etc.) was correct anyway, so I didnt have to do much. One problem, however, was that the text cursor, for some reason, wasnt showing up when I edited the text fields, which made editing a little difficult. After the network was set up, it went to another screen where it asked me to enter the name of an FTP server, and a directory path for the RedHat files. I checked the manual to avoid confusion - it said that the installer needed to know where the "RedHat" directory was, not "redhat". I went to my desktop machine and browsed the RedHat web pages list of mirror sites at http://www.redhat.com/mirrors.html. I looked around for a mirror nearby and picked one sort of at random. (My choice turned out to be somewhat unfortunate as well see later.) I pointed my browser at that site until I found the "RedHat" directory, and the I typed into the installer dialog the parent of that directory. Hit OK.At this point ethernet lights on the card adapter started blinking like mad; So did the lights on the ADSL router. "My God, its actually doing something!" A dialog showed that it was downloading a list of packages to install. After about 5 minutes, the package list came up and asked me what packages I wanted. Usually at this point I say "everything", but I decided not to this time because I wanted a system that was small, lightweight and not too confusing. Unfortunately, I didnt know what half of these packages even were, so I didnt know whether I needed them or not. (In my opinion, this is probably the worst part of the RedHat installation process. I know that the installer has text descriptions for the packages somewhere, because it displays them when the packages are being installed; but in the package selection dialog, all it shows you is the package name.) With Leos help, we winnowed the number of packages down to a reasonable number. I Hit OK. The first package started to download. Very quickly, there was a problem...it turned out that the FTP site I chose was busy and refused the connection. I decided to skip that particular package and move on. I then realized I should have hit "retry" instead of "cancel"sometimes you can get on a busy site by retrying the connection. OK, I said, Ill just have to remember the name of that package and install it later. Another 20 minutes passed, and there had been no further problems, but the install was going very slowly...it looked like it would take about two hours, so we decided to go for a walk. On the way, we noticed a 1.7 million dollar house was having an "open house"...but thats another story. (The kitchen was _big_!) We got back, and discovered that there had been another problem, the same one: busy server. This time it was the Japanese documentation. OK, I didt need that. Continue. After three hours it finally completed, with 4 packages which didnt install. (Out of about 600 total). At this point I decided to try and complete the installationset up the mouse, X-Windows, etc. Unfortunately, the last stage, setting up the boot loader, had an error. Could it be, I thought, that one of the packages that had a problem was needed for the system to work properly? The only thing I could think of at that point was a reinstall. I didt want to spend another three hours, but fortunately there was a way out. I knew that most of the packages were already there. I also knew that the Redhat package manager is smart enough to deal with adding new packages to a set of existing ones. So I restarted the install, but I told it not to change the partition table or reformat the drive. Then, at the package selection dialog I selected no packages at all. Of course, this meant that it would still install the non-optional packages, the ones needed for the system to actually work. Fortunately, this was only about 20 minutes worth. This time I set the FTP server to " ftp.cdrom.com" which I know is a server with huge capacity. On Leos advice, I also made a boot recovery floppy this time when the installer prompted me to.It got to the end of the install, but the error installing the boot loader was still there. "No problem," says Leo, "Well just boot with the recovery floppy and see whats wrong." We do this and discover that the problem is simple - I forgot to set the main partition as being bootable. Duh. That being done, we installed the boot loader and rebooted. It started Linux up wonderfully. Only one small glitchlooking at the bootup message log, it appeared that this version of the kernel hadnt been compiled with "apm" support. "apm" stands for "Advanced Power Management" and its a standard hardware interface to allow software to power up/power down the machine, as well as put it to low power mode, sleep, etc. Useful for desktops, critical for laptops. I had selected the "apm" package in the packages list, and also told the installer to make sure that the "apm" daemon was started up at boot time, but that wouldt do any good if the kernel didnt have the apm code in it. Fortunately, reconfiguring and recompiling the linux kernel is easier than most people imagine it to be, although not trivial; If youre running X-windows, it will even give you a GUI with checkboxes for all of the kernel options, and extensive help screens if you want them. I enabled APM, recompiled the kernel and installed the new kernel (being careful to keep the old one around...just in case. Fortunately, the new kernel has a different name, so not much needs to be done...) I rebooted again with the new kernel, everything seemed to be working fine. The APM daemon started up OK. I spent some time tweaking the X-windows setup to look good in 800x600. One surprise - the trackpad (which looks to X-windows like a generic PS/2 mouse) actually seemed to be less jittery in XFree86 than it had in Windows. At that point Leo went home for the evening, and his Ethernet card with him; I guess Ill have to wait for Stig to drop by with his ethernet card before I can do any more downloading and customizing. -- Talin ( Talin@ACM.org) Talins third law:http://www.sylvantech.com/~talin "Politeness doesnt scale."
Jerry, Heres a follow-up on the report I sent you a couple of days ago about my adventures installing Linux on the Sony Vaio laptop. I hope that last one didnt have too many formatting problems; While I never purposely insert any codes or things into my messages, its hard to tell what a particular sequence of characters will translate into. For example, this paragraph is followed by a row of about 20 dashes. -------------------- My friend Stig came over for a visit and brought his spare LinkSys ethernet PCMCIA card. It works fine in the Vaio, so I bought it from him. One minor problem is that in 640x480, the scaled pixels look really ugly. But since I run in X-windows most of the time, I can set the resolution to 800x600, which looks really sweet. One thing I realized that I needed was some way to show how much battery time I had left. It turns out that there are in fact a lot of different Unix programs for monitoring power status. Most of these use the kernel APM services to get a number of interesting facts about battery and power level; But I wanted one that was small and wouldnt get in my way, that would sit in the background of my X desktop. I realized that the most convenient way to do this would be to have the battery indicator as a dockable applet. However, not every window manager under Linux supports dockable applets, so I realized I was going to have to switch window managers. The default window manager for Red Hat is Fvwm95, which gives a Windows95 look and feel. Thats the one I use at work. At home, Im running "icewm", which I think is a little prettier (its themable), and seems to have better performance than some of the window managers Ive tried. However, for the laptop, I decided to switch to the WindowMaker window manager, because it supports dockable applets very well. WindowMaker looks almost exactly like the NextStep desktop, with a dock and everything, except that you can change the colors of everything. I downloaded a couple of dockable applets, including a battery monitor, a CPU monitor, and an ethernet performance monitor. Unfortunately, you have to compile these applets to actually install them, but thats easy enough; just type "make". Once they are compiled, you have to hunt around a bit to determine where the executables got put, and move them to some place useful, like /usr/X11/bin. Finally, to insert them into the dock, what I ended up doing is to run each applet as a seperate program, then alt-drag the running application into the dock. This creates an instance of the application inside the dock. Then, right-click on the dock to get the "settings..." dialog, and check the box that tells WindowMaker to automatically run the applet when it first starts up. There may be a simpler way to do this, but I havent figured it out. I suppose the next logical task is to figure out how to activate the modem and PPP. But I dont feel particularly motivated to do that right now, given that live ethernet cables are rather plentiful in my current environment.
-- Talin (Talin@ACM.org) Talins third law: http://www.sylvantech.com/~talin "Politeness doesnt scale."
PART THREE
The battery on the Vaio is interesting; instead of being flat, like on most notebooks, its a ¾" diameter, 8" long cylinder which is located right at the hinge between the display and the keyboard. According to the salesman at the store, this batter is good for about an hour and a half of use. You can also get a larger battery, which is two parallel cylinders (like a shotgun) which makes the notebook stick out a little in the back. Supposedly this battery lasts twice as long. Just for a test, I decided to see exactly how long the battery actually would last. I started by charging it up to full. The battery indicator on the applet said 3 hours of time were left; I thought that might be somewhat optimistic. In fact, it turned itself off after almost exactly one and a half hours after I unplugged it. Another interesting thing about the Vaio is that when its in sleep mode, it doesnt actually store anything in RAM. Most laptops that Ive seen have special RAM that has a "low-power" mode. Instead, the Vaio saves all of the working memory to a special partition on the hard drive. (When doing an install, you have to be careful not to wipe out this partition.) When you un-sleep the unit, it reloads the contents of RAM and continues. The advantages of this are manifold. First, when the Vaio is asleep its really OFF, or near enough to it. My PowerBook, for example, draws a trickle of power even when its asleep, and if I leave it in sleep mode for more than about three days Ill find that the battery has run down; and when I try to restart it, it reboots and then complains that it hasnt been shut down properly. I imagine that with the Vaio scheme, you could leave it asleep for a much longer time safely, although I havent verified this yet. Anyway, what this means is that even though I let the battery run down to nothing, I was able to successfully wake it up after restoring power. This is especially important for a Unix-based system, which dont like to have their power simply cut off. However, I realized after doing my battery test that there was probably more that I could do to extend the battery life. I decided to go over my kernel options to see what was available. For one thing, theres an option "Make CPU Idle calls" which is supposed to allow the machine to go into low-power mode after periods of inactivity. In my kernel, the setting of this switch was set to "off". I havent had time to do another battery test to see if this had any effect, but I can report that it seems to have done no harm. Theres another option, "console blanking" which seems a bit more risky. Well have to see what happens with that one. One thing that Ive come to realize in this process is the difference that a ubiquitous network can make. My decision not to buy a CD-ROM drive was only possible because 1) I chose an operating system that was very network-aware, and 2) I now live and work in an environment where active ethernet connections are plentiful. Someone else on this site recently remarked about how applications were moving off of the disk and onto the network, so that you no longer need to buy a thesaurus program or CD-ROM street atlas when you can simply use one off of the web. With a network thats fast enough and large enough, a CD-ROM really has no purpose. Of course, there are those advocates of Network Computing who say that even a hard drive can be replaced by a Network, but Im not ready to buy that one yet. Theres always a sense in which I want to be able say "Its my data, and Im going to control it." Of course, in hindsight its obvious that CD-ROM and ethernet are in competition as a distribution medium, but what was surprising to me, I guess, was that the point could be driven home so concretely. I mean, three hundred bucks worth of savings is pretty concrete. -- Talin (Talin@ACM.org) Talins third law:
http://www.sylvantech.com/~talin "Politeness doesnt scale." ===
I noticed that one person wrote in wondering why anyone would bother with all of the trouble I have gone through. I realized that I hadnt made my motivations very clear. Its true that I want a machine that lets me travel around, read mail, surf the web, etc. But I also want to travel around and continue to work on programming. Most of my programming these days is server-based, so it makes sense to have a programming environment that allows me to not only develop server software on the laptop, but connect to my servers at home and program on them as well. In the sense, what Im creating is a full-fledged distributed development environment where I, and a number of other people, can collaborate on large projects irrespective of physical location. It is my belief that the most important thing I can work on at this time is software that helps people interact with each other in interesting ways. My approach towards this is to immerse myself in Internet technologies, to eat, sleep, and breathe Internet. I believe I can do this faster in an open environment, where all of the mechanisms that I use are available to my inspection, than a closed one. At the present time, I do not own a Windows machine, and while I do own a few pieces of Microsoft software (Office97 for the Mac, basically) I hardly ever use them. Is this because I have a deep hatred for Microsoft? Its certainly true that I resent certain things that Microsoft has done to the industry. But Im not really the hating type, and Im content, for the most part, to live and let live. Im also engaged in a kind of philosophical experiment. This is not so much an anti-Microsoft experiment, as it is an anti-proprietary experiment. Im very interested in the open-source development process. At the risk of being provocative, Im beginning to think of proprietary software as a kind of mild perversion, sort of like selling indulgences. Its true that the selling of indulgences was at one time an important part of the economy, and many peoples livelyhoods depended on it. But today nobody cares about that. The economy survived, and is in fact healthier than ever. So part of my experient is to see just how far I can get, in terms of useful productivity, without relying on proprietary software. This does not mean that Im not willing to _pay_ for software I use. Theres also my sense of pride as a software craftsman. Ive never really cared for the way Windows works internally or its APIs. I tried to write a music sequencer under NT at one point, and gave it up as simply too frustrating a task to be worth bothering with. Call me a geek, or a technical idealist if you will, Im comfortable with those labels :-). Finally, I find that there are certain things I can do in the Linux environment that are very powerful. For example, I just learned yesterday how to set things up so that I can do secure file copies between machines as easily as a normal file copy: "scp machinename:directory othermachinename:directory". Of course, you have to have ssh (secure shell) and various ssh utilities installed in order for this to work. I have to admit, however, that administrating these machines is a fair bit of work. If I was simply running a standalone machine in my house, it wouldnt be so bad, I could just set it up and leave it. However, Im running a continuous connection to the net with a DSL router, which means that I have to maintain a firewall. And the thing about firewalls is that you need to look at your logfiles once in a while - active defenses being better than passive ones. Im also finding that unless Im very careful, its easy to tweak one machine and forget to update the others; Not a serious problem, but its irritating when something works on one machine and not another. Im working on setting some way of keeping these things synced together. Like everything else with Linux, someones probably already solved it, you just have to find the solution. My buddy Stig, a serious Unix guru (Im only a journeyman by his standard), has been staying over the last couple of days, and weve been doing some serious shell-script hacking. What we created is a script which runs every day, checks the log files from the web server (it parses the web servers configuration files to figure out where the log files are), resolves the domain names in the log files, runs the resolved log files through Webalizer (a logfile analysis program that builds pretty pie-charts and bar graphs of traffic on your site.), then compresses the file and concatenates it together with all of the other log files for that week, leaving a new, empty logfile for the server to write to. Oh, and it also resets the web server so that it knows to start writing to the new, empty logfile instead of the old one. The script actually waits until the web server is fully reset before actually reading the log file, it does this by watching the process table. That whole script took about six hours to write, and was harder than I thought it would be. Another thing I did recently was to set up IMAP. IMAP is similar to POP3, which is a standard internet protocol for fetching mail from a mail server. The main difference with IMAP is that when you open a connection, it initially only sends the mail headers, not the complete messages. You can then delete or move a piece of mail from the server without ever actually downloading it to your local machine. I use Netscape as my mail reader, which is compatible with IMAP. I find that using IMAP with Netscape is very easy, its only slightly different than when using POP. For one thing, I now have two main folders at the top level, one called "Local Mail", and one named "janus.sylvantech.com" which is the name of my IMAP server. Both of these have an "inbox". The Inbox for local mail contains all of the mail that I received before I switched over to IMAP, and the inbox under janus contains all of the mail thats currently on the janus server. I can click on any message to read it, just like I did before. Whats really cool about this, though, is that I can now read your mail on multiple machines. For example, with my laptop I can look through my mail at just the messages I want to read. I can delete any messages I dont care about. Later, when I get back to my desktop machine, I can access the same set of messages and move them into folders for categorization. I noticed at one point that if I left Netscape running on both machines, both would show the same mail (I have them set to do an update every ten minutes, which is the default.) However the desktop machine has a number of message filters which automatically move messages from the inbox to various folders. Each time a message was moved, it would be transferred from the server to the desktop machine and then deleted from the server. On the laptop, however, what I saw was that a message that had been moved was visible, but had a little red "X" next to it indicating that the message had been deleted. I think what I should probably do is set up those message folders on the server rather than on the local machine, so that both machines will be able to view them. This also means that from now on, if I switch mail clients, I will no longer have to worry about old mail that cannot be imported from one program into another. I remember being very annoyed when I switch from Eudora to Microsoft Outlook on my Mac. Fortunately, Ill never have to worry about that anymore. One other advantage of IMAP is that it can be made secure using SSL, while POP3 is a major security hole - it sends passwords in the clear. -- Talin ( Talin@ACM.org) Talins third law:http://www.sylvantech.com/~talin "Politeness doesnt scale."
====
Talin is an award winning game designer, costume designer and artist. In 1986 he created the hit Amiga adventure game _The Faery Tale Adventure_, including all of the design, writing, programming, artwork and music for the game. Other software creations include _Discovery_, _Inherit The Earth_ and _Music-X_. He has on occasion strayed into an entrepeneurial role, and was the Director of Research and Development for The Dreamers Guild, a software development startup, for five years. He has also been known to give lectures at conventions, and write non-fiction articles (i.e. *rants*) from time to time. His interests include mythology, history, philosophy, political theory and science fiction. He is currently employed as a Senior Architect at Transactor Networks, Inc.
|