Beginning Drupal, part 3

Continuing to learn Drupal on Mint Linux 9 running on VirtualBox.

Starting lampp automatically

I’m already getting tired of having to start the lampp setup every time.  There must be a way to script a startup script in Linux for this.

And there is, at Tips4Linux.com.  Many thanks and full credit to that site!

First, in the Terminal, I create a file (what we used to call a batch file in good ol’ MS-DOS):

sudo nano /etc/init.d/local.autostart

Which opens up an editing box.  I put in the first line:

#!/bin/sh

and then add my commands:

sudo /usr/sbin/apache2ctl stop to halt any existing web server, and

sudo /opt/lampp/lampp start to start up everything I want with lampp instead.

I exit the file with Ctrl-X and it asks about saving it, so I agree, save as the given name, and I’m out.

Then I need to permit execution with sudo chmod +x local.autostart (since I’m in the directory already)

and set it to run at startup: sudo update-rc.d local.autostart defaults 80

and when I reboot, I see no difference or need no special passwords.

Apparently it worked, however, because Firefox comes right up with the localhost and the Drupal pages.

Customizing the Theme CSS

Drupal for Dummies covers customizing the CSS for the theme pretty well.

Image Gallery

Chapter 13 covers an image gallery.  I need to add a module, which I get from the original Drupal.org site, called Image.

This provides a number of image functions for a web site, primarily as part of a thumbnail contents list for any images posted.

And on…

Additional Modules

Interesting section in the book on recommended modules to add.

One for your FAQ section.  One for CAPTCHA to reduce spam, although that’s been overcome with brute force attacks of lots of cheap typists, apparently (the 21st-century equivalent of a million monkeys on a million typewriters, turning out not Shakespeare, but CAPTCHA translations for spamming purposes… now, that’s depressing… ).

Beginning Drupal, part 2

Now that I have a Drupal installation on the Mint Linux, I can start the real work of setting up a website using Drupal.  I hope.

It’s another day, and another start of my VirtualBox installation of Mint 9 Linux, so I have to start the LAMPP again (details in last post).  Perhaps I’ll get around to having this happen automagically later.

Oops.  A web server is running already.  I have to do sudo /usr/sbin/apache2ctl stop to shut all that down, first.

Then I start lampp again: sudo /opt/lampp/lampp start .

I start Firefox and go to http://localhost/drupal .

I get a warning that cron hasn’t been run.   I can do it from a link there manually, so that’s taken care of.  This is supposed to be doing maintenance tasks, whatever might be needed for this.

I also have a warning on the settings.php file about making it non-writable.  I pull up the file, right-click and change the permissions.

In the left column, there’s a “My account” link for the administration stuff.  No need to change that since it gets set up during the Drupal installation.

Under Administer we have content creation and similar useful functions.

Content management seems to be mostly about setting up the more blog-like functions of the site.

Site building has Blocks, Menus, and Modules, along with Themes.  The book suggests changing the theme, just for practice.  This changes the overall appearance theme for the web site.

Site configuration is the general rules control for the web site.  I tweak the Site information to make the name read “Over-Automated Librarian” properly.  I also add a footer for the catch phrase, and use HTML code to italicize it.  It all works as it should.

The book Drupal for Dummies has a long section now on users and settings permissions.

Content

The book mentions nodes, which is defined as a block of content, whether in a web page or a story or a blog post.

There’s a step-by-step to create a page, and then how to edit a page.  The page I create now is at http://localhost/drupal/node/2 which explains the business about nodes, somewhat.

Pages don’t show up at this point.  Another story, however, shows up at the top of the home page, like any blog post.

Editing a page is a little interesting.  You can choose the weight of the page, which is similar to the page numbering function in WordPress, but in this case it works rather like a real weight would — the higher the number, the lower it sinks.  Above zero, you move up higher than ground level to the top at -50.

You can also promote it to the front page, or make a post “sticky” like you can in WordPress, so it stays at the top no matter what until you make it unsticky.

Input format: Web URLs and email addresses automatically work as proper links.  Nice to avoid having to do all that in HTML.

Images are in HTML code.  Those have to be linked to the file on a server, as usual.

More on Themes.  By changing to the Pushbutton theme, I get the Pages in the header  and footer, along with the posts.

I can also change the logo.  This gets squashed in the Pushbutton theme if it turns out to be too tall.  No dimensions are given so it seems to be trial and error.

Content (text, menus, graphics, etc.) is grouped into blocks.  Blocks are put into Regions on the web page: the header, footer, left sidebar, right sidebar, and the middle Content region.

Modules are the interesting part.  These are enabled to handle various functions, such as blogs, polls, trigger events, and a batch of other features which can be enabled.  Turning on the Blog module adds “Blog entry” to the Create content options.

New Themes

Chapter 10 covers getting new themes.  Track down the location of themes which turns out to be /opt/lampp/htdocs/drupal/themes and download the themes to there.  I have to use Archive Manager to uncompress them first, then select the new ones and try them out.

It’s a lot like the WordPress blog themes — some work for what you need to do, some don’t, some have the features needed, some don’t.

poormanscron

Drupal for Dummies recommends adding the poormanscron module and gives instructions on that.  This will update modules and themes automatically.

Provided… you configure it.  The book doesn’t cover version 2.2.

The book says it goes in “your Drupal modules directory” but the readme file says that you actually should go into the sites directory, not modules.  Always check the latest readme file, I’ve found in both Windows and Linux.

I go to /opt/drupal/sites/all and create a new modules subdirectory.  I had to change permissions, of course — nothing can be done in Linux without stopping to change permissions at least once somewhere or other.  This is good for security (but a nuisance to set up anything) and only then can you put the poormanscron in there and uncompress it.  That should make it available to every web site done in Drupal.

Contrary to the book and to previous versions, the web page for poormanscron says “The 2.x version no longer has its own module page at admin/settings/poormanscron. You will find the ‘Automatic cron’ poormanscron setting at admin/settings/site-information at the bottom of the page.”

This turns out to be only a timer for how often it runs.  I set it to every hour.

There’s also info in the book on checking the reports on “Available updates” regularly.  I’m okay at this point, everything up to date.

Backup

