Archlinux on Raspberry Pi: installing xorg and LXDE
After 3 months of using Raspberry Pi my SD Card has broken. I bought new one and decided to install Arch this time. There is disc image with preconfigured system: http://www.raspberrypi.org/downloads. We could of course install it on our own, but I have no special needs, so this package is ideal for me. Let’s download it and write it on SD Card. To do that we need to determine localization of new card. You can use ls /dev/sd* and check what’s new or simply use GParted. In my case it’s /dev/sdb. To write img to disc use program called dd. I did it in that way:
sudo dd if=~/archlinux-hf-2012-09-18.img of=/dev/sdb
If your card is bigger that 2GB you should also resize / partition. You can do it easily with GParted. Just resize it to disk limit. Now we are ready to boot our RPi. Plug the ethernet cable and boot device. I’m doing everything, till the moment of xorg installation, via SSH, without using its video ports. Check device’s IP and connect. It my case it was firstname.lastname@example.org (simply type ssh email@example.com – you need to have openssh installed). First part of that address is the account we want to connect with. That is actually the only account in that system now. Its password is root, so right after connecting, type passwd and type doubly the new one.
After doing that we’ll need to update our system. To do that type:
Now we are ready to install xorg. Type
pacman -S xorg
When it’ll ask about selection, don’t give anything on input, just press enter. After installing xorg, install 3 things more: xorg-xinit (to be able to use startx), xorg-twm and xterm (to test if xorg is running properly). Do it with:
pacman -S xorg-xinit xorg-twm xterm
Now you should connect your Raspberry Pi to an video output. When you’ll be ready use that command (not with ssh anymore):
You should see something like this:
To close it, type exit on left terminal or, in case you don’t have your mouse connected, type pkill x on this active by default.
Now it’s time to create a new user. It’s wise not to use root account when using x. To do that use that command (XYZ will be the name of your user):
useradd -m -g users -G wheel,storage,power -s /bin/bash XYZ
Now set password for new user:
No it’s time to install lxde. It’s probably the lightest environment. You can choose alternatively xfce (which I prefer) but it’ll work a bit slower. If you decided to use lxde, type:
pacman -S lxde
When installation is completed, log out (by typing logout) and log on your newly created user.
ls -la | grep .xinitrc
If there’s such file, you need to remove it by typing:
Now we’re going to create a new one. Type:
cat >> .xinitrc
When you’re done, press Ctrl + D. Make sure that your file contains only that line. Now it’s a big moment. Type
and wait for LXDE to start.
That is the most basic way of doing it. Your LXDE screen should look like this right after installation: