Friday, July 16, 2010

Low tech stuff

I have started on computers when its wasn't hip yet. When I was a kid, I toyed around a PC XT on green monochrome monitor. Then on to doing BASIC, then to over clocking on a Pentium when Asus brought out the first overclock board. Buying a linux book to get a slackware CD as downloading over a 2400bps modem is very slow. Time has passed so fast.

Lately the latest and greatest tech stuff hasn't been appealing for me. I do get touch the nice smart phones at work. Although new tech stuff isn't as appealing as before. Not sure why, maybe just too many tech stuff going around these days.

Back in the 80s there was something cool, which wasn't computers. I am talking about RC. Remote Control cars, me and my son have a few them.



These are low tech stuff, but very interesting for me. Its one of the interesting things to me as kid back then, aside from playing space wars on a PC XT. This appeals for me especially now as my son is able to build and play with me right now.

LXC on Ubuntu 10.04 Lucid Lynx

If you are like me who doesn't have a lot of time anymore, at times trying new stuff is a lot harder. About a year ago I used kvm, which is great and easy enough to get up and running. I have used it since then however Kvm is a bit too much for my needs as its a full paravirt. Container based virtualization like vserver and openvz seems to be more challenging to get running on a laptop.

Fast forward today, it seems LXC Linux Containers (http://lxc.sourceforge.net) has now made some strides. Its now part of the main kernel, most modern distro should have like. Here is a quick guide on how to get lxc up and running on Ubuntu Lucid.

Below is to setup a debian lenny guest, that uses virbr0 and has dhcp. Do the following as root:

- install libvirt as its easier to do networking on it. No need to setup your own bridge, ipchains and nat. libvirt default qemu network should create a virbr0 interface.


apt-get install libvirt-bin


I have installed this prior for kvm. What we want is virbr0 is up and running. You check this by ifconfig. Try to start it manually on /etc/init.d/libvirt-bin

- install lxc

apt-get install lxc debootstrap


- create the capabilities dir and mount it

mkdir /cgroup

add to /etc/fstab
none /cgroup cgroup defaults 0 0

mount /cgroup


- get and edit the lxc-debian script from /usr/share/doc/lxc/examples/lxc-debian.gz (gunzip it somewhere and apply correct permissions)

Edit and add the following lxc parameters on copy_configuration() function before EOF

# networking
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = virbr0
lxc.network.name = eth0
lxc.network.mtu = 1500
EOF

What this does is use the host virbr0 which is already NATed. This would appear as eth0 on the guest container.

You may need to edit increase the tty allowed, I was getting init warning on my syslog respawning. What I did was to edit my guest inittab to reduce the tty.

lxc.tty = 4 to lxc.tty = 6


- create your lxc dir. In my case the name of my container is "altair". Change it as you fit.

mkdir /home/lxc/altair
lxc-debian -p /home/lxc/altair create


This would start downloading debian lenny packages and create the root file system on /home/lxc/altair/rootfs.

- create the container

lxc-create -n altair -f /home/lxc/altair/config


- run the container

lxc-start -n altair

the above runs it on the foreground, once you have setup everything then you can run it as a deamon

lxc-start -n altair -d


Once you are inside the container, things that I did was
- set the hostname
- fix /etc/hosts
- add your favorite repo on /etc/apt/sources.list
- add X forwarding on ssh and install xauth package
- install rsyslog
- maybe edit your hosts /etc/hosts and add the IP address of the container.

Some useful links:

http://lxc.teegra.net/
http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/
http://nigel.mcnie.name/blog/a-five-minute-guide-to-linux-containers-for-debian
http://en.gentoo-wiki.com/wiki/LXC

HP 6910p, Acer 4315, HP dv6000 on Ubuntu 10.04 / Lucid Lynx

Its been a while since I posted on this blog. Been very busy and had a few months not really keen about computers, more on that later. Anyway for the past few weeks I have installed Lucid on my aging laptops. So far Lucid has been pretty good. Everything runs right out of the box, I needed to install restricted wireless drivers for the Acer 4315 and HP dv6000. Very easy now, as you can do this on GUI. Gone are the days of downloading tars balls, patching kernels, compile and create kernel images.

There has been some minor issues. The Acer 4315 after resume has the wireless disabled sometimes. The volume is now better for Acer 4315. At times after resume the screen brightness is set to lowest, doesn't seem to appear lately.

For the 6910p xrandr is now able to rotate the screen. So at work my 2nd dvi monitor is vertically oriented. Great when doing code. My xrandr script has something like this.


xrandr --output DVI-0 --auto --rotate left --right-of LVDS --crtc 1


What I really liked about upgrading to Lucid is it seems LXC (Linux Containers) seems to be good enough now. I have stayed away from vserver and openvz, as I didn't have much time patching the kernel, then patching again all hardware to work (e.g. wireless) and suspend to work. Will have another post on how to get LXC running on Lucid pretty fast and hassle free.