Now comes the backup.  This involves going back to the localhost page and into the phpMyAdmin to find the Export tab.

In the Export box, I select drupal and click the SQL radio button.  I want to save that database I set up back at the start.  Then I want

  • Structure
  • Add IF NOT EXISTS
  • Add AUTO_INCREMENT value
  • Enclose table and field values with backquotes
  • Data
  • Complete inserts
  • Extended inserts
  • Use hexadecimal for BLOB Export type

Then I change it to use zipped compression.  I had to create a new folder in the ones under my name, titled Backups, and then save the resulting localhost.sql.zip file in there.  Using list view, I can see the date of creation, so I know when the file is current.  Then I rename it with the date as part of the name (an easy way to differentiate a lot of files named with “localhost.sql”).

I think it worked.  I’m going to assume it did, rather than testing to destruction and restoring from the backup.  This is just an exercise.  If it were a regular operating web site, though, I’d probably move my existing stuff off somewhere temporarily and try to actually do a restoration.

Updates

Now come updates.  I needed to backup before doing those, anyway.

In Firefox, I add updates.php to the end of the URL and get a Drupal page of instructions on doing that.

Oh… the backup I already did wasn’t enough.  I need to copy the entire Drupal directory to a safe place.  So, I open up the files, do a copy, and put that in the Backups directory I just created, along with the database backup.

Now I put the site in maintenance mode by taking it offline in Administer > Site configuration > Site maintenance and click off-line and save it.  They have a polite little message for anyone who tries to access the site while it is offline, which you can customize.

However, this is just an exercise, and I have nothing to actually update, so I turn it back on again and save the setting.

Making progress, I think.  This is just the dull maintenance side.

 

 

Beginning Drupal, part 1

So, now that I have a Mint Linux installation running off a network drive, I wanted to start learning some of the new web stuff we’re going to be using.  In fact, the entire campus will be using it, so while the Web Librarian gets to do this in detail, I just have to get some basics down so I can backstop him (and in the immortal words of Snoopy, “I hope that an emergency will never occur.”).  Besides, this is a good way to keep my own 20th-century hand in.

First, I’m starting with Drupal, which is, essentially, a system software for setting up well-integrated websites (well, for our purposes, that’s what we needed it to do).  I just need to do this on a local PC for my own practice, not actually have it open on the Internet, so I’m not going to worry much about security while I practice on this (so only do this at home, kids — in the real world, you gotta lock it all up tightly).

Now the apparent method would be to check the Mint Linux Synaptic Package Manager and find the Drupal package, and install it.

But, looking at Drupal for Dummies (Lynn Beighley, 2010), it becomes clear that I need some other stuff first.  Mint doesn’t come with all the necessary web server stuff installed, but then again, why should it?  You only add that if you need it.  Now I do.

Drupal needs, the book says, Apache, MySQL and PHP installed first.  I could do that by just using the Linux package installer, but I could also miss parts of what I need.  Better if I can get a complete package of all of that together (and trust me, I learned the hard way first).

The book recommends XAMPP (formerly LAMPP) from http://www.apachefriends.org/en/xampp.html so I go there using Firefox in Linux (since I’m going to download it to the Linux system anyway).  (If I’d wanted to do it on a Windows system, the book recommends http://www.wampserver.com for WAMP, and there’s a Mac alternative as well.)

Hmmm… XAMPP “distribution for Linux systems (tested for SuSE, RedHat, Mandrake and Debian) contains: Apache, MySQL, PHP & PEAR, Perl, ProFTPD, phpMyAdmin, OpenSSL, GD, Freetype2, libjpeg, libpng, gdbm, zlib, expat, Sablotron, libxml, Ming, Webalizer, pdf class, ncurses, mod_perl, FreeTDS, gettext, mcrypt, mhash, eAccelerator, SQLite and IMAP C-Client.”  That should do it.

Firefox wants to open it with the Archive Manager (since it is a compressed file).  When the download finishes, Archive Manager pops up but it hasn’t got permission to extract it where I need it.  Typical Linux.  Ignore the Archive Manager and just download it.

Instructions are given at the LAMPP site for installation, however.

The file is in /tmp so I open a terminal (you may as well keep it open, too), become su (superuser) and go into the /tmp and tell it:

tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt

to extract to the /opt directory.

I change to the root directory.  Now I use /opt/lampp/lampp start to start the LAMPP installation.

That works.  It starts up several things and finishes.

I open another Firefox tab and send it to http://localhost/ and I get a LAMPP screen.  Looks good.

One of the choices on the LAMPP site is for English, so I click on that.

On the left, a sidebar of operations… and the phpadmin that I need next.  Click on phpadmin.

I have to create a database, so I fill in the name drupal and click on Create for that.  No other changes at this point.  Important detail to note: the username for the database is root@localhost so make a note of all that.

Now, a new Firefox tab and go to drupal.org for the latest version of that.  Turns out to be version 6.19.

Now comes the tricky part.  The book gets extremely vague and says to copy it to “your local Web server directory.”  And to limit the name to just “drupal.”

I’ll save you the trial-and-error.  It goes into /opt/lampp/htdocs and you can use (in Terminal) the move/rename command mv with the before and after versions of the name: mv drupal-6.19 drupal.  (You are still in su mode, right?)

(I haven’t worked so heavily with operating system commands since I got past Windows 95.  Just keep the Terminal program open through all this.)

Following that, you can use Firefox to go to http://localhost/drupal and get the Drupal install screen.

“Install Drupal in English”.  Sounds simple enough.  Nope — too simple.  I’ll give the trial-and-error here, finishing with the solution.

It first wants me to get back into the /opt/lampp/htdocs/drupal/sites/default directory and rename a file: mv default.settings.php settings.php so Drupal has some starter settings to use.

Still not cooperating.  Change the permissions: chmod o+w settings.php so anyone can change it.  This is the command in the install.txt file that came with Drupal.  So I go back through all the directories and subdirectories, just in case, and do the chmod o+w for all of them.

Now it shows a screen for “Database configuration” and I enter the drupal name that I created earlier.  The username is root and the password is blank.  (Yes, not good security, but this is only for my training on this and not for general Internet consumption.)

