Search results for: Openbox

Debian Wheezy (7.5): Changing Default X Session

I mainly use Openbox. But after Debian Wheezy installation, X Window System defaulted to LXDE. It's not that much of a hassle to select Openbox from the drop-down menu every time I log on:

Debian_LoginBox

However, sometimes I forget to select Openbox, get LXDE, and re-log in with Openbox. This happened quite a few times and I finally decided to change its default X session to Openbox.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibilities of end result after following these steps (although I will try to help if you send me your questions/problems).

There are quite a few ways to do this. One way is to edit (or create if it doesn't exist) ~/.xsession or ~/.Xsession.

But I used the update-alternatives command: $ update-alternatives --config x-session-manager

Debian_update-alternatives

As shown in above image, select number 2 for Openbox. After logging out, Openbox becomes the default X Window Session!

That's all!
-gibb

Debian Wheezy (7.5): Encrypted Root Filesystem on laptop

I'm not a distro-hopper. Well, that's what I thought but I'm probably wrong (and nothing wrong with being a distro-hopper!). On my main system, I'm using Slackware since its version 9 or 10. However, on my laptop (HP Pavilion dm3-1130us), I tried RHCE, Fedora, Xubuntu, Mint, CrunchBang, Arch, and FreeBSD. Each distro had its pros and cons but it didn't really stick to me. I liked FreeBSD the best among them but it drained the battery and heated up my laptop compared to other distros. Also I couldn't get some of hardware components (ex: built-in webcam) working. I believe FreeBSD is an excellent OS for servers but probably not for laptops so much. So, I was in a quest for another distro again and decided to try on Debian.

Disclaimer: The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

Now onto Debian. As other distributions, I wanted to try encrypted disk/filesystem(s) for my laptop. After a bit of research, I came across to this article. Interesting. My laptop doesn't have a CD/DVD drive, either, but I never thought of having a recovery partition in case of emergency. So I decided to give it a try with this method. Since this article is a bit outdated, I'll describe it with most recent version of Debian (Wheezy) and add some steps.

1. Creating Bootable USB Stick

Download the netinst.iso image from Debian website and create a bootable USB stick. # dd if=debian-7.5-0-amd64-netinst.iso of=/dev/sdX

2. Setting Up Recovery System

Start the Debian installer. Since I love OpenBox, I select below options for the installation.
Advanced options -> Alternative desktop environments -> LXDE -> Graphical install
Follow the installer until you get to set the hostname. I set it as debianrecov for recovery. Follow it until you get to "Partition disks" and select Manual. Here is the partition scheme to use:
  • Main partition for LVM and encrypted, taking up the whole disk minus 3GB. Set it as Do not use for now.
  • 3GB recovery partition at the end of the disk. This will be /boot for the main system. (3GB is an arbitrary size I picked. I tried with 1GB and the installation failed when installing packages.)
    - Set it as ext4 mounted as "/" - Set its label as "recovery"
Choose Finish partitioning and write changes to disk. It'll then warn you that there is no partition for swap space and ask you whether to return to the partition menu. Just select No and follow the rest of the installation. Reboot your system and make sure it boots up without any issues.

3. Setting Up Main System

Now boot the Debian installer again. Select the same options for the installation and follow it until you get to "Partition disks". Select Manual. Select the main partition and hit the Continue button. Then choose physical volume for encryption for "Use as:". debian_install_1 Select "Done setting up the partition". Next select "Configure encrypted volumes". Then "Create encrypted volumes" and choose the main partition. After selecting "Yes" for erasing data on the partition, it'll start randomizing it. This will take very long time (on my laptop, it took more than 10 hours). When it's done, it'll ask for a passphrase. This is the phrase you type at every boot and it is not recoverable so don't forget it! Select the contents of the "disk" Encrypted volume and debian_install_2 Next, select physical volume for LVM for "Use as:" and choose "Done setting up the partition". Then select Configure the Logical Volume Manager and create a Volume Group. The original article uses the hostname for the Volume Group to reduce confusion if the disk is plugged into another machine for disaster recovery. I think that's a great idea. Create a Logical Volume called swap. If you plan to use suspend-to-disk, this needs to be at least as large as your RAM. Create a Logical Volume called root. Set the swap Logical Volume you just created to be used as a swap area and your root Logical Volume to be used as ext4 mounted at "/". Also set your recovery partition to be used as ext4, mounted on "/boot", and the format partition option to "no, keep existing data". This is how the partition layout looks like: debian_install_3 Proceed with the rest of the installation and reboot the system when it's done.

4. Making Them Dual-boot

In the original article, it now talks about setting up dual-boot. Debian Wheezy uses GRUB2 and menu.lst is no longer available. However, it should automatically detect your recovery system and it should look like below during GRUB menu: debian_install_4 If your recovery system is missing, you could try running the update-grub2 command in your main system: # update-grub2 Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.2.0-4-amd64 Found initrd image: /boot/initrd.img-3.2.0-4-amd64 Found Debian GNU/Linux (7.5) on /dev/sda2 done If update-grub2 did not work, make sure that the recovery partition was set to be ext4, mounted on "/boot", and the format partition option was set to "no, keep existing data" at the end of Step 3 above. Tomorrow, I'll talk about accessing main system's area from recovery system. That's all! -gibb

Slackware64: Installing Slackware 14.1

Long waited new version of Slackware 14.1 was released a few days ago (11/07/2013). I also read a report from Alien Bob about this new version and it looks promising as ever!

Here is a screen shot of my slackware64 14.1 in vm client

slacky64

Disclaimer:
The information below is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others.

Installing Slackware64 14.1

The installation of this version of Slackware is pretty much the same as previous ones. If you have ever installed Slackware before, there is no surprise. Slackware uses a non-graphical installer. If this is your first try, you may feel a bit overwhelmed but it is really easy to understand.

The most tricky part may be creating partitions with 'fdisk' or 'cfdisk'.

slackware64_partition

I'm used to 'fdisk' so I just run the command: root@slackware:/# fdisk [path_to_drive] Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p) p Partition number (1-4, default 1): 1 First sector (2048-41943039, default 2048): 2048 Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +2G Partition 1 of type Linux and of size 2 GiB is set Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p) p Partition number (1-4, default 2): 2 First sector (4196352-41943039, default 4196352): 4196352 Using default value 4196352 Last section, +sectors or +size{K,M,G} (4196352-41943039, default 41943039): 41943039 Using default value 41943039 Partition 2 of type Linux and of size 18 GiB is set Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): 82 Changed system type of partition 1 to 82 (Linux swap) Command (m for help): a Partition number (1-4): 2 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. root@slackware:/#

After partitioning, run 'setup' to start the setup program.

Addswap:
This enables a selected partition as swap partition. In my case, it's /dev/sda1. The swap partition is an independent section of the hard disk used solely for swapping. Swapping is the process whereby a page of memory is copied to the pre-configured space on the hard disk to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

Linux installation partition:
Next step is to select a partition to install root Slackware files. In my case, I have only one partition to select, /dev/sda2.

Format partition:
Select "Format" to format above selected partition.

Select filesystem:
I choose ext4 filesystem. Ext4 is an advanced level of the ext3 filesystem which incorporates scalability and reliability enhancements for supporting large filesystems (64 bit) in keeping with increasing disk capacities and state-of-the-art feature requirements.

Source media selection:
Select "Install from a Slackware CD or DVD.

Package selection:
I choose the default selection.

Select Installation mode:
I choose "full" to install everything.

USB flash boot:
After the packages installation, it'll ask you whether you want to boot from a USB device. This is surely an option if you don't use LILO or traditional boot loader, but I use LILO to boot the system so I skip this section by selecting "Skip".

Install LILO:
LILO is a Linux Loader which boots the Linux kernel. The setup program offers a few options here. "Simple" and "Expert". Simple installation automatically tries to identify installed OS(es) and enables you to choose. "Export" installation allows you to edit the lilo.conf file. Since I'll have only one OS on this system, the simple method suffices.

Select frame buffer console for LILO to use:
I do not much care about the frame buffer console so I choose the standard.

Kernel parameters for LILO
No extra parameters are needed.

UTF-8 text console
I choose "No".

LILO installation location:
There are a few options here but since I don't have any other OS, it is safe for me to install LILO in the MBR.

Mouse configuration:
I use a USB connected mouse so my choice here is "usb".

Network configuration:
From here on there are questions for network configuration, such as hostname, domain name, network type (DHCP, static IP, etc).

Start-up services:
Default selection

Hardware clock:
The hardware clock is set to the current local time so my selection here is "No".

Timezone configuration:
I select "US/Eastern" here.

Default window manager for X:
Although I know I'm going to install Openbox for my window manager, I choose XFCE here. I used to like KDE but it's too fatty for me now. If you want, you can run 'xfwmconfig' to choose the default again.

Root password:
Choose some strong password for root.

DONE!
Now the installation of new Slackware is done. You can reboot the system and enjoy it.

If you'd like, you can follow my previous post, Slackware64 14: Post Installation Configuration.

That's all!
-gibb

Slackware64: Configuring IBus

A Happy New Year!
This is the first blog entry in 2013.

I have been using "scim" for Japanese input since I started using slackware. It's an ok input method framework, but I always felt a bit uncomfortable for some reasons. So, I looked for another option and found IBus. It looks like this framework will be replacing scim in the near future. So, I decided to give it a try.

Disclaimer:
The information below is from Linuxquestions.org and some tweaking. It is solely used for my purpose and may not be suitable for others.

First, install ibus, pyxdg, ibus-anthy, and ibus-qt from SlackBuilds.
Then, create a directory and a file in it: # mkdir /etc/X11/xinit/xinput.d # vim /etc/X11/xinit/xinput.d/ibus.conf --------------------------------------------- #!/bin/sh export XMODIFIERS="@im=ibus" export GTK_IM_MODULE="ibus" export QT_IM_MODULE="xim" # allow capslock remap xmodmap -e 'clear Lock' -e 'keycode 66 = F13' XIM=ibus XIM_PROGRAM=/bin/true XIM_ARGS= SHORT_DESC="ibus" LONG_DESC="ibus"

Then, create a symlink to ~/.xinputrc: $ ln -s /etc/X11/xinit/xinput.d/ibus.conf ~/.xinputrc

Add following statement in the autostart file (~/.config/openbox/autostart): ibus-daemon -rxd &

Log out and log back in. There should be a keyboard icon in the system tray. Now, move onto its configuration.

Run ibus-setup: $ ibus-setup

This command brings up the IBus Preferences window: General->Next input method: "Shift+Meta_L" Input Method->Select and input method->Japanese->Anthy Advanced->(check) Share the same input method among all applications

That's all!
-gibb

Installing Arch Linux on LVM

A good friend of mine gave me his not-needed notebook (HP Pavilion dm3-1130us) since my 10+-year-old notebook started acting up and became unstable. It got a dual-core AMD chipset with 64bit support. Good enough as a spare machine for the road.

I have been a Slackware user for a while and that's what I use on my home system and old notebook. But for this time, I wanted to try other distributions. After a quick research, I decided to go with Arch Linux. I liked its philosophy and simplicity. It seems very stable as well. That's a plus.

Don't get me wrong, I'm still a fan of slackware. I just wanted to see what else is out there.

I decided to use LVM for Arch Linux because I want to try full system encryption (dm-crypt with LUKS) later on. It seems LVM on LUKS is a growing preference nowadays.

Disclaimer:
Information below is gathered mostly from the Arch Linux Wiki page and changed here and there for my liking. This information below is solely used for my purpose and may not be suitable for others.

Configure Wireless Network:

Network connection needs to be configured before the installation can take a place. Since my notebook uses WiFi, I need to configure wireless network.

Check for the network interface and whether udev has loaded the driver. # iwconfig -------------------- eth0 no wireless extensions. lo no wireless extensions. wlan0 IEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=14 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on

It looks like wlan0 is available.

Interface activation:

Not required for mine but here is how to activate # ip link set wlan0 up

Access point discovery:

I know my network information like ESSID, Encryption key, etc..., but here is how to list available access points # iwlist wlan0 scan | less

Or, for the new netlink interface # iw dev wlan0 scan | less

Association to the access point

Now a configuration file, /etc/wpa_supplicant.conf, needs to be created for my access point. # vi /etc/wpa_supplicant.conf -------------------- ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel eapol_version=1 ap_scan=1 fast_reauth=1

These options are explained in /etc/wpa_supplicant/wpa_supplicant.conf

Append the passphrase and PSK to the file # wpa_passphrase SSID_NAME "PASSPHRASE" >> /etc/wpa_supplicant.conf

Manual connection:

The WiFi interface should be up by the earlier command ip link set wlan0 up, so now tell wpa_supplicant the driver (wext - Linux Wireless EXTensions), the SSID specified in /etc/wpa_supplicant.conf and the wireless interface. # wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf

  • -B : Run in the background
  • -D : Driver information. Default is WEXT
  • -i : Wireless interface
  • -c : Configuration file

Request an IP address to DHCP server. # dhcpcd wlan0

Check assigned IP address. # ip addr show wlan0 wlan0: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:00:00:00:00:00: brb ff:ff:ff:ff:ff:ff inet 192.168.1.6/24 brb 192.168.1.255 scope global wlan0 inet6 fe80::ffff:ffff:ffff:ffff/64 scope link valid_lft forever preferred_lft forever

Load the module:

dm-mod needs to be loaded before doing anything with LVM # modprobe dm-mod

Partition a Disk:

# fdisk /dev/sda

Partition Layout:
/dev/sda1 -> LVM

Since I'm using GRUB2, the /boot partition is also included in the LVM partition.

Create Physical Volume:

Initialize these partitions so they can be used by LVM. # pvcreate /dev/sda3

Create Volume Groups:

Create a volume group on this physical volume. Volume group name is lvm. # vgcreate lvm /dev/sda3

Create Logical Volumes:

Create logical volumes on this new volume group. # lvcreate -L 100M -n boot lvm # lvcreate -L 10G -n root lvm # lvcreate -L 500M -n swap lvm # lvcreate -l 100%FREE -n home lvm

Configure block devices, filesystems, and mountpoints:

# mkfs.ext4 /dev/mapper/lvm-boot # mkfs.ext4 /dev/mapper/lvm-root # mkfs.ext4 /dev/mapper/lvm-home # mkswap /dev/mapper/lvm-swap # swapon /dev/mapper/lvm-swap # mount /dev/mapper/lvm-root /mnt # mkdir /mnt/boot # mount /dev/mapper/lvm-boot /mnt/boot # mkdir /mnt/home # mount /dev/mapper/lvm-home /mnt/home

If there are no logical volumes under /dev/mapper, run next commands to bring up the modules and to make volume group available: # modprobe dm-mod # vgscan # vgchange -ay

  • vgscan: Scans all disks for volume groups and re-builds caches
  • vgchange -ay: Makes the logical volumes known to the kernel

Select installation mirror:

Before installing, you may want to edit /etc/pacman.d/mirrorlist such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by pacstrap as well, so it's worth getting it right.

Install the base system and other package groups:

The base system is installed using the pacstrap script. pacstrap is a script that installs packages to the specified new root directory. If no packages are given, pacstrap defaults to the "base" group.

Required X Window Systems packages for openbox will be installed in post-installation configuration

The system uses wireless network, so install the required wireless network packages. # pacstrap /mnt base base-devel wireless_tools netcfg wpa_supplicant wpa_actiond

Generate an fstab file

The fstab file contains static filesystem information. It defines how storage devices and partitions are to be mounted and integrated into the overall system. It is read by the mount command to determine which options to use when mounting a specific device or partition.

Most likely swap partition will have wrong filesystem name, so this needs to be changed. # genfstab -p /mnt >> /mnt/etc/fstab # vi /mnt/etc/fstab -------------------- ... /dev/mapper/lvm-swap none swap defaults 0 0

Chroot into the system

# arch-chroot /mnt

Configuring the System

Let's configure the primary configuration files

/etc/rc.conf is the configuration file for Arch's initscripts. Some of options in this file has been obsolete and they now have own configuration files (ex: hostname, etc...). /etc/rc.conf still configures daemons to start during boot-up and some networking and storage information.

Editing /etc/rc.conf:

Since LVM is used on this system, I need to enable it so that the kernel knows about it # vi /etc/rc.conf -------------------- USELVM="yes"

Hostname:

Configuring hostname requires updating two files, /etc/hostname and /etc/hosts

Add hostname in /etc/hostname # cat > /etc/hostsname arch64 ^D

Add hostname in /etc/hosts # vi /etc/hosts -------------------- 127.0.0.1 localhost.localdomain localhost arch64 ::1 localhost.localdomain localhost arch64

Console fonts and keymap:

The console, meaning a terminal running with no X Window System, uses the ASCII character set as the default.

A console font is limited to either 256 or 512 characters. The fonts are found in /usr/share/kbd/consolefonts/.

Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of /usr/share/kbd/keymaps/ # cat > /etc/vconsole.conf KEYMAP=us FONT= FONT_MAP= ^D

  • KEYMAP - the default (us) is ok
  • FONT - the default (blank) is ok
  • FONT_MAP - the default (blank) is ok

Timezone:

Available time zones and subzones can be found in the /usr/share/zoneinfo/<Zone>/<SubZone> directories.

Create a symlink /etc/localtime to zone file # ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime

Locale:

Choose the locale(s) from /etc/locale.gen and uncomment them. # vi /etc/locale.gen -------------------- en_US.UTF-8 UTF-8 -------------------- # locale-gen

Setting up system-wide locale:

# cat > /etc/locale.conf LANG=en_US.UTF-8 LC_TIME=en_US.UTF-8 ^D

Set the LANG variable for the ramdisk creation # export LANG=en_US.UTF-8

Hardware clock time:

It's recommended to use UTC. # hwclock --systohc --utc

Configuring wireless network:

Copy wireless-wpa from /etc/network.d/examples/ to /etc/network.d and rename it something else. This will be a template for my profile. Open it and change ESSID to my SSID name. Delete everything below ESSID. The KEY value needs to be a hex string so it'll be generated by using the wpa_passphrase command: # wpa_passphrase SSID_NAME "PASSPHRASE" >> /etc/network.d/[profile_name]

Open the profile and delete the lines starting with network={, ssid=, #psk=, and }, leaving only the psk line. Then change this psk to KEY, and add IP='dhcp' to the bottom of the line: cat /etc/network.d/[profile_name] -------------------- CONNECTION='wireless' DESCRIPTION='WPA encrypted wireless connection' INTERFACE='wlan0' SECURITY='wpa' ESSID=[SSID_name] KEY=[hex_string_for_passphrase] IP='dhcp'

Now, connect to the profile: # netcfg [profile_name]

If no errors, it should display :: [profile_name] up

Configure the rc.conf file for auto connecting to the wireless network after each reboot: vi /etc/rc.conf -------------------- DAEMONS=(... net-auto-wireless ...)

Make sure /etc/conf.d/netcfg has the following values: cat /etc/conf.d/netcfg -------------------- NETWORKS=(last) WIRELESS_INTERFACE="wlan0"

Create an initial ramdisk environment:

Configure /etc/mkinitcpio.conf for LVM by adding lvm2 in the HOOKS section before filesystems so that the kernel will find LVM volumes at boot time. # vi /etc/mkinitcpio.conf -------------------- HOOKS="...lvm2 filesystems..."

Now generate the kernel image. # cd /boot # mkinitcpio -p linux

Install and configure a bootloader:

# pacman -S grub-bios # grub-install --target=i386-pc --recheck /dev/sda

Create a grub configuration file. # grub-mkconfig -o /boot/grub/grub.cfg

Root password:

Set the root password now # passwd

Unmount the partitions and reboot:

Exit from the chroot environment. # exit

Since the partitions are mounted under /mnt, unmount them. # umount /mnt/{boot,home,}

Exit the install and reboot. # reboot

Post-Installation

Updating the system:

Sync, refresh, and upgrade the entire new system. # pacman -Syu (or pacman --sync --refresh --sysupgrade)

Pacman will now download a fresh copy of the master package list from the server(s) defined in /etc/pacman.conf and perform all available upgrades.

Pacman output is saved in /var/log/pacman.log

Adding a user:

Now add a normal user account for daily tasks # useradd -m -g users -G audio,games,log,lp,optical,power,scanner,storage,video,wheel -s /bin/bash ubyt3m3

Set a password for ubyt3m3 # passwd ubyt3m3

X Window System:

The X Window System (commonly X11, or X) is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs).

Now install the base Xorg packages using pacman. # pacman -S xorg-server xorg-xinit xorg-server-utils

Install video driver:

My system came with ATI Graphics Card, so install the open source raden driver. # pacman -S xf86-video-ati

Install input driver:

Since this install is for notebook, following package is needed for touchpad. # pacman -S xf86-input-synaptics

Testing X:

Install the default environment. # pacman -S xorg-twm xorg-xclock xterm

Fonts

Install a set of TrueType fonts, as only unscalable bitmap fonts are included by default. DejaVu is a set of high quality. # pacman -S ttf-dejavu

That's the very base system. Installation and configuration of other software will be in another time.

That's all!
-gibb