Friday, December 25, 2009

Linux on the Real User's Desktop: Aventail VPN

Previously, I promised to outline some of the steps I had to take to make Linux a reality on the desktop of someone who used their PC for more than just watching YouTube videos of a cat jumping into and out of a box. In this installment, I'm going to cover the most of obscure of my hurdles: the Aventail VPN client.

I realize that this topic is targeted to an extremely small audience. My main reason for covering this is because it's not very well documented. In fact, the tarball I got from the corporate office had no documentation at all. Furthermore, my searches around the Internet turned up next to nothing on the subject -- most posts I found stated that it just wasn't possible. This is simply not true, and as proof, I've been using it for a couple weeks on multiple machines.

One little issue here: normally I would link to the installation tarball I've used. I'm even more inclined to do so since many corporate IT departments will issue a canned "we will not support Linux" response to any requests for the Linux client. Moreover, I've been unable to find many sources for it. At this point, I am uncertain of the legality in re-posting the tarball that I've used, so I'm holding out on doing so until I can find out one way or the other. In the meantime, I can promise you that Aventail includes this client as part of their standard distribution, so your corporate IT department does have it. Keep pestering them, and chances are that someone will send it to you just to shut you up. (But if you do happen to get it this way, be warned that you are completely on your own.)

If this fails, I have found a few links that might be of use. The first is, so far as I can tell, a direct link to the same version I've used, so I suggest trying that first. The rest are sites that list various versions of the Aventail Connect client, but I've not tried to download/install from them, so your mileage may vary:




I'm using version 8.90 because that's the version that was provided by our corporate IT department and is guaranteed to work with our hardware. I'm aware that 9.x and 10.x versions are available, but I've not used them. I would presume that the setup wouldn't be very different for these versions, and a quick scouring of various forums seems to support that thought.

