I've been reading a rather excellent book called The Living Cosmos. A major part of the book talks about how life possibly arose on Earth, and understanding its processes will help understand just how obvious such similar processes must be happening elsewhere.
One of the interesting theories is that since evolution requires variation through mutations, one way to increase the number of mutations is through radiation. This gives rise to all sorts of strange scenarios, where the sun, or even a nearby supernova or hypernova, could release some radiation that causes major shifts in the evolutionary fitness on Earth. The possibilities are endless.
But what really got me thinking is the concept of life itself. It turns out this is a very hard thing to define. Most scientists equate metabolism with life. Let's think about this for a minute, and look beyond the complex cells we have today, back to when the first complex molecules started to form. Why would they form?
The book has an excellent picture showing solar radiation being converted to heat, which is an increase in entropy towards a more probable state. So we go from a condensed improbable energy state to a dispersed probable energy state. Think of a gas spreading in a room. The steady state is when there is more entropy. Now, between this beginning and end stages are other stages that harness the energy. These are molecular bonds such as ATP. So energy is flowing from the sun, being captured by molecules with the creation of bonds, and finally being released by those molecules by the breakage of those bonds. It's a stairway effect, where energy trickles down. It's being harnessed, or stored, but eventually released in some way. Another similar process is radioactive decay, where you have elements themselves changing at an atomic level by electron states. An electron is raised to some level by the inflow of energy, and then moves to another level by the release of that energy. In complex molecules the release could be through mechanical energy, waste production, etc. It's all just a transfer and harnessing of energy.
Is this not the process of life itself? Let's now think about how such complex molecules like cells and their replication processes might have evolved. Let's say solar energy starts forming some complex molecules which we would consider lifeless. Again, these are forming through the harnessing, or rather the catching, of solar energy. Sort of like fusing material together if you will. The atoms are simply the road the solar energy travels, and the forming of molecules essentially the 'damage' the energy does on the road. Now these molecules want to revert back to their more probable state of more entropy. That is, they want to break those bonds and go back to the state they were in before the sun ran them over. So they do, but the sun comes back again to do damage. This creates a cycle, but the complex formations are completely reliant on the sun.
Now, let's say you are that molecule relaxing or breaking your bonds to go back to what you were. In that process you release some energy (again, the stairway). That energy could affect another molecule next to you. Remember all of this is happening on a much grander scale, so many varied molecules could be forming. Let's now suppose a neighbor molecule takes as input you in your probable state and spits you back out in your improbable high-energy state. Something like a stencil, where the input may be some collection of elements (along with solar energy) and the output being an advanced molecule similar to what the sun did on its own.
Now what happens? A cycle is created! While one molecule is breaking apart, another is there taking the very energy released by the breaking apart to create a brand new original molecule. But it can't go on forever because at some point there is energy wastage through heat, so the sun must come in again and add energy the process. This eerily sounds like night and day. How can it go on at night? With the storage of the energy that happened during the day of course.
Let's call the 2nd molecule the replicator, because it is actually recreating the 1st molecule. Here you can see we are not fabricating molecules out of nothingness, but rather always reusing what is in the environment. What you have is a chain reaction. Could such a reaction be the birth of life as we know it? Extrapolate this to much more complex molecules, and we can begin to envision how DNA and replicating proteins might have evolved. It's just all on a much more higher level. Take the original replicator pair of molecules and let's say they are considered a whole molecule by another much larger replicator. In other words, you could have recursion going on, where a replicator replicates a replicator
.
It becomes apparent that to continue life you need to recycle what once was into something new. As long as you have the energy input you can do this. Once energy is used out of molecules they breakdown, but you need to create more for future work. This is the very essence of replication. That is, survival depends on replication with stored energy.
Many spark of life experiments involve putting ingredients in a bottle and submitting it to some high energy like electricity. But I wonder, is this the wrong approach? Instead, shouldn't we be trying to model molecules that would exhibit a chain reaction with even the minimal amounts of energy? This chain reaction would be further tweaked as it's progressing because there would be changes in radiation (the sun's energy wouldn't be uniform, and you'd have radiation sources other than the sun). I find it hard to believe that life started abruptly with some spark. If you consider life as progression down the energy stairwell perspective it all seems to make sense that complex energy-harnessing organisms would arise. We can consider a lifeform simply as a very large molecule with high-energy bonds, ready to break to perform any of the physical powers that such lifeforms will have. They can pick up objects, they can reproduce, they can eat, etc. Taken on a much grander level we as humans could just be another step in the stairwell towards entropy.
Why did I name this blog 'Life as waste elimination'? Well partly because I am sick, and partly because I look at waste elimination similar to the energy released through breakage of molecular bonds. The scheme can be applied at the cellular, molecular, and even atomic levels with electrons.
These days the buzzword seems to be "hypervisor". It's a general term for what VMware is. One thing I've always found to be a good use case for virtualization is testing new and possibly broken configurations. These past few days I've been food poisoned and working from home recovering, but it did give me a chance to play around with the latest Linux virtualization: KVM.
KVM in this sense is not that hardware device to connect one monitor to multiple machines, so the choice of naming is unfortunate. It is based on QEMU, however there are kernel hooks to make things go faster by utilizing virtualization features on certain processors. What's great is recent distributions have it simply as a kernel module that doesn't require any kernel patching.
First some background. Why am I interested in this? Well in my case I run a website on Apache (who doesn't). I've been hearing some good things about lighttpd and I wanted to see what the fuss was about. However, I didn't want to muddy my current Apache server with lighttpd. I simply wanted another system to play around with, preferably one that didn't require hardware. So this seemed like a perfect case to try out the completely free KVM.
Now my host OS (the OS that will run KVM) is a Ubuntu 7.10 server. It actually runs on a closed laptop, so essentially I have no display on it and only connect to it remotely. Most virtualization software these days are GUI apps unless you buy the horribly expensive 'server' products. I was somewhat pleasantly surprised as to how KVM worked in my scenario. Ideally I wanted to run a guest OS the same as my host OS, Ubuntu 7.10, so that's what I started with.
First I installed the kvm package:
sudo aptitude install kvm
Easy enough, next I modprobe the right modules:
sudo modprobe kvm sudo modprobe kvm_intel
I should point out you need to have a processor that supports KVM. See their web page for more info. Now it get's a bit confusing. In some documentation there is mention of running "qemu-system-x86_64", however on my box this is the unaccelerated version that makes no use of KVM's kernel modules. I'm not sure what's going on here, but I believe at some point QEMU and KVM will merge code, and maybe this is the reason for the documentation discrepancy. Anyhow, for my case, I had to use "kvm" to start up my virtual machine. So I downloaded the Ubuntu 7.10 server ISO and begun my journey. First I needed to create a disk image. Interestingly, these disk images only take up space as you add to them, similar to VMware:
qemu-img create -f qcow vdisk.img 10G
This creates a 10G-maximum disk image. Now we're ready to begin the installation:
sudo kvm -hda vdisk.img \ -cdrom ubuntu-7.10-server-i386.iso \ -boot d -m 384 -vnc 192.168.1.137:0.0 \ -no-acpi
This simply boots the VM with the Ubuntu server CD and 384M of RAM. It's recommended to use -no-acpi, so I did. Now BAM I get an "exception 6" and a crash immediately (as described here). My foray is not starting off well
. After more searching I came across this bug which hinted that this was maybe fixed in a newer version of Ubuntu. Huh? So something in Ubuntu is causing this crash? Searching further I found this thread which gives more info:
Confirmed here with kvm-intel and KVM 39. Invalid opcode (#UD) is probably caused by the boot spash code which may be using big real mode code.
So indeed, something in Ubuntu was doing it. So I decided to try grabbing the bleeding edge Ubuntu "Hardy Heron" server. After some thumb twiddling it now boots!
Now remember how I have no display on this box? Well the convenient -vnc argument creates a VNC server that I can connect to remotely! This is all great, but kvm also supports X, and actually I do most of my work from an OS X X terminal. Why not just use the X interface? Well on OS X, the keyboard becomes completely unusable in KVM for some reason. It could be something retarded in the X server. Anyhow, for VNC, there is Chicken of the VNC, by far the stupidest package name ever. It generally works well though, however when I tried to connect to my VM I was getting some invalid rectangle error. It seems everything was against my trying to get this working
. After much experimentation, I found that I had to simply disable Hextile encoding in the VNC connection profile and voila, I can connect.
Now I thought to myself, I'm going to be running a webserver on this, don't I need some kind of network setup? Well once I confirmed things are booting ok, I did some research on KVM networking. Essentially what I wanted is my VM to appear just like a separate machine on the network with full network access. KVM has all sorts of networking possibilities, but here is my setup. First I updated /etc/network/interfaces to look like:
auto lo iface lo inet loopback auto br0 iface br0 inet dhcp bridge_ports eth0 bridge_maxwait 2 up /sbin/ifconfig eth0 inet 0.0.0.0 promisc auto eth0 iface eth0 inet static address 172.16.5.0 netmask 255.255.255.0
This generally came from this Ubuntu KVM doc. The IP above is actually a bogus one that won't be used. Rebooting (alas, I did have to reboot) gave me a br0 and eth0 device listed via 'ifconfig'.
My host machine still worked so that's good.
Now how to start the VM with networking? Simple:
sudo kvm -hda vdisk.img -m 384 \ -vnc 192.168.1.137:0.0 \ -no-acpi -net nic -net tap
I went through the install with no problems at all and it got an IP via DHCP on my router. Sweet.
Now one thing that was bothering me about all of this is that spiny sudo prefix. I would've liked to not use sudo. This forum thread mentions a possible solution but I had no luck with tunctl and I didn't feel like spending too much time on it.
So I got my cool VM working, now what? For what reason am I on this Earth? On my main web server I have a Django site running under Apache. What I wanted to try is running this with FastCGI under lighttpd. Now I have to admit, lighttpd configuration is a much nicer experience than Apache configuration.
Take a look at my lighttpd.conf. My virtualhost is defined at the bottom, and is taken mostly from the Django fastcgi docs. lighttpd has a very simple and elegant configuration. Note that I had to modify some of the modules loaded, and the Django docs seem to indicate the ordering is important. Once I started up my Django site in fcgi mode my site was instantly accessible, and FAST. At least, very fast for a virtual machine!
So what have I learned from all of this? Well KVM is cool, and one of these days it is going to beat out its commercial counterparts. Also, lighttpd is cool. Cooler than Apache I must say. It will definitely be coming to more web servers near you.
Donate to keep this site going!
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | ||