Archive for the 'Debian' Tag

Using Xfce4 on my Debian-using Powerbook, rejecting Gnome+Mono

Tuesday, December 22nd, 2009

Gnome on Debian, installed using the meta-package, pulls in Mono. You used to be able to bypass this requirement by installing gnote instead of Tomboy, but Gnome now pulls in many other Mono-using apps, of which there are better replacements.

Since I feel Mono is bloated, slow, and anti-FOSS and Debian doesn’t want to remove the Mono requirement (although, yes, I can just not use the meta-package, but that’s just broken behavior), I have decided to try alternatives.

I purged Gnome the hard way by removing libgtk2 and libglib2 and doing several rounds of deborphan --guess-all | xargs apt-get remove combined with apt-get autoremove. In the long run this removed tons of crap I never used.

Next, I installed Xfce with apt-get install xfce4 xfce4-goodies xorg desktop-base tango-icon-theme xfprint4, and also did apt-get install iceweasel pidgin gwibber network-manager-gnome vim-gtk gtk-engines to get the apps I really did want installed. I also installed Slim as a replacement for GDM.

I changed my GTK, Xfwm, and icon themes to “Clearlooks”, “Default-4.4″, and “Tango” respectively. I set The Xfce Session Manager imported my Gnome Session Manager configuration, so apps I have set to startup on session start was maintained.

I also added the app launchers I had on my Gnome panel to the Xfce panel and moved the virtual desktop chooser to the far left, set my panel to be 24 pixels tall, and enabled composting inside Xfwm.

So, after doing all that, I have to say… everything is faster. Gnome had requirements that caused several daemons to start on boot, which increased the time between bootloader and X start, and GDM takes several more times longer to start than Slim. Xfce also starts near instantly compared to Gnome, yet it has the same functionality.

If I had actually bothered to time it, I would not be surprised if I get a usable desktop in half the time I did with Gnome. Xfce is clearly a better product with a lot less bloat.

Also, memory usage wise, I can run Xfce plus X, Pidgin, and NetworkManager in under 200 megs of RAM. Gwibber uses roughly 150 (I think it might be leaking), and Firefox being open with a single tab open uses around 75. A useful Linux desktop doesn’t have to be a bloated mess.

Update: I swapped out NetworkManager for WICD. WICD in total uses less RAM and doesn’t have the hald dependency. Once Xfce’s Power Manager switches to use the new API instead of through hald, that’ll be one less thing to load on boot (it wastes time, not memory).

I need to find a good replacement for Gwibber though, it leaks like crazy. I’ve been running it almost 11 days now, and it’s using a 1gb of memory.

Debian, fglrx, and Linux 2.6.30

Friday, July 3rd, 2009

Using the patches detailed here, I have produced a fglrx.tar.bz2 that builds.

Just drop it in /usr/src/ (replacing the old one) and module-assistant update,build,install fglrx like usual. Patched from Debian package version 1:9-5-1.

Update: fglrx 9.6 is now packaged in sid, this should contain the updates and work on 2.6.30.

Dealing with SSH’s key spam problem

Sunday, March 15th, 2009

Recently I created a new virtual machine locally, and I tried to ssh into it.

[diablo@infinity ~]$ ssh tachikoma
Received disconnect from tachikoma: 2: Too many authentication
failures for diablo
[diablo@infinity ~]$

I didn’t put a key on tachikoma yet, and ssh didn’t ask me my password. It didn’t make any sense.

So, I ran the same command with -vvv and realized… its sending all my identity keys to tachikoma, and the sshd on that machine is kicking the connection due to all of them failing.

What bizarre behavior.

So I dug around in the man page for ~/.ssh/config, ssh_config and noticed I can just add…

host *
IdentitiesOnly yes

… to force ssh to only use specifically named identities which (what I’ve been doing for years, anyways) are written like this…

host some.remote.host.com
IdentityFile ~/.ssh/id_rsa_some.remote.host.com

… or something similar. With the IdentitiesOnly directive in there, it only sends specifically the identity keys I specify with IdentityFile instead of spamming all the keys I have.

I’m not sure if this is a Debian-only problem (both infinity and tachikoma are Debian machines), but even though its a security feature, its kind of annoying.

How to make a UML image on Debian

Tuesday, February 13th, 2007

Out there, on the Internet, there is a lot of conflicting information on how to properly build a UML image on Debian. These instructions are for Debian Sid, but should work on Etch and Sarge as well. The instructions are partially based on the ones available here.

First, you want to apt-get install user-mode-linux uml-utilities bridge-utils debootstrap realpath. Then, become root either by su or sudo bash. Make an empty directory (such as ~/uml) and cd into it. Now, follow this psudeo script:

# setup environment, feel free to change DEBIAN_MIRROR to your closest mirrror, IP to an IP not already being used on your network, and GATEWAY to your LAN’s gateway (not your host machine)
export TMPDIR=`pwd`"/tmp"
export IMAGE="root_fs"
export DEBIAN_MIRROR="ftp://ftp.debian.org/debian/"
export HOSTNAME="NameThisMachine"
export IP="a.ip.to.use"
export GATEWAY="ip.to.talk.to"
mkdir $TMPDIR

# produce a 1GB image, fudge with seek to change size
dd if=/dev/zero of=$IMAGE bs=1 count=1 seek=1G

# make partition, and mount it; Debian Sid kernels can only mount ext2, ext3, cramfs, iso9660, and reiserfs, ext3 is the only one worth using
mkfs.ext3 $IMAGE
mount -o loop $IMAGE $TMPDIR

# download and install Debian into your image: change arch to the arch you’re using, and change sid to sid, etch, or sarge; this step takes awhile
debootstrap --arch i386 sid $TMPDIR $DEBIAN_MIRROR

# install a correct fstab, proc and sys are automatically loaded on boot
echo "/dev/ubd0 / ext3 defaults 0 0" > $TMPDIR/etc/fstab
echo $HOSTNAME > $TMPDIR/etc/hostname

# tweak inittab
cp $TMPDIR/etc/inittab $TMPDIR/etc/inittab.save
grep -v "getty" $TMPDIR/etc/inittab.save > $TMPDIR/etc/inittab
echo "# We launch just one console for UML:" >> $TMPDIR/etc/inittab
echo "c0:1235:respawn:/sbin/getty 38400 tty0 linux" >> $TMPDIR/etc/inittab
echo "# UML modification: use tty0 or vc/0" >> $TMPDIR/etc/securetty
echo "tty0" >> $TMPDIR/etc/securetty
echo "vc/0" >> $TMPDIR/etc/securetty

# add networking stuff
echo "auto lo" >> $TMPDIR/etc/network/interfaces
echo "iface lo inet loopback" >> $TMPDIR/etc/network/interfaces
echo "" >> $TMPDIR/etc/network/interfaces
echo "auto eth0" >> $TMPDIR/etc/network/interfaces
echo "iface eth0 inet static" >> $TMPDIR/etc/network/interfaces
echo "address $IP" >> $TMPDIR/etc/network/interfaces
echo "netmask 255.255.255.0" >> $TMPDIR/etc/network/interfaces
echo "gateway $GATEWAY" >> $TMPDIR/etc/network/interfaces

# clean up
umount $TMPDIR
rmdir $TMPDIR

You now have an image full of Debian named root_fs. To run, simply execute linux mem=64M ubd0s=root_fs. If you need more memory, increase the mem paramater. By default, there is no password for root, so just use root as your login and press enter when it asks for password.

A little aside on networking:the auto tuntap method (eth0=tuntap,,,the.ip.to.use, which basically does ARP proxying on the host machine) does not work properly as it only allows host->UML traffic. The only way I’ve been able to get UML networking to work properly is to build a full bridge setup. The following commands in /etc/network/interfaces/ sets up the bridge. You probably have something like:

