22 December, 2012

HowTo: Personalize a ChrUbuntu installation

We all know about how Jay Lee was able to port Ubuntu Linux to make it run on Chromebooks *very* easily (more info here), right? Well, in my opinion, there's still some personalization/upgrade work to be done once it is installed.

First of all, whoever installs ChrUbuntu would like to go beyond using "user" for their username, and would want to change the password. Well, they certainly can change their display name, but their shell login, hostname, and other info needs the command line (and root/sudo access) to do. So, let's get started, shall we?

Change hostname

Open a terminal window (simply open the Dash and search for "Terminal" without the quotes). In it, run the following commands:

sudo su
gedit /etc/hostname

/etc/hostname is a system-wide configuration file that contains the name of the computer itself, the way it's seen to other computers. And it's just one line: the host name. So, change that line to the name you want to use, and reboot (the hostname won't change until the OS is restarted and no shells, not even VTs, are open).

Change shell login

Close the terminal window above. Since Linux doesn't let user accounts be modified when in use (i.e. logged in), and since Ubuntu's lightdm for some reason doesn't allow users to use the root account PERIOD, even with the root account unlocked by the user executing "sudo passwd", we need to create a temporary user account to be able to modify the default user. So, let's get started, shall we?

Open the GNOME Control Center (Power menu -> System Settings). From the Control Center, select "User accounts". Then, click "Unlock" (If you changed your password already, use it, otherwise, just type "user" at the password prompt). The "+" button at the bottom of the list allows you to create a new user account. So click it. You'll end up opening a dialog with inputs for the full name, username, and account type. Make the account type "Administrator" (this allows the user being created to sudo), for the full name, type "Temporary user", and for the username, shorten it to "temp". Click Create, and then set a password for the account (preferably the same as the password you set for the default account, as the account being created won't last long).

Now, log out, log into the temporary account, and open a terminal window as described in the "Change hostname" section. In the window, type the following commands:

sudo su
usermod -md /home/USERNAME -l USERNAME user # where USERNAME is the username you want to use for yourself

Now log out of the temporary account and back into the modified default account that now has your personal name on it. Open System Settings as described before, and then select User Accounts from the list again. This time, select the "Temporary user" account, and click the "-" button. When prompted to delete the account's files, confirm that you want them deleted. Now the personal account is fully customized!

Update: After typing "man lightdm" in a terminal, I found out the reason why LightDM isn't showing the root account. The "/etc/lightdm/users.conf" file is configured to only show users with a UID of 500 or greater.

So, without much further ado:

sudo su
gedit /etc/lightdm/users.conf

and change the line that says "minumim_uid=500" to "minimum_uid=0". Then LightDM should pick up the root account (provided, of course, you actually unlocked it).

Upgrade the installation to the latest version (optional)

Many are wondering why 12.04 LTS suddenly says "Software up to date" in the system menu when installed. Well, that's because Jay Lee somehow changed the settings so that by default, ChrUbuntu will only offer the ability to upgrade to another LTS version. Which won't happen until at least 14.04.

So, without much further ado: Press Alt+=> (the "=>" key is the Chromebook's equivalent of F2). Type "gksudo software-properties-gtk" at the prompt that follows, and press <Enter>. Now, in the dialog that follows, click the "Updates" tab. At the very bottom, there is a "Notify me of a new Ubuntu version" menu. Click the button that says "For long-term support versions", and the menu will come up. You will then be able to select "For any new version" from the menu. Then, close the dialog.

Now, press Alt+=> again, and type "gksudo update-manager". At the very top of the window, there should be a notification saying "New release '12.10' is available" (or the like), with a button giving you the option to upgrade. Click that button, and the system will upgrade as usual. Be warned, however: It could take HOURS on end for the upgrade to finish its course, especially over Wi-Fi or 3G (it took my Acer AC700 ChrUbuntu installation at least 6 hours to upgrade), since it needs to download about 1500 .deb packages from the Quantal repositories.