Archive for July, 2007

Setting languages

I always have to laugh a bit when I see advertisements for computers loaded with Windows that can dual-boot (!) both English and Dutch versions of Windows. One of the greatest advantage of using Xubuntu (or Ubuntu, or whatever) is that it is easy and, no less important, free of charge to use it in different languages. In fact, you can use different languages on a per-account basis!

To set it up, you just have to open Applications->System->Language Support.

Language support

From there, you can browse through a list of supported languages. I personally prefer British English (which I also set as the default language in the drop-down menu at the bottom), but my sister does not speak English and therefore would like to use my system in Dutch. No problem, I just scroll through the list, select “Dutch” and check the checkbox under “Support”. Now I can click “OK”, upon which it will download the selected language and set it up. And if you later install other applications that have been translated to the other language, that other language will be automatically installed with it.

To set Dutch as the default language for my sister, at the login screen, she can just choose “Dutch” as the language, then when she logs in she will be prompted whether she wants to use it as the default language or just for that session. (Note: depending on the version of Xubuntu, or Ubuntu, you use, a “Languages” button might not be available. To access it, you first have to select Options and then Languages.)

Unfortunately, translating every single piece of software is a huge job, mostly done by volunteers, so not everything will be translated. But the most important software has mostly been translated, and using a partially-translated operating system is already way easier than using one in another language.

Xubuntu Feisty – now from USB drive!

IMPORTANT NOTE: Unless for some specific reason you want to run Xubuntu version 7.04 specifically from your USB Drive, this tutorial is deprecated. I’ve written an updated and much easier tutorial on how to run the latest version of Xubuntu from your USB flash drive.

In my previous post I showed you how you can run Ubuntu Feisty Fawn from your USB drive, and have it preserve any changes you make. In this post, I’ll show you how to do it with Xubuntu. And of course, as usual, you can also view the screenshots as a slideshow.

Using Xubuntu has a few advantages. The first one is that it is more appropriate for this blog (hence the name Xubuntu blog 😉 ), and that I like it better. The second one is that it is faster than Ubuntu, which is quite handy seeing that running it from a USB drive (or flashdrive, pendrive, memory stick, or whatever you’d like to call it) does bring about a speed decrease. The third advantage is that it takes up considerably less space on your USB drive. About 70 MB matters quite a lot, especially if you’re using a 1GB drive (which is the minimum).

But I hear you thinking: didn’t Ubuntu 6.06 “Dapper Drake” already introduce the possibility of such a “persistent liveUSB session”? Why do we need a specific tutorial for Feisty?
OK, perhaps you didn’t think that. But you would be correct if you were: it is already possible since Dapper. However, some packages in Feisty introduced this bug which prevented this feature from working. To work around this bug, we will use some packages from the previous version, 6.10 “Edgy Eft”, which do not suffer from this bug and which most likely won’t cause you additional problems.

Before we start, I’d first like to thank everyone who has worked and is still working on fixing this bug (more details on the bug page and the forum thread) and especially Mike (mjpca) for providing this teporary workaround. His writeup of the steps he took allowed me to do the same for Xubuntu, also using this great guide from “bibe’s” site. And last but not least, this guide would not have been possible without the detailed How-to from Debuntu on how to install Ubuntu on a USB pendrive.

First off, be sure to realize that this will wipe all existing data on your USB drive. Furthermore, these instructions are geared towards Xubuntu, but they’ll also work on other Linux distributions if you change the instructions a bit (e.g. perhaps you use another program for partitioning). It might also work on Windows (I know “syslinux” is available for Windows) but then the instructions will probably differ a lot so it’s your own responsibility.
You need a USB drive of at least 1GB but as that only leaves about 240MB for any additional programs you’d want to install or documents you want to save, I recommend you to use a USB drive of 2GB or more.

The process of putting Xubuntu on your USB drive is not that difficult. Basically we need to divide your USB drive in several regions (partitioning), one of which will hold the modified Xubuntu and one which will hold all your documents and settings. However, because this will take a while, I suggest you already start downloading the modified Xubuntu image generously hosted by pepeio (I have also created a XubuntUSB torrent, hosted on LinuxTracker. If you know how to, please use that torrent.).

As your partitions need to stay unmounted, I recommend you to turn of “Volume Management” (you can turn it on again after you have finished this tutorial). To do so, open Thunar, click Edit->Preferences, then switch to the “Advanced” tab and make sure “Enable Volume Management” is unchecked.