And… it won’t accept it.  The advanced options just has the host name which is, of course, localhost.  The username will not accept anything with a @ symbol so that’s out.  The link for XAMPP to MySQL documentation (which is what the book refers me to) is broken.  <sigh>

I checked the web, and found that in an older version of Drupal, the kink was in the settings.php file.  Some people just changed the link info for the database in that file.

However, I checked the install.txt file in the drupal directory.  It talked about renaming the default.settings.php file — but it also offered the option to simply create a blank file of the proper name.

Solution: So, I created an empty file in the right place named settings.php and gave it a chmod 777 settings.php to open up permissions.

Then I tried to do the “Database configuration”.  It worked.  Go figure.  Apparently, it just needed to do its own thing with that settings file without any previous guessing.  It couldn’t create the file, but it could fill it in after that.

Now I got to “Configure site”.  The book says change the localhost name to a title that makes sense for your current site.  I used (of course!) OverautomatedLibrarian.  (I wasn’t sure if it would take a space or a hyphen, and at this point, I just wanted to get past the hurdle.)

I entered an email address, set an administrator name and password, checked the time zone, made sure Clean URLS and update notification were both on.

I got a configuration complete message with a pink warning that it could not send emails.  Might be something with being run in VirtualBox?

Now http://localhost/drupal gets me my new site with “OverautomatedLibrarian” displayed at the top.  I’m finally up to Chapter 3 in Drupal for Dummies.

Whew!  Shadrach, Meshach, and Tobedwego….

Virtual Linux via Network drive

If at first you don’t continue to succeed…

Security on the network has now tightened up so you can’t run much of anything not usually seen off a USB flash drive (and Portable VirtualBox is not usually seen, apparently).  Probably due to fear of viruses, which is a very real threat (especially on a campus), but it really defeats my attempt to run Linux off a flash drive on any campus computer.  In fact, it trashes the installation on the flash drive every time, and I have to reinstall Portable VirtualBox from scratch each time.

This is the HIPS detection on Sophos, and it finds the Portable VirtualBox is a “suspicious” activity.  There is no choice offered to proceed anyway; it quarantines a crucial part of the Portable VirtualBox.

The security is controlled by standard settings on the Windows network in my network group, and I cannot change or override group settings.  There seems to be no interest in changing them to accomodate this sort of thing, at this time.

I could do Linux on just one computer, but that limits where and when I do it severely.  It also means that if I want Linux on several PCs so I can work on this in my spare moments (if I ever have one), I would spent a horrendous amount of time doing updates on the various installations, and trying to keep everything in sync.  So…..

Adopt, adapt, improve, as the motto goes.  How do I follow the rules while creating only one virtual installation of Linux?

We have a network drive for the library — part of one, anyway.  It’s designated the “N” drive.

I have my little subdirectory on it, and that is divided into smaller directories, so make one of those “linux”.  I copy Mint version 9 and VirtualBox into that.

Can’t run VirtualBox directly from that. Hmmm…

Okay, install VirtualBox on the PC, and just use the N drive for the Linux.  It’s the Linux stuff that needs all the updates, anyway.

Once VirtualBox is up, I go into the List drop down menu, and select Preferences and the General tab.

I set the Default Hard Disk Folder and the Default Machine Folder to my subdirectory on the N drive, and for the Mint 9 installation, I share that directory just to be sure.

Now, normally the Hard Disk and Machine folders are under C:\Documents and Settings\mylogin in a .VirtualBox folder, but if I can put them on the N drive on the network, and then get any VirtualBox installed on a PC to point to that same one, I should only have one Linux Mint installation, and one place to update, and that avoids having to keep multiple installations in sync.

It’s not as good as a virtual Linux I can take back & forth between home and work, but at present, it seems about as good as I’m going to get within the limits of network security.

Understand — I’m all for network security, but it’s a headache at times trying to get your work done while fending off the bad guys.  This time I think I’ve managed a perfectly legal work-around while keeping totally secure.  I can’t access the N drive from home, but I’ll just have to do without, unless I can cook up something else.

The installation is starting to feel like it’s almost routine.  Install the Linux Mint 9, then up to VirtualBox for the Devices drop down menu to get the Guest Additions, then reboot, the Guest Additions show up on the desktop.

Open Terminal, type su and give the password, cd / and then dir and the Guest Additions are in the Media directory.  Change to that, burrow down, and sh VBoxLinuxAdditions-x86.run to install.

That finishes, close Terminal, reboot.

Machine drop down menu, Adjust Window Size, the window shrinks, click on full size, it expands and I have a full screen VirtualBox window with the maximum Linux Mint in it.

Big advantage is, I freely admit, the whole thing runs a lot faster off a hard disk than it did from the flash drive.

Another thing I’ve learned is that doing all the Linux updates at once make it more likely to crash.  So, I do all the #1s, and then the 2s, and then take the others in chunks of up to a dozen at a time, but no more.  Takes a while, but not as long as having to restart after a crash time and again.

Now — how do I connect to this from another PC?

Installed VirtualBox (same version) on another PC, same settings.  I set all the right paths, but it seems I still need to set up a “new” virtual machine.

So, I open one up with the same name.  It has the “install” icon.  Hmmm…

Can I get there from here?

* Click on the Computer icon on the desktop, and get two file systems — one for the existing one I did on the other PC, and one generic.  I right-click on the existing one and mount it.  I leave it mounted.

Then I reboot.

Ta da!  It comes up on the existing Mint 9 Linux I created on the other PC.

The one catch is that I can reboot and have it come up, but if I shut down completely, I have to go through the steps from the * above on down all over again.  However, updates and such are retained, as far as I can tell at this point.

On returning to the original PC, it still starts up Linux Mint without the extra step of mounting it.  All updates are installed and all seems good.

Now I have access from two PCs to a single installation of Linux Mint, using VirtualBox installed on both PCs.

And I am still within the security limits set by the campus network without bending a single rule.

Good to go.

 

Virtually Portable Linux – part 2

“Nothing is simple, nothing is easy, and nothing ever works right the first time.” — Dennis’ Corollary to Murphy’s Law.  Allow for it and proceed anyway.

Okay, taking a whole new run at this one.

