Saturday, September 27, 2008

Testing...

I've noticed it's not so easy to post videos here on facebook (this blog is being ported to facebook) so I am wondering if videos post through this blog on the notes page - like this one made from the last thanksgiving beach blast....





And I have noticed that gifs (animated pictures) don't seem to work - but I wonder if the monkey one does....

Sunday, November 18, 2007

Boot Ubuntu from Floppy/ Fix Windows MBR

If you live in a Windows only household with non-technical users and you have been held back from doing a dual install Linux/ Windows system by the fact that most Linux OS's, and Ubuntu in particular, changes the boot process thereby causing a potential uproar in the house, then this blog is for you! Faced with this situation I found by combining instructions from several different sources and simple head exploding trial and error how to create a system with Ubuntu and Windows that maintains the Windows boot process and uses a floppy to boot into Ubuntu and a frugal install of Puppy Linux 301 - 3 OS's to choose from!

This blog is part 2 of my previous blog which details how to install Ubuntu as a second OS using GParted to manually create partitions. However, it is applicable in any situation that uses GRUB as a bootloader, since essentially I am just putting the Windows MBR back and running GRUB from a floppy. In addition to having Ubuntu already installed you will also need mbrfix, a very useful little Windows utility that can be placed on a floppy and used to fix the MBR. Detailed instructions are provided with the program.

So we start from the install of Ubuntu in addition to XP which has GRUB loaded at boot. Boot into Ubuntu (or just let it do so automatically) and follow the instructions to make a GRUB boot floppy (taken from here):

To keep from having to type sudo over and over, in the terminal type:

sudo -s

and enter your password. Now format the floppy:

mke2fs /dev/fd0

Now mount the floppy and copy the necessary files:

mount /dev/fd0 /media/floppy (note: there is a space between fd0 and /media)
mkdir /media/floppy/boot
mkdir /media/floppy/boot/grub
cd /boot/grub
cp stage1 stage2 menu.lst /media/floppy/boot/grub
umount /dev/fd0

Now start GRUB in interactive mode by typing

grub

and the command prompt should change to 'grub>' after which you type the following commands:

device (fd0) /dev/fd0
root (fd0) (note - I get an error message the first time I type this but it works fine if I repeat it)
setup (fd0)
quit

Now you have a bootable floppy. However, this did not work for me without a couple of extra steps.

Restart and boot from the floppy. You should see a screen exactly like you were booting from the hard drive, with a list of OS's and Windows XP at the bottom. Choose the Ubuntu and if it starts then you are good to go. However, I always got an 'error 15 file not found' message. Press any key to continue and then 'c' to go to the command line. Type

find /boot/grub/stage1

one line of output should be the disk - fd(0) - and the other is the partition that your Ubuntu is on, something like (hd0,5); make a note of this for later.

Now take out the disk and poweroff with the power button and then reboot into Ubuntu. Put the floppy back in and open up a terminal and type

sudo -s
mount /dev/fd0 /media/floppy
gedit /media/floppy/boot/grub/menu.lst

This opens up the menu.lst document in the default editor as root, allowing you to make changes. Scroll down to the sections that don't start with #. You'll notice the titles are all the same as those listed on your initial screen when you use GRUB to boot. The first section is the one that you default boot from. Delete the last two lines of the first section:

quiet
single

and then Save. This should alter the menu.lst document on the floppy. To make sure close the terminal, go into the /media/floppy/boot/grub folder from the Places menu and open the menu.lst file by double clicking on it and making sure those two lines are missing.

Now reboot with the floppy in and Viola! it should boot into Ubuntu as if you were booting from the hard drive/ MBR-GRUB.

Finally, reboot into Windows. Run mbrfix.exe in the commandline to replace GRUB with Windows' standard boot code by opening the command window and typing:

cd
Mbrfix /drive 0 fixmbr /yes

This will replace GRUB with the standard Windows Boot code. Now when you boot you will go straight into Windows and the only way to access your Ubuntu/ other linux distros is with the floppy. You now have a hidden Ubuntu OS, since the linux partitions are not visible to Windows without special software.

Monday, November 12, 2007

Using Windows Partitions/Drives in a Linux OS

How to use Windows XP Filesystem in Linux (Kubuntu 7.04 Feisty Fawn)