When installing under Ubuntu, understand that the install and startup scripts are not written for your default shell. (Yes, this means we'll be doing a little work from the command prompt. But don't worry ... it's quite painless.)

First thing, copy the tarball into a working directory and decompress it. (I'll assume you can copy a file into another directory.) Once copied, open your terminal window, decompress, substituting the filename for whatever you might have.

tar -xvf AventailConnect-Linux.tar

Now that we've done the hard part, you'll need to make a quick tweak to the installation script. Remember, it's not written for bash, the default Ubuntu shell. When dealing with quick and dirty text editing, I prefer vim. If memory serves, vim isn't installed during the default Ubuntu setup, so we'll have to add that real quick. It's easy enough to install:

sudo apt-get install vim

The next thing we need to do is get the install script set up to work under Ubuntu. Let's open it for editing:

sudo vim install.sh

For the uninitiated, vim opens files in a view-only mode. To begin editing, you'll have to press the letter i to enter insert mode. From there, we make one tiny change. Edit the first line:

#!/bin/sh

to read:

#!/bin/bash

When you're done making changes, press [esc] to return to view mode, then enter the following:

:wq

The colon enters command mode. The w tells vim to write your changes to disk, and the q exits the editor.

Now we can run the installation script:

sudo ./install.sh

One little note: in one instance (I've done this quite a few times), I had to use sudo bash ./install.sh -- and I don't know why or what caused it. If the script won't run, saying there's an error with a function on line 22 or something around there, try this same tip and see if it works for you. The last few times I tried the install, I didn't need to do this, but I'm including it just in case.

Once the install script finishes, you'll have to make the same shell change to the startup script. Aventail installs to /usr/local/Aventail, so switch to that directory.

cd /usr/local/Aventail

Once there, let's open the file for editing:

sudo vim startct.sh

Change the first line from:

#!/bin/sh

to:

#!/bin/bash

Then save and exit with:

:wq

Next, we need to make sure that the startup script can be run without root privileges, so let's change that now:

sudo chmod 777 /usr/local/Aventail/startct.sh

If all went well, you should now be ready to connect to your corporate network. From the command prompt, simply type:

/usr/local/Aventail/startct.sh

The startup script will prompt you for the appliance host/IP address. Note that under Windows clients, this is usually automatically provided in the form of a configuration file, so you may not know it. If you don't know this address, contact your IT department. Alternatively, if you have access to a Windows-based install, the address can be found in the networking section as one of the connections. Right click, select properties, and check the connection info.

Enter the IP or hostname of your Aventail gateway, then follow the remainder of the prompts as you would under a Windows connection.

That's it! You're in!

When you're finished with your work and want to disconnect from your corporate network, enter the following at your command prompt:

/usr/local/Aventail/stopct

Hopefully you have as much success as I did. If you have anything to add, or noticed any errors with this, I'm very interested in your comments. There's a glaring lack of documentation on this particular topic, and I have no problem at all with helping fill this void.

Wednesday, December 23, 2009

Linux on the Real User's Desktop (part 1)

Alright, let's stop messing around: I'm a computer geek. I hate to admit it, because I especially hate the hassle of trying to get these incredibly complex machines to do what should be relatively simple tasks. Be that as it may, I am what I am, as Popeye would say.

I've tinkered over the years with the idea of using a Linux OS on my own home (and work) desktop, but end up switching back to Windows after a couple days because there are just too many essential functions that I can't quite make happen under Linux. For a vast majority of users, who only use their computers for web surfing, e-mail, web-based games, Facebook, and document editing, Linux is a very viable solution. For a "real" user, though -- what some would call a Windows power user -- the reality is that there are just certain shortcomings.

This time around, I've been using Ubuntu on the netbook for about three weeks, and the desktop for a little over a week, and I'm happy to say that for the most part, things are looking pretty good from the usability department. If I can get everything done that I need, I will have avoided the $200 upgrade fee to get Windows 7 Ultimate installed on my main desktop, and a few hundred more by not installing Windows 7 Home on a couple other computers.

So I figured I would document the few hurdles I've had to overcome to make Linux happen, and maybe if there's someone else out there who can gain from my experience, then I've done a bit to give back to the community.

In the next few posts on the topic, I'll go into a little detail on what needed to be done to get certain requirements met. This one, however, is a little overview of what those requirements are, and some general tips on configuration. I know this is a long post, but there's a lot of ground to cover here!

First, the what and the why:

Aventail VPN [view instructional link]
Our company uses Aventail exclusively for VPN access. It is extremely secure, and has also been the number one thorn in my side under Linux. Without it, I can't remote into the office PC, which instantly disqualifies Linux on my home desktop.

Source Code Editor/IDE
Remember, I'm a developer, so I need robust tools that can handle multiple languages in a rapid development environment.

Graphics Design/Editing
Again, this ties into my work as a developer. Part of that development includes graphical user interfaces. Additionally, I do a little photography, so I'll need to import and edit those photos as well.

iTunes/MobileMe
This one is something I'm going to have to live without, because as of this writing, it's just not possible. I have an iPhone, and in order to do all the really useful stuff, I need iTunes/MobileMe to work on the desktop and sync with the iPhone. A later post on this topic will deal with my workarounds.

Multimedia Friendly Apps
I have an extensive music and movie collection, plus I currently use Windows Media Center on a home theater PC to record and play back television (and also use an XBox 360 as a Windows Media Extender). Additionally, I do a small amount of music composition using tools like FruityLoops, so I'll need to replicate all this functionality.

Access to Windows Shares
There are other machines in the house that will be running Windows for a great many years (hey, I can't make everyone in the house switch), so I need to be able to perform integrated backups from a central machine.

Document Printing/Scanning
This is one of those things that a lot of people take for granted when they're getting set up, but it's worth special mention. Printers can be tricky under Linux because many manufacturers don't release specialized Linux drivers. Additionally, multi-function devices (like my Canon MP470 printer/scanner) don't have native scanner drivers either.

I'm sure there are more things that I'm forgetting, but this covers the bare essentials. Remember that any solution to these obstacles has to be free. The whole point in this experiment is to get things done without spending any more money. We spend enough on the hardware, and in this economy, every dollar saved is a pretty big deal.

A couple tips that are worth special mention. Bear in mind that my flavor of choice was Ubuntu Karmic Koala (v9.10), so my nuances might vary significantly from yours.

Server vs. Desktop vs. Netbook Remix
I can only strongly recommend the desktop variety. Server comes without any GUI installed at all, which means you have to download and configure one later if you don't want to do everything via the command-line (which kind of defeats the purpose of a desktop OS). Additionally, I suspect that very few of my readers have any real need to have a machine configured as a server by default. (Fear not -- if you require server daemons and applications like Apache, MySQL, or PHP, those can be installed and configured later quite easily.)

Conversely, Netbook Remix, while geared toward the lower-powered machines, lacks functionality in a great many areas. The desktop version can (and does) run just fine on most popular netbooks. In fact, I use it on my Gateway netbook, which is far from the most powerful workhorse in the category.

Installation method
The distro comes in .ISO format, which is ready to be burned to a CD as a bootable disc. I'm not really a fan of burning CDs any more than is absolutely necessary, so I chose to install from a USB flash drive. This has a couple advantages. First, I can use it to install to my netbook PC (which has no CD drive at all anyway), and makes for a far faster installation experience.

There are step-by-step instructions for building a bootable USB installation, but I prefer to use a free utility called UNetbootin to automate the process, which really makes the setup a snap. You could technically get away with a 1GB drive, but the install utility recommends 2GB. It's worth noting that this will erase the contents of your USB drive.

Installation destination
You aren't convinced. You need to make sure your existing Windows installation -- and all your precious data -- remains intact. No problem! During the install, you can choose to resize your primary partition, leaving all your Windows stuff in it's own little isolated world while creating your new Linux sandbox. Make sure you install side-by-side, and you will have what's called a "Dual Boot" configuration; you can switch between the two operating systems at any time just by rebooting your PC. Additionally, you can access all the data on your Windows partition through Linux.

Caution: be very careful with this step that you do not accidentally choose the wrong option and erase the contents of your disk. Make absolutely certain that you have the side-by-side configuration chosen. It's also a good idea to back up all your important documents before doing this.

One last note: be sure you run a full disk scan prior to installation. Open a command prompt window and type: chkdsk /f /r

You'll have to reboot for the scan to begin. Go watch a movie. This takes a while. When it's done, reboot again to make sure everything is tip top.

Desktop Environment
By default, Ubuntu comes with GNOME. (By the way, I typically hear this pronounced: guh-NOME.) GNOME should be suitable for most users, though there is a popular alternative called KDE. Some users claim that transitioning from Windows to Linux feels more natural when using KDE, though I've discovered that it has some unique little quirks that tend to sour the computing experience.

Sound issues were one of the big ones for me; things that "just worked" under GNOME refused to play any sounds at all under KDE. I do prefer the way KDE looks and feels, as well as its advanced configuration options, but when it's time to get down to the nitty gritty, I want things to function properly with no tinkering required. And so do you. Stick with GNOME until you're comfortable monkeying around under the hood.

If you're ready to take the KDE leap, you can install from the Synaptic Package Manager by searching for "kubuntu-desktop" which will install all dependencies automatically and allow you to switch your default desktop manager. Alternatively, you can forgo GNOME entirely by downloading the Kubuntu installation .ISO file instead of the standard Ubuntu.

Web Browser
Ubuntu comes with Firefox by default, which I'm eternally grateful for, but I'm one of the few who use Google Chrome as my primary browser. It just feels lighter and snappier. Thankfully, Google has recently released a beta version for Linux, which installs in a snap, so you can use either (or a host of alternative browsers). The upside to Chrome is that it has built-in support for most web-based technologies that typically require plug-ins to be downloaded and installed, which makes for a much more "automatic" experience.

...whew!

That's more than enough for now. I'll follow up a little later with a few of those pesky requirements that I listed above. If I keep this up, I'm going to need to start a whole new blog just for this topic, since I'm straying so far away from the code development that I set out to do here!