First, I had a disagreement with the latest upgrade to our campus security software (it flagged the portable VBox as “suspicious activity” and quarantined it) and had to work around that.

Then the flash drive I used first developed a flaw, so while I work that out (probably by reformatting it), I switched to another brand 16GB drive, again a higher-priced one (and therefore, I’m hoping, higher speed).

Since Mint 9 was now out, I decided to use that instead.

Same procedure, install the portable VirtualBox, then install the Mint Linux distro.  Marched along pretty well.

It reboots, but won’t acknowledge the VBoxGuestAdditions anywhere even through I used VirtualBox to install them (and it shows a check by them in the CD/DVD list dropdown menu for VBox), so I shut Linux down completely.

I took the extra precaution of Sharing the entire flash drive as a folder.

Restarted the Linux Mint.

Now the VBoxGuestAdditions link is there.

I clicked on the Menu in the bottom toolbar, and opened Terminal.

su to become superuser

change directory to the / base, and do a dir and see “media” so change to that.

The options are different: floppy, floppy0, and the VBoxAdditions, so I change to the VBoxAdditions directory and use the command:

sh VBoxLinuxAdditions-x86.run

And we’re off again installing that.  Just a reboot inside Linux, and we now have a mouse that works with both Windows and Linux without “switching”.

But the Linux Window won’t fill in completely — it’s mostly another program view.  Reboot.

Okay, takes some click-&-dragging, but I get the full window while maintaining my Windows bar at the bottom of the screen, and have the VBox window inside that, and the Linux Mint inside that.

The update is a little shield that says I have 66 updates (well, it’s a pretty new distro) and with just a click and a password it goes off to handle it.  Pretty slick, almost up to Windows ease on that.

Oh, it now says 153 updates.  Ah, well.  Click on Install.  And it’s off to download and install.

There’s a very noticeable delay in switching into the Linux Mint window (the frame appears, but fills in after a bit).  Going to anything else is normal.  I’m guessing it’s the flash drive access speed.

Mint comes with a lot of stuff already installed, so that has to be updated along with everything else.  However, it does save on having to go get it, and it all shows up in the Mint menu system, which is pretty good.

While I’m waiting, I change the screensaver time to a hour, and change the screensaver image (the torus).

I end up with a fully functional (AFAICanTell) Mint Linux virtual machine.

Virtually Portable Linux – part 1

Trying something new to experiment with Linux.

I wanted something I could use wherever I was, and add to as needed.

I started with a Windows XP computer, 32-bit.

I bought a 16GB USB flash drive (one of the better ones, normally $80 but on sale for $39.95) which should be fast enough to be bearable, or so I hope.  (The cheaper drives use slower memory once you get over 4GB, so I wanted to use a better drive for something this large.)

I removed the U3 stuff to get the maximum space.  I checked to make sure it was formatted to FAT32, as this seems to be safer than NTFS with the various distros of Linux.

Then I went hunting, and turned up a portable version of VirtualBox.  The instructions were at MakeTechEasier.  The actual, unofficial portable version was here.

The instructions were pretty decent, although not quite in sync with the latest version.  I downloaded the install file, set it to get the 32-bit and 64-bit versions, and compress the installation files.  It does take a while, and even when it looks done, it still shows a box telling you it’s doing something.  Turns out it was setting up the files, extracting and compressing them.  It took a while, but I continued to see my flash drive light blinking, and the sign remained visible onscreen indicating it was working.

I ended up with my F: drive (the USB flash drive) showing a list inside the folder for F:\Portable-VirtualBox:

screenshot of my USB drive

screenshot of USB drive

I clicked on Portable-VirtualBox.exe and got the normal VirtualBox screen.

Cool enough.

Now, I needed to pick a Linux distro (short for “distribution”, a flavor of Linux to use).  I’ve been seeing good things about a variation of Ubuntu with all the most useful add-ons already installed, called Mint, so I thought I’d try that one for starters.  Having already spent a lot of time downloading, upgrading, and installing stuff for Fedora, I was ready for something a little easier, please.

I downloaded the LinuxMint version 8 code named “Helena” (apparently Ubuntu has a thing for animal code names, and Mint went for a feminine moniker: “always female names ending with “a”.”).  This was an “.iso” file which is the standard basis for a single file to install a Linux distro.

I went with the Main edition (for 32-bit systems in the USA).  I didn’t want to be limited to running this on just a 64-bit system, although there is an optional version optimized for that.

I also first copied the PDF manual for Mint to the flash drive, to have it handy.  Plus, it gave me something to read while waiting for the big .iso file to download.  It was 704, 662 KB.

Now, to set up inside VirtualBox.  Inside VirtualBox, I clicked on the blue New sun, selected Linux as the operating system I wanted to install, and hit my first snag.  No Mint.  It was supposed to be like Ubuntu, but I didn’t want to hit any snags that might arise if something was looking for a hook named Ubuntu and it wasn’t there, so I picked “Other Linux.”

I allowed for 512MB of memory and set it to create a new hard disk with dynamically expanding storage.  I allowed for 8GB for the virtual hard drive, which would be on the USB flash drive:

F:\Portable-VirtualBox\data\.VirtualBox\HardDisks\Mint8.vdi

This basically sets up a virtual hard drive using part of the storage on the flash drive, and installs the Mint Linux on it in condition to run through VirtualBox.

Once this was completed, VirtualBox showed me a layout of the settings for Mint inside VirtualBox.    I changed to enable the 3D acceleration.

Started my new installation, entitled Mint8.

A wizard kicked in, to install the system.  It wanted installation media, and assumed I was using my D: drive for a disc.  Nope — browsed for the F: drive and the .iso file instead.

Some flashes of code, some screens, and Mint is up.  There’s a nice clear Install Linux Mint 8 icon.

VirtualBox requires you to let the mouse be “captured” in the VirtualBox operating system so it can “see” the mouse, react to clicks, etc.  Right CTRL button gets you in and out of it (there’s a reminder in the lower right corner of the VirtualBox screen about this).  I allow the mouse to be “captured” and start the process.

There’s a wizard for the installation, and I follow along with that.  Had to change the time zone from Eastern to Central.  Accepted the standard keyboard layout.