Then, fire up Gparted (Applications->System->GNOME Partition Editor) and, from the drop-down menu in the top right corner, select your USB drive. Be sure to select the correct one, because if you select your hard drive we will remove all data on that and I suppose you won’t like that. Note down the drive (e.g. mine was /dev/sda) because you will need it later. Delete all partitions on your USB drive if there are any, then click the checkmark to apply. After that, the screen should look like this, without any partitions:
Setting up XubuntUSB - no partitions on my USB drive

Right click the “unallocated” space and select “New” to create a new partition, the one that will hold the modified Xubuntu. Set it to be 760 MB (Gparted calls it MiB) and set the filesystem to “FAT16”.
Setting up XubuntUSB - setting the first partition

Then create the second partition, which can take up all the remaining space. Set the filesystem of this one to “ext2”.

Setting up XubuntUSB - setting the second partition

Now, click the checkmark or select Edit->Apply to apply your changes.

Then, open a terminal window (Applications->Accessories->Terminal). In the following command, replace the “/dev/sdx” with your drive (ine was “/dev/sda”, so that would become “/dev/sda1”). If you want, you can change “xubuntusb”, which will be the label for this partition. Enter this command and press enter:
sudo mkfs.vfat -F 16 -n xubuntusb /dev/sdx1
Again, in the following command, change “/dev/sdx” with your drive. This time, however, you may not change the label “casper-rw”, as it will be used to determine where to save changes to. Enter this command and press enter:
sudo mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2

Setting up XubuntUSB - creating the filesystem of the second partition

Now, make sure you have unmounted both partitions (in Thunar, right click them and select “unmount”), then unplug your USB drive. You can then plug it back in and you should see that it will appear with the new labels in Thunar. If the modified Xubuntu has finished downloading, extract it and copy all the files to the “Xubuntusb” drive. You might get complaints about symbolic links that could not be created, but that is no problem, just select “Yes to all”:
Setting up XubuntUSB - sfailed to create symbolic links, no problem

Copying of the files should take a while (especially the file “filesystem.squashfs”), but when it’s done, there is just one final step you have to do: make sure your computer can boot from the device. In order to do this, you need “syslinux” and “mtools”, so fire up Synaptic (Applications->System->Synaptic Package Manager), mark those for installation and click apply. When they are installed, first unmount both your partitions, then open a terminal window (Applications->Accessories->Terminal) and execute
sudo syslinux -f /dev/sdx1

Setting up XubuntUSB - now allow it to be booted, and we're done!

If everything went allright, you should now be able to run XubuntUSB, congratulations! If it didn’t work for you, see “Troubleshooting” below, if it did, please leave a notice in the comments. Thanks!

Note: If you want to create a new user, be sure to grant administrator rights, otherwise it may cause errors.

Another note: For those who don’t like the amount of files on their USB drive, Fisslefink posted a great how-to which guides you to using GRUB instead of Syslinux, so that only two folders will be used. It didn’t work for me, but since he also includes instructions on how to revert back to Syslinux, there is no harm in trying.

Troubleshooting

If you experience any troubles, please first check if your problem is in the following list, and if not, please ask for help in the forum thread.

  • If, upon boot, you get the message no partition active, you have to set it active for boot. Open up a Terminal (Applications->Accessories->Terminal) and type sudo fdisk /dev/sdx (you know, replace sdx with your drive). Press “a” and then “1”. Press “w” to save and then it should work!
  • You might think it is weird that your casper-rw drive shows up on your desktop, and actually, it shouldn’t, but everything still worked as it should with me, so it should not be a problem. Note that you cannot browse it, though.
  • Toad mentions that he could not boot from his USB drive with this tutorial for Ubuntu, but he fixed it:

    I finally got the computer to boot from the USB stick. I had to set the fat16 partition to bootable. ‘cfdisk /dev/sdx’ should do the trick, just press enter on the set bootable option.

  • If this worked, but after a while it doesn’t anymore, you can remove any edits you did to restore it to the point where it worked (all your settings will be lost though):
    sudo mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2
    (Thank zenobiaflex for this one)
  • If your drive won’t boot correctly, your Master Boot Record may be corrupted. You can repair it with Lilo (so open up Synaptic from Applications->System->Synaptic Package Manager and install the package lilo) using the following command from the terminal:
    sudo lilo -M /dev/sdx
    (From PiterP)
  • If, during shutdown, the screen switches from the shutdown screen with the Xubuntu logo with the progress bar to a black screen, possibly with error messages, then you computer is probably just shutting down the normal way without notifying you of its status. At a certain moment (not too long after the screen turned black) it will have reached the point where it would have normally said something like “remove the disk, close the tray (if any) and press enter”. So when the screen turns black, you just have to try to press enter a little while after it has turned black.

a