auto eth0
iface eth0 inet dhcp

Comment that out with #s, and change it to:

auto br0
iface br0 inet dhcp
pre-up tunctl -u user-to-run-uml -t tap0
pre-up ifconfig eth0 0.0.0.0 promisc up
pre-up ifconfig tap0 0.0.0.0 promisc up
pre-up brctl addbr br0
pre-up brctl stp br0 off
pre-up brctl setfd br0 1
pre-up brctl sethello br0 1
pre-up brctl addif br0 eth0
pre-up brctl addif br0 tap0
post-down tunctl -d tap0

allow-hotplug eth0
iface eth0 inet manual
pre-up ifconfig eth0 0.0.0.0 promisc up
pre-up brctl addif br0 eth0
pre-down brctl delif br0 eth0
pre-down ifconfig eth0 down

Add the additional parameter to linux‘s command line: eth0=tuntap,tap0. That will make UML connect to tap0, and use the IP set above when you built the image. If you use a firewall, you need to change the interface to firewall from eth0 to br0, and to allow br0->br0 traffic.

Switch to Debian

Thursday, September 7th, 2006

I’ve finally decided to switch back to Debian. In fact, I did so about a week ago. Both my workstation and laptop now run Debian; and I’m much happier with Debian than I ever was with Ubuntu.

Way back when, I was one of the first people to switch to Ubuntu, under the promise of both Mark Shuttleworth and his people, and all of the Debian developers switching sides (apparently, since then, many of those developers either develop for both Debian and Ubuntu now, or switched back to Debian only), that Ubuntu would be what Debian was supposed to be: an easy to maintain, perfectly stable, often updated, desktop distro.

I believe, now, that Ubuntu is none of those things. Ubuntu, instead, is nothing but an attempt to turn Debian into something like Fedora: a desktop distro that puts user friendlyness over sane software development.

I deleted my /bin, /sbin, and /usr/* directories, and appended .old to /etc, /home, and /var, and used the 20060829 daily built Etch Debian-Install netinst CD to install in my already existing parition. I can say the new installer is way better than the one I used back in the Potato days (which was the last time I actually installed Linux on my workstation, I only dist-upgraded to Ubuntu instead of reinstalling).

I’m actually surprised how modern this installer is. For one, which surprised me, is that it automatically detects and sets up my Firewire port to be able to network on, the only flaw here is that it gives me an option of using eth1 as my default network adapter but doesn’t actually tell me eth1 is my Firewire port.

Second, it can automatically retrieve my computer’s hostname and domain because I statically assign IP and FQDN based on MAC with dnsmasq (which provides both dhcpd and dnsd) on my router. It saves me a few keystrokes, sure, but it is still a neat feature.

The only missing features I’d like to see is a mention of console output on F5, and a terminal on F2, which I only knew were there from previous experience with Debian installers. Plus, I’d also like to see the ability to add a pre-existing directory to use debs from, so I don’t have to re-download things if I already have downloaded them once.

After install, I quickly ugraded to Sid.

A few other things I noticed Debian has and Ubuntu doesn’t, is that Debian’s apt-get now has the abilty to download just the updated parts of a package index instead of the whole index (on supported mirrors, anyways). Even on DSL, downloading 5+ megs of package indexes takes a good 30 to 45 seconds, now it just takes less than 5.

In addition, and I’m not sure what caused this, I no longer have very sluggish apt-get performance when installing or removing packages. I think this may be because my Debian install was ancient and had eventually gotten dpkg‘s various state files gummed up, but where a simple apt-get install of a small package would take a few minutes, it now takes a few seconds.

All in all, Debian is still the distro I remember it: clean, lean, well designed, a dream to administer, and not bloated to hell and back with lots of defaultly installed packages no one uses. Also, is it me, or does Debian also boot a good ten seconds faster than Ubuntu?