There’s the scary part here where it says “this computer has no operating systems on it” and wants to “erase and use the entire hard disk” but it just means it can’t find another operating system on my flash drive, and will only use the VirtualBox 8GB drive I’ve allotted to it already (check the size of the hard drive shown to confirm).

I put in my name, a password, and rename the computer to use “flashdrive” instead of “computer”.

Working, working.  Shows some screens boasting about Linux Mint.  Claims to not need anti-virus/anti-spyware, which I don’t believe — Linux is just less of a target because there’s less of it, so hackers focus on more popular systems like Windows and the Mac OS.

Still, a cheerful, confident attitude as it goes along setting up the drive for itself.

Since I’m putting this on the flash drive, I didn’t need to go through the hassle of partitioning my C: drive or anything like that, as outlined in the Mint manual to allow co-existing operating systems.

This part is slow, but I do get a progress line and percentage amount.  “The installation should take between 10 and 15 minutes.”  Well, maybe for some, but not in my case.  More like 45 minutes.

Reboots, and there we are.  Now, I need to install the VBoxAdditions, so I use the VirtualBox Devices dropdown menu and select to install those.  Mint pops up a question, I tell it to go ahead, and I get the VBoxAdditions icon on the screen.

Right-click on it, open the folder containing it, and right-click to get a list of programs to open it.  Nothing that looks like Terminal so I go down to Use a custom command and try sh VBoxLinuxAdditions-x86.run just for luck.  Nothing happens, as far as I can tell.  Try open with sh and still nothing.

Okay, probably an authorization thing.  Need to become Superuser (= Windows administrator status).  Go down to the bottom of the Mint window, click on the Menu, and get a nice group of choices, including Terminal.

Slightly different from the Fedora sequence.  This time, I use

  • su to become superuser
  • cd / to change directory
  • dir to get a list of directories — ah, there’s media.
  • cd /media
  • dir for a list of directories, and get cdrom, cdrom0, floppy, floppy0 which isn’t too helpful.  I guess.
  • cd cdrom
  • dir and there’s my command.
  • sh VBoxLinuxAdditions-x86.run

and it’s off, installing the additions.

Reboot when that’s done, and this time it says it has no problem with the mouse being used in Windows or Linux without switching.  The Machine dropdown menu for VirtualBox has a resize option, so once I’m logged in and running in Linux, I use that to expand the screen.  I like it so I can still see my Windows taskbar at the bottom of the monitor and the VirtualBox surround window, but otherwise have a full Linux screen.

Now, Mint has a little unlocked padlock in the bottom bar that the manual says indicates updates are available.  Click on that, give my password, and start the updating.  Another long session, I expect.  Oh, good — 239 updates available.  I might save that for later.

The Mint menu is a nice feature.  Lots of stuff pre-installed, too.  Very good organization, overall.

So far, so good.  This seems to work well.  Next, I’ll try the flash drive on a different computer, say my laptop with Linux 64-bit.  Let’s see if that chokes.

Tipping my Fedora, part 3

[updated 2009.6.17]

This is another in a series of posts on my attempt to get acquainted with Fedora on VirtualBox.  YMMV (Your Mileage May Vary), of course.

[The computers are a Windows XP Pro 32-bit (2GB RAM with 512MB assigned to Fedora/VirtualBox) and a Vista 64-bit laptop (4GB RAM with 1GB assigned to Fedora/VirtualBox).]

I’m using the book Fedora 10 and Red Hat Enterprise Linux by Negus and Foster-Johnson [9780470413395] but not the included discs, as I wanted to make sure I had the latest version of Fedora, and I wanted to run it in VirtualBox as a virtual machine, so I could switch back to Windows when needed.  Having a big book on this can be a help in trying to learn a new system, although the variations due to running Fedora inside VirtualBox are not covered.

The book has tips such as:

* double-clicking on a folder to move down to a subfolder, or clicking the folder name at the bottom-left to move up to a parent.  This gives you a menu for selection.  This varies from the little green up-arrow folder in Windows Explorer.

* the “window shade” feature (double-click in the title bar “rolls up” the window instead of maximizing it) needs to be turned on.  System > Preferences > Look and Feel > Windows and in the pop-up, change Maximize to Roll Up. Not a perfectly working gimmick, IMHO.

Screen Resizing

I can log in, and once the Fedora is up, I can use the Auto-Resize Guest Display in VirtualBox (provided I have VirtualBox already set to full screen) to expand Fedora to fit completely inside VirtualBox.  There’s also a full screen option, but it’s easier to switch back to Windows if I just expand to size inside VirtualBox, and that’s enough to get a decent window for Firefox, etc.  (See Part 2 of this series for how that was enabled.)  Mind, it make take several tries to get it to work at times, and you have to have Fedora up for at least 2 or 3 minutes before it seems to want to work.

This also gives me access to the VirtualBox icons at the bottom of the window, which can help when I’m sitting wondering if anything is happening… oh, look, the drive icon is flashing.  Something is still working.  Fedora is not exactly encouraging on a lot of activities, as the little blue circling-around arrow doesn’t always appear for the cursor so you know something is going on.

Media Manipulating

I figured playing a few MP3 files would test the media capabilities… oops.

Fedora, it turns out, can’t do MP3 files.  It’s a matter of licensing.  So, I looked for and found a workaround called Fluendo and installed it, by downloading it (in Fedora using Firefox) and opening it, giving the root password several times in the process, and it installed.  Doing workarounds like this is something I expected, although not for something I had considered this basic (MP3 files).

Then I used Firefox to download some free MP3 files as samples and tried them out by importing them to Fedora’s Rhythmbox music player (which couldn’t handle MP3s before Fluendo).  Worked fine.  (I did this mostly just to see if I could get the connection to the sound card even through VirtualBox.)

The holders of the patent on the MP3 format wanted about 7 1/2 cents (according to the book) per system using this, and Red Hat decided not to include it (well, a lot of people just try Fedora out, much as I’m doing).  Makes sense.  Fluendo, however, legally has an unlimited MP3 license, so this stays within the law.  It’s free; you just can’t redistribute it.

(There’s actually a page in the Fedora wiki on “forbidden items.”  It includes commercial DVDs, since the format for commercial DVD discs is a patented one, so you may not see a lot of movies on Fedora machines without getting some extra software from somewhere — a popular source is rpm.livna.org .)

Terminal

I figured out — even before the book suggested it — that I needed to put an icon for the terminal function on the desktop.

Since Linux systems are aimed at multiple users, you log in as yourself, but often need to become root — the superuser (system administrator) to do certain things.  (I am Root, see me type.)

In the terminal panel, you get a prompt for you as user.  Type su – and enter (the hyphen added puts you in the root directory to begin).  The prompt will change and now you can install stuff, make changes, etc., that you were forbidden to do under your regular login.  Since you (supposedly) set your root password during the setup I described in earlier posts, you are better protected from malware, while using your regular login abilities, which might try to plant viruses, etc.  It does not make you immune to viruses and such; it just makes it harder than usual for the bad guys.

Of course, it also makes it more of an effort to install stuff, but that’s the tradeoff.

Tipping My Fedora, part 2

[last updated 2009.6.7]

I’ve come to the conclusion that one of the biggest obstacles in this Linux endeavor is the fact that I’m doing it over and over, trying to describe the steps each time, and each time I lead up to a Fedora that no longer will load, I have to start over and create a whole new virtual machine.  But some files may be updated, and therefore it may behave differently the next time.

Maybe that explains (in part) why, when I try to get advice from forums, the posts there always seem to skip steps.  After you go through something often enough, it’s certainly easy to leave out steps you’ve gone through before without remembering that others haven’t gone through them yet.

I’ll try to avoid skipping steps here.  I hope.  But I will skip a LOT of attempts to get things to work.

BTW: my work system is a Dell Optiplex 745 running Windows XP Pro on 2GB of RAM.  My personal laptop is Windows Vista 64-bit on 4GB of RAM.

In our last thrilling episode, I created a virtual machine in VirtualBox with Fedora 10.  The next step is to be able to control the resolution in Fedora 10 inside VirtualBox.  Better yet, to optimize Fedora to run in VirtualBox.

VBoxAdditions … eventually

Based on experience in several attempts at this, I went to the Applications dropdown menu, selected System Tools, and right-clicked on Terminal.  I chose to send a link for this to the desktop.  Believe me, you’re going to need to use Terminal a lot, and this is more convenient than digging down through the menus to load it each time.

The screen was still limited to 800×600 maximum.  Needed to find a fix for that.  Should be simple, right?  NOT.  There are a lot of people making suggestions in the VirtualBox forum.  None of them worked for me, and some of them locked up the Fedora so it wouldn’t boot up.  I had to delete it and reinstall it.  Several rounds of this ensued.

Loading packages into Fedora

I will consolidate and condense the advice that actually did work for me here:

  1. Load Terminal
  2. type su – (this will turn you into the root user, and the hyphen puts you in the root directory)
  3. type yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel (this runs installations on a number of packages)

I got a Fedora popup about updates right after this. I approved it to install all updates.  There were a number of them, so I let it go a while and watched the little blinker dot on the VirtualBox hard drive icon flickering at me, sometimes orange, sometimes green, which probably means something for each color.

During this, there is a little open box with a green down arrow at the top next to the double-terminal icon for network activity, which indicates that downloading is going on, at least.  Then the box finally changes to a page in front of the open box, while it tests the changes.  Then comes a plus sign alternating with circular arrows while it does the actual installing.  Certainly resembles Windows in that it takes a while to do updates.  Go eat lunch.  A big lunch.  With dessert.  And gas up your vehicle while you’re at it.  Maybe change the oil, too.

While I waited for all that, I used the System > Preferences > Look and Feel > Screensaver to set it to 30 minutes and not lock me out.  10 minutes default isn’t much time, especially while you’re waiting for updates.

I also tried something from the book, which is to right-click on the top toolbar, and select Add to panel.  I picked a Drawer to add, and then right-clicked on the narrow little thing’s properties so I could widen it out some.  I put on some widgets: a system load indicator (now I had that CPU activity meter!), sticky notes, and a shutdown button.  I added a weather widget to the bar itself.  Now I could open a drawer and use the widgets in there.  Just a slightly different way to get handy widgets out there.

Finally I get a completed message for the updates and the open box disappears.

Now I open the terminal again and — glutton for punishment that I am — I became root again and typed yum update just be sure.  I got “another app is currently holding the yum lock” and after repeating that multiple times, it finally got to check.  Everything is updated.

Installing the VBOXADDITIONS

Now the best advice I found says “By then it’s time for another run at that install script: [root@fedoravm VBOXADDITIONS_2.2.0_45846]# sh VBoxLinuxAdditions-x86.run – which should run smoothly now, install all the guest additions” — only what does that mean?   (Aside from the minor difference in VirtualBox versions, that is.)