This is probably the most basic thing to learn if you want to get started using Ubuntu in a dual boot system. If you are having trouble with things like storing documents on a drive that was formatted under Windows or playing music from your Windows drive this will most likely solve your problem. I should have written this down before because it always bites me in the rear when I do a new install and I pull my hair out thinking it is something more complex than it is.

A brief overview of file systems. Your computer stores and retrieves information from a medium like a hard drive or disk using a predefined system of dealing with data, ie a file system. The default system for XP and Vista is NTFS. The default for most Linux Operating Systems is Ext3, and sometimes Ext2. They are pretty much mutually exclusive - Windows does not even acknowledge the existence of an ext3 formatted drive (shows up as unformatted) without special software, and until recently Linux OS's could only read from NTFS and not write to it (ie save stuff to it).

Enter NTFS-3g, a development that has really made dual boot systems usable because it allows a Linux OS to read and write to NTFS so that you can share disk space between Windows and Linux. Therefore you can put music on an NTFS partition and play it from both a Linux and Windows OS, or movies, or pdf files, or whatever.

These instructions are specific to Kubuntu 7.04 but they can be easily tweaked to be used under any Linux OS that uses ntfs-3g.

Install the necessary utilities. In a terminal type:

sudo apt-get install ntfs-config

This will also install a gui that allows you to different choices - you can get specific instructions here(Skip down to the Configuration section).

To see exactly what partitions are available to me I use GParted Partition Manager under Start>System>GNOME Partition Editor, which I describe using in more detail in my blog about setting up a dual boot system. This shows exactly which partitions are there and what file system they are using. This is especially useful if you have two hard drives because it seems Ubuntu only automatically recognizes partitions on the one that it is installed on (hda or sda). Make a note of all the ntfs drives by the name they are associated with - ie sda1 or sda7 or hdb3 (I'll use these as examples earlier). Next you can go to /media and see if those drives are there. If they are you can see if they are mounted by clicking on them and seeing if any files show up. If they are not, ie there are no folders or icons marked hdb3, then open a terminal and type

sudo mkdir /media/hdb3

and one will magically appear!

Now to mount your ntfs drive. BTW 'mount' is linux/unix terminology for making a drive available, so although a drive will show up in GParted, usually as /dev/hdb(N), you cannot access the drive until it is mounted. Mounting a drive transfers the files on the drive to a folder that you can then access. The folder is usually in /mnt or, as in Ubuntu, /media. The command to do this is as follows:

sudo mount -t ntfs-3g /dev/hdb3 /media/hdb3

This will now allow access to the files on /dev/hdb3 to be accessed by clicking on /media/hdb3.

To automatically mount the drives on system start up you can install the automatix package manager and use their tool for automatically mounting ntfs and fat32 drives.

Learning to use Linux is well worth the time and challenge. I recommend using a virtual machine first but moving on to a dual boot system and using Linux with the full power of your machine. I am not one of those people hell bent on taking down Microsoft but I do think it is fun and worth the time to explore different options.

UPDATE (5-12-2008) I now think it is much better to edit the /etc/fstab file, both from a functional standpoint and from a learning perspective. Here is an excellent and informative post. I used the ntfs-config tool initially and then edited the script that generated which led me to the realization that putting tabbed spaces in the script to make everything look pretty was what was causing it to not work for me initially! Gparted was very helpful as well. There seem to be some issues with Automatix being potentially dangerous as well. Here is a very informative blog outlining problems with Automatix.

Tuesday, October 30, 2007

DualBoot Windows XP and Ubuntu 7.04: Manual Partition

There have been a lot of how-to's written about the process of installing ubuntu onto a hard drive 'next to' XP, thus creating what is called a dual boot system. This one documents how I did it, with an emphasis on the process of partitioning, which is a beginner level thing but very important. Linux, and GParted in particular, allows a very advanced ability to partition and repartition your hard drive without destroying data. That being said, you should always back up before doing any kind of partitioning. I use acronis home, but there is a freeware program called <> which I am going to try soon. I also suggest using Mbrfix prior to making any changes in case there is some damage to the master boot record. Mbrfix will come in handy for the second part of this blog as well, wherein I will describe the process of returning the computer to a Windows boot and using a boot floppy to boot Ubuntu. This latter part is fairly unique, I think, and I had to play with the process to get it right because I could not find adequate documentation.

Having backed up your C: drive, it is time to create the partitions necessary for an Ubuntu Linux install. This blog assumes you have been playing with Ubuntu in a virtual machine. I highly suggest getting familiar with it, or another Linux distro, in this manner before making the leap to having it as your 'main' operating system. The advantages to doing this are well documented; I just like trying different things. From the boot up from the Ubuntu Live CD we will be using the Gnome Partition Editor to make the changes, located at System>Administration>GNOME Partition Editor (click on picture for full size image)


NOTE: BEFORE CONTINUING BACKUP YOUR WINDOWS OS AND ANY IMPORTANT DATA. I highly recommend familiarizing yourself and using BartPE, along with the MBRFix and DriveImage XML plugins (MBRFix is not exactly a plugin, rather it is a command line utility that must be run from a Windows environment, ie the BartPE disk). You should do this whether you are dual booting or not. Keeping your system backed up is always a top priority.

Now it is time to partition! You should be looking at something simliar to this:


In the top right corner is a pull down menu that will show all your hard drives, if you have more than one. You can choose by size, or by the fact that your Windows OS will always be on 'a'. In this case, the OS is on /dev/sda - and more specifically in the first partition /dev/sda1. You can see that the second partition is unallocated. I am going to shrink the Windows partition (sda1) and then add it to this one (sda2).

To shrink the existing partition: Highlight /dev/sda1 (or /dev/hda1 on some drives) then choose Resize/Move.


In the middle box enter the new size of the partition in MB, ie I took mine from 29GB, or 29000MB, to 24GB, or 24000 MB. Then click tab and Gparted fills in the next space for you. Click Resize, and then Apply. This operation could take awhile depending on the change in size and your processor speed.

Now, highlight to unallocated partition and Click New. Choose Extended because we are going to partition this little part up for a couple of new Linux OS's and some swap space, which Linux uses if you get low on RAM. Now click on the unallocated area again and choose New. Leave the first number as it is, type 1000 in the middle and then tab to let Ubuntu fill in the rest. Under File System choose linux swap. This sets aside 1GB of swap space for any linux distro that you run.




In the unallocated space left do the same as above, except choose enough space for the Ubuntu install and choose ext 3 for the file system; I chose 20000 (20 GB), and then leave about 10GB unallocated for another project later. You can do all this and then press apply, but I like to have the program do each step because there seem to be less errors that way, so I hit apply each time I make a change.

Now you are ready to install, as long as you have at least backed up your MBR using MBRfix, that is. The install of Ubuntu is going to insert a new "Bootloader" into your MBR, so be aware that upon startup things are going to look differently. This bootloader, called GRUB, will take care of things for you, providing you with a list of available operating systems to choose from: namely Ubuntu and Windows. So, with all that in mind, double click install and start the process. When you get to Prepare Disk Space, choose manual.

Click on the box next to the partition you set aside for Ubuntu, ext 3, and under mount point, choose the back slash.


Skip the "Migrate Docs and Settings", and choose a name and password you will remember. Finally, make sure the numbers correspond to the ones you want to install to (NONE OF THEM SHOULD BE 1; ie, you should not be installing to sda1 or hda1 because this is where your Windows OS is!!!!!)

Now you are ready to go! Install and restart. You will notice the new Boot menu, which gives you a choice of the Ubuntu OS or the Windows one. You can stop here, adding the programs I suggested in a previous blog, or go on to Part 2, where I will describe how to go back to the Windows way of booting up and then boot Ubuntu from a floppy disk.

HAVE FUN!!!!!

Friday, October 26, 2007

OS on a Stick 2: Dressing up USB Puppy 3.01

Part 1: OS on a Stick: Puppy 3.01 on a USB Drive

To really experience the power of Puppy Linux run from a USB drive you need to add some of the great variety of applications that are available. The very first thing I usually do is get Firefox. This package and many others is available here. Scroll down to mozilla firefox 2.0.0.4.pet and download it. I usually put it in /root/mydocuments/tmp. Then just click on it (remember - one click!) and install. To see it in the menu choices go to Menu>Shutdown>RestartJWM. This resets the desktop, which is much faster than completely rebooting. Then you will see an icon for firefox in the Menu>Internet.

Next go here and download the Gslapt Package Manager. As I mentioned earlier, the application availability for Puppy increased exponentially when the developer made it coincide with Slackware. This means that Puppy has all the same basic packages preinstalled as it's linux sibling Slackware, although fundamentally it is a very different OS. Follow the directions in this forum thread, and go ahead and bookmark this forum because most of your questions will be answered here.

Next you can install either the Flash9.pup or the Flash 9 plugin from the gslapt package manager (located in Menu>Setup). The Flash9.pup has been hard to find lately, so I went for the slackware package.

I like to keep track of my CPU use and Gslapt has a version of GKrellM which works nicely. Also, there a lot of themes available to give it a cool look.

Next I got MPlayer from Gslapt, which is a very nice video and music player that plays pretty much every format.

Finally to get the look you want you can download wallpapers to get your own background. Download the picture you want to /usr/share/backgrounds and then go to Menu>Desktop>Puppybackground image and choose which background you want.

Also you may want to put links with icons on your desktop. For firefox get the link from /usr/share/applications. Just drag it from the folder to your desktop then right-click the icon and choose Edit Item then change the name to just Firefox. For something like GkrellM just do a search (Menu>Filesystem>Pfind) and find the icon that when you click on it the program starts (/usr/bin/gkrellm) and drag that to the desktop. Find an icon you like and download a folder you create in /root/mydocuments called icons. If you need edit it to make it about 50px x 50px then do so. Next right-click on the desktop icon you want to change and choose Set Icon. Drag the pic from the folder to the box presented and Viola! you have your cool new icon. Here is a pic of my desktop (click on it to see full size):



There is so much more to this incredible little OS. Soon I will document what is called a 'frugal install', where puppy is installed to your computer's hard drive. The possibilities increase exponentially from there.....

Wednesday, October 24, 2007

OS on a Stick: Puppy 3.01 on a USB Drive

Puppy 3.01 is out and it is quite wonderful. It works better out of the box than any of the other versions and has some really great features, one of which is a compatibility with Slackware, which I will discuss more later.

I wrote previously about using Puppy in a virtual machine, mainly as an ssh server. The very first thing that attracted me to this unique and powerful Linux operating system, however, was it's ability to function off a USB drive, or Flash drive.




A Full Operating System That Fits in Your Hand!!


I would suggest using a virtual machine with a program like VirtualBox first, but once you begin to feel comfortable with it you should definitely try using it off a USB for a totally portable Operating System.

First, download the ISO from here. Virtual machines require the retro version, however the 'normal' version (look for puppy-3.01-seamonkey.iso) works just fine from a USB or LiveCD. Burn it to CD using a program like BurnCDCC, which is recommended on the Puppy download page. You can actually run the OS from this LiveCD, but I have found that it is much more portable off a USB drive. Start up the LiveCD by making sure your BIOS is set to boot from the CDRom. Choose your country's default keyboard and then go ahead and choose XVESA first and then your screen resolution. Once you are 'in' puppy, insert the USB you want to use. Then go to the Menu button in the bottom left (although this menu list can be accessed from anywhere on the desktop with a right click of the mouse) and choose Setup then puppy universal installer:



The first choice is for a Flash Drive, so click OK. Next you should see your usb device name, click ok. Now choose the top right install choice.



Make sure the info in the next box matches the size of your USB device (in MB) then click ok. At this point I usually choose mbr.bin. Like the author of the heading, it has worked consistently for me.



Next just hit OK and then Enter and the process begins!! Once everything is done the CD will usually eject and you will be running from the USB.

Now, the next stage is probably the most important. Go ahead and poweroff (Menu>Shutdown>Poweroff). You will be asked if you want to save a file. Choose yes and then the defaults until you get to the size. At this point consider this:

Puppy's 'C:' drive equivalent, just for illustration's sake because there really is no similiarity, is this pupsave file that you are creating. All the programs that you install and documents that you save within the puppy file system will exist within this directory. However, the actual size of these programs is surprisingly small, and most importantly, the size of the directory can always be expanded, but never reduced. Therefore, I always choose an option that represents about 25% of the drive, ie I use a 2 gig drive so I chose the 512mb option. You will find this to be more than enough. The number of M you see in the bottom right of your screen will represent how much of this memory you have left (until you create a pupsave file it represents the remainder of RAM).

The reason for not taking up your whole drive is the use of SFS files. These are packages that are placed in the 'home' directory - /mnt/home - out of which puppy operates and allow multiple packages to be installed, such as the openoffice.sfs file seen here. The size of the /mnt/home directory is the remainder of the usb drive from whatever you chose as the size for your pupsave file. There is a readme.txt file in the directory linked to above which explains how to use the SFS files. If you have any problems let me know.

Next blog I'm going to go through my favorite programs and tweaks for this Puppy.

Oh yeah - Puppy is very easy to back up! Just copy the pupsave file to another directory on your desktop/laptop - it contains all your settings and installed programs!!

TRY IT! YOU'LL LIKE IT!!

Wednesday, October 17, 2007

VNC over SSH with Ubuntu (or any other OS)

Virtual Network Computing (VNC) allows a user to access his or her desktop from a remote location. It is somewhat analogous to Remote Desktop Computing, available on Windows XP Pro, except that Remote Desktop uses Remote Desktop Protocol (RDP), an encrypted form of information exchange whereas VNC is not encrypted. VNC requires a server on the host machine, ie the desktop being controlled, and client software that is used to access the server. With Ubuntu, the server exists by default. To activate it, go to System->Preferences->Remote Desktop and choose Allow others to view your desktop and Allow others to control your desktop. Since you are going to be at a different location deselect Ask for your confirmation and then select a password to use and close.



To access this VNC server I use TightVNC. Just download the windows viewer, which is a portable executable, i.e. you can take the vncviewer.exe program and put it on a USB drive and it will run from there, or anywhere else independent of your privileges.

The default port to access your desktop is 5900. For information port forwarding and networking with virtual machines, check out my previous blog. It is my understanding that you cannot change the default port used by vino - Ubuntu's default vnc server.

To use VNC: from another computer running windows double click the vncviewer.exe. You can leave the defaults as they are; however, I like to change the default little cursor to an arrow. To do this click on options, then click on the globals tab then under Local cursor shape choose Normal arrow and then OK.



Now it is time to connect to your Ubuntu desktop! NOTE: This is for testing purposes only. VNC is not a secure method of communication, meaning there is no encryption of the data passing from the remote client to the host. Therefore any information passed between the two, such as passwords, could be easily available to some outside interception. This is the reason for using the SSH tunnel to be described next. To connect to your Ubuntu desktop enter it's IP address in the blank field, followed by a colon and then the chosen port. For information about how to find your IP address check out this blog. If you are within the same network as your Ubuntu machine then use the network address, otherwise use the outside address.



You should be presented with a screen asking you for your password, after which you should see your nice shiny remote desktop presented on your screen! The quality of the experience depends heavily on the speed of the connection. With a good network connection I can hardly tell the difference when I'm on my laptop remote computing to my desktop. Now close the vncviewer.

Now to make it secure. I describe setting up Openssh server on Ubuntu here. In order to access the server you need an SSH client. I prefer PortaPutty. This along with tightvnc make a nice little portable package. Open up portaputty and type in your Ubuntu's IP address and port, as well as a name for the session under Saved sessions.



In the left column expand the Connection tab, click on Data, and in the Auto-login username field enter the username you use to login to your Ubuntu OS.



Now expand the SSH tab and click on tunnels. In source port enter the port for your vnc server. In the Destination field enter the IP Address of the server, a colon, and the port of the vnc server then click Add. Make sure the local button is filled. The result should look like this:



Now go back to the Sessions screen and click on Save to save all of these settings with the name you chose. To activate this session just double click the saved name and you will be presented with a command line looking box. Your username will be presented and then you will be asked for your password:



Finally you will be presented with a command prompt. Now you have established a secure, encrypted SSH tunnel through which to pass the VNC session. With the SSH session open, activate vncviewer.exe, but instead of your computer's IP address enter 'localhost', colon, and the port through which you are tunneling.



You should be presented with the same password request as earlier and then your remote desktop. Now you are Virtually Computing securely via an encrypted SSH tunnel!