It looks like root (judging by the root prompt of #) is inside the directory.  This is the kind of thing that makes Linux harder than it has to be — the advice skipped steps here.

Okay, right-click on the desktop icon for VBOXADDITIONS and look inside it with “browse folder”.  Aha!  There’s the VBoxLinuxAdditions-x86.run file.  Now I need to get to it inside the Terminal function as root.

Used the “up” green arrow in the browse function until I got up to a batch of folders, starting with “bin” and going on.  Okay, this is main directory stuff in Linux.  There’s the “Media” directory and the VBoxLinuxAdditions-x86.run file is in that.

Now that I know that, I can use Terminal and become root with privileges to run it.

  1. Okay, log into Terminal.
  2. Type su without the hyphen, to become root without being in the root directory — I won’t stay there anyway.
  3. Type cd / to get to the main directory.  (Well, it used to work in DOS to change directories.  Seems to work here also.)
  4. Type dir to see the subdirectories folders.  (Another old DOS command.)
  5. There’s the “media” folder.  Type cd media to get into that folder.
  6. Type dir and there’s the folder contents.
  7. Type cd VBOXADDITIONS_2.2.4_47978 to get into that folder.
  8. Type dir and there it is, listed with the other files.
  9. Type sh VBoxLinuxAdditions-x86.run
  10. it runs!

And now it wants to restart.  Whew!  I do a full shutdown.  Restarts are not a safe bet.

Please note that you were not party to a LOT of attempts to get something else to work, before I found this advice.  And even then, it did not tell me how to get to the file in order to run it as root.

Success So Far

This time when I boot, I get a message that the guest OS supports mouse pointer integration and it doesn’t need to capture the mouse anymore, just use it over the Fedora panel.  Oh, joy!  Big improvement there, believe me, not having to swap back and forth.

Oh, and the time is correct in the top toolbar.  That bodes well.

And CTRL-F lets the Fedora FINALLY go to full screen mode, and toggle back and forth (you can’t switch to Windows while in full screen).  All the functions under Machine dropdown menu in VirtualBox now appear to be working.

Looks nice, and windows for stuff like Firefox finally allow the full width of the screen.

And it only took me… was it 10 or 11 attempts? — to get Fedora 10 to run properly in VirtualBox 2.2.4.  I hope it gets easier from here.

I took my notes home and tried it on my Vista 64-bit laptop system.  It worked there, too.  Due to the wide screen, I had to adjust the Firefox window a bit, but it worked properly.

So, it seems I can actually run a virtual machine for Fedora 10 inside VirtualBox on my XP Pro and Vista 64-bit systems.  At least, the basics seem to work.

Tipping my Fedora, part 1

[last updated 2009.6.7]

So, we’re planning to move our library web site onto a Linux server on the campus system (long story omitted, for which all should be grateful).

Finally I have a practical reason to learn Linux.  The question is, do I enjoy or dread it?  I’d like to like it, really.

First, bear in mind that I started out (way back in the ’80s) with a Radio Shack Model 3, upgraded it to a Model 4, and then moved to a 80286 and MS-DOS, Radio Shack Xenix, Windows 3.1, and onwards.  The point being, I started with text-based operating systems, so it’s not a matter of avoiding them just because I can’t do everything with a mouse.

And Linux, at this point, is still very text-based because you seem to need to do some kind of typed instruction or file editing every time you want to do just about anything, including even the basic setup.

As a number of bloggers and columnists have commented, this kind of technical tweaking is a big barrier to acceptance of Linux by the general computer-using public.  Granted, it allows versatility, but most people don’t want to bother with that.  I’ve kind of gotten out of the habit of most of it, myself.

Special note: I’m going to skip a lot (a LOT) of the trial and error that went into this and just cover what actually worked in the end… mostly.  That will save a lot of space, believe me.  I’m also omitting all the “capture” dialogs when I go in and out of VirtualBox/Fedora back and forth to Windows.

Picking the distro

Linux comes in distributions, which are commonly called “distros” (not to be confused with “discos”).  The campus will use Red Hat Enterprise Linux, which is a “pay” distro, for the web site.

However, Red Hat set up an interesting system some time ago.  They took the Fedora distro of Linux and let it be available for free, and when people developed and tested out enough new good stuff on Fedora, Red Hat moved it into the next version of Enterprise.  Very enterprising of them, even if I do pun that myself.

So, to get more familiar with Red Hat Enterprise, I can just use Fedora for free.  In fact, the book I got to help is Fedora 10 and Red Hat Enterprise Linux Bible by Negus and Foster-Johnson (9780470413395).

VirtualBox for a Virtual Machine

However, I was a little wary of dual-booting using my work PC (Windows XP Pro) or even my laptop (Windows Vista 64-bit), because I would need to switch operating systems about 15 or 20 times a day at work (I get a lot of rush interruptions, like the rest of our staff).  I had to be able to switch back to Windows to use programs there (many of them not compatible with Linux).

So, I decided to try using VirtualBox to create a “virtual” machine on each computer and then installing Fedora inside that.  That, of course, creates a separate set of problems and fixes, but that should be interesting.

I did look at some other virtual systems, but this was the one that seemed to have the most functionality with “guest” OS (operating system) while handling various systems on various host systems.

Off we go….

Downloads

First, I got the latest distro of Fedora, which turned out to be version 10.

Now, Fedora comes with either a Gnome (default) or a KDE graphic interface.  Pick one.  Or, pick both and try them both as separate installations.  I don’t know yet which one will be on the campus server, but I’m not sure it matters all that much for what we’ll be doing to manage the web site.

I created a folder in Windows for all the Linux stuff, and started downloading.

Downloaded the stock version of Fedora, which apparently uses Gnome.  This is freeware.  I had the option to get the version with the KDE interface, and I got that on my laptop at home, just to see the differences.

I also got the freeware for VirtualBox which allows me to run other operating systems (such as Windows or Linux) like a program inside Windows.  (You can also run Windows inside Linux, but that’s not relevant to my situation.)  You can set up several different virtual “machines” and start up whichever one you choose — say, have both Gnome and KDE versions of Fedora, a copy of Ubuntu, a beta version of some new system, etc.

Initial Setup for Fedora in VirtualBox

I loaded VirtualBox (version 2.2.4) and it showed a window with a “new” blue sun (well, it’s a Sun product).   This lets you set up the virtual machine for each system.

I set it up by naming my new virtual machine “fedora 10” and giving it 512MB of memory to work with (out of my 2GB, so that’s 25% of my memory and still more than the minimum of 256MB recommended by default).

I pointed the CD/ROM to the F10-i686-Live.iso file  (to start with) to use.

I set a shared file pointing to the directories where I keep some HTML files, so I could use them in the browser in Fedora, and the Linux downloads, and I set a USB device filter up so it would detect my printer on a USB port.

I also set it up with an “expanding” default space of 8GB to start, so anything I added or changed would have room to be saved.

Once I had that, I used the green arrow “start” button.  Things progressed.  Patience was certainly required; sometimes there are long pauses with little or no activity shown in the VirtualBox “guest OS” window.  I sat there wondering if the program had locked up or what, and then something would happen…  but the little icon for the drive activity (a single CD) kept blinking at me every little bit, so I kept waiting.  (There’s also a little blue spinning arrow around the cursor some of the time, which may or may not be visible depending on the type of action.)

BTW (By The Way): the virtual machine shows up as a window inside the VirtualBox window, and while you can enlarge the VirtualBox to full screen, the virtual machine window of Fedora stays at 800×600 by default.  There is a “resize” option in VirtualBox but that just reduces the VirtualBox to fit around the 800×600 panel.  The “Auto-resize guest display” function in VirtualBox is grayed out at this point.  There’s supposed to be a way around this — more later.

The initial login is “automatic” so I did that, and Fedora loaded, using the .iso (“Live”) file to run.

Now I had a nice 800×600 window with Fedora inside VirtualBox.  VirtualBox has something in the icons along the bottom of the window for the USB (which says the printer is on that) and a file folder (which says the shared files I set up are there).

Whenever I clicked inside the Fedora window, I got a little popup from VirtualBox saying that Fedora could capture the cursor/keyboard action for use in Fedora, and I could swap in and out of that using the right CTRL key.  When I approved that, I could work in Fedora.  I could get out by hitting the right CTRL key again.

Fedora 10 has the taskbar at the top with Applications  Places  System and the Firefox button and one for the mail/calendar app provided.  Fedora 10 with Gnome comes with a nice little batch of basic application software like Firefox and ABI Word and such.

In the “panel” (Microsoft doesn’t like you to say “window” when it’s not in Windows, apparently — but at least Linux didn’t elect to call them “doors”) below, are icons for Computer, liveuser’s Home, Trash, and an opened box with a disc saying Install to Hard Drive.  For starters, I am simply “liveuser”.

The “install to hard drive” function lets Fedora (inside VirtualBox) set up a space on my hard drive so Fedora runs faster from that and I can do some long-term work that gets saved.   I started with that and doubleclicked.

Little green dot flashes on the single CD icon at the bottom of the VirtualBox window.  Got a big white box with a small Fedora graphic and a Next button.  Clicked on that.  Got to select my language (U.S. English, as opposed to U.S. International or United Kingdom).  Got to choose a host name, and the default was localhost.localdomain, so I went with that.  Select a city for time zone — but nothing in a lot of states in the middle of the U.S., so I ended up with Chicago as being in the same time zone as Arkansas, at least.

Root password was next, so I set that.  Very important, as I was going to need to do a lot of stuff as root.  Warned my choice was “weak” but stuck with it.

Next I got a scary warning:

The partition table on device sda (ATA VBOX HARDDISK 8189 MB) was unreadable.

To create new partitions it must be initialized, causing the loss of ALL DATA on this drive.

This operation will override any previous installation choices about which about which drives to ignore.

Would you like to initialize this drive, erasing ALL DATA?

Very nice — obscure, confusing, and scary, all in one.  Went to the VirtualBox forum, and finally learned that all this does is format the one little spot you already reserved, and not your entire hard drive.  Given that Fedora doesn’t “know” it’s running in VirtualBox, it also doesn’t “know” that it’s only formatting that one little spot only, rather than setting up a normal boot.  I can cut it some slack on that, but it’s nerve-wracking the first time.  I thought that’s what it meant, but I wasn’t eager to find out that I had guessed wrong.

I told it Yes, and it then moved to another screen about partitioning the hard drive.  I didn’t change anything, but I did check the Review and modify partitioning layout box so I could doublecheck on what was being done.  Yes, just the one little spot being done, according to the layout screen — under 8GB.

Another warning, and then an install boot loader option, which I left in place.  Approved that and moved on.  Another option about replacing files, and approved that (the default was to stop, but I changed it).

Copying live image to hard drive was shown, and the blue line crawled slowly across to mark progress while the little blue arrow circled around the cursor.  Don’t plan on doing much while this is going on, but you only do it once per virtual machine.

Finished up and displayed a congrats screen and told me to reboot the system.  That only means rebooting the virtual machine, not the entire PC.

Went back to the Fedora desktop, and System dropdown menu, and selected Shutdown (not Restart – I needed to change something in VirtualBox) and went through those steps.

Fedora 10 showed up as “powered off” in VirtualBox, so I changed the CDROM in the VirtualBox Settings (that’s why I shutdown rather than restarted) to use the Host CD and checked the “Passthrough” box, using the E: drive (not the D, which would be my hardware CD drive) and then started Fedora 10 again.  You don’t want to use the same .iso file as before since that is for a “Live” version, and you are running on the virtual E: hard drive now.

This time the little VirtualBox icon that looks like a stack of CDs indicating the virtual hard disk was the one with the blinking green dot activity.

Welcome screen, ready to finish the setup.  It wanted to create a standard user and password, for when I didn’t need the extended authorizations of root.  I set up a login for that.

Time and date came next, and I set the time.  It then asked permission to send info on my PC’s configuration to Fedora, and I agreed (nothing confidential in there — I checked).

Now it showed a login for the user I’d just created, and “Other”.

After logging in as my regular user, I got the desktop, but now my user name was on the Home icon.

Now I went up to the Devices menu in VirtualBox and clicked on Install Guest Additions and it told me the software should be automatically started, and asked if I wanted to run it.  I approved.  It installed the VirtualBox Guest Additions and now in the VirtualBox window it showed that .iso file as the CD/DVD-ROM image (instead of the E: drive).

That created a desktop icon with a CD graphic labeled VBOXADDITIONS_2.2.4_47978 .  That showed I was using the VBoxGuest Additions for this release of VirtualBox, which made it more compatible with use in VirtualBox (I certainly hoped).

I checked System and printers — and no printer.  It searched and didn’t find it.  I turned my printer off and back on, and got a Windows popup for the VirtualBox USB to be installed, so I installed it.

Shutdown Fedora, and start it again — this time with the printer showing in the VirtualBox USB icon.

System > Administration > Printing and install a printer.  Looked for and found my Canon inkjet.

Now, Linux apparently has some trouble here, as a lot of manufacturers haven’t bothered to create printer drivers for Linux.  I did some checking, and the one for a printer can be found at the Linux Foundation site search box.  The one for my Canon i560 was called bj8pa06n.upp (well, that’s certainly descriptive…NOT) which is described as “a set of UPP files for the Canon BJC-8200 which comes with Ghostscript 6.50 or newer”.  I looked for the BJC-8200 in the list instead and used that one, and did a test print.  Seemed to work fine, so I went with that.

Still stuck at 800×600 resolution.  That’s next.