Wednesday, November 23, 2011

Reusing old PC as a headless linux

Wish I had more time to do this, but well, doing a short one better than none.

I have this old PC (given by my father-in-law who practically gave up on it), with the specs:
Intel Pentium 4 1.5GHz
384MB (after I added some RAM, but can't recall how big was the initial RAM).
20GB HDD
with a very very bad CRT monitor (14")

So with that, I formatted the hard disk (originally Windows XP) and installed Ubuntu 11.04. I like it even though the 3D acceleration could work as the graphic card could not support, but 2D worked well enough. Soon, I found that it could no longer able to do multitasking. The specs are just too low for Ubuntu. But that didn't bother me as I only use that to download files.

Days became, weeks... Weeks became months... I left it as it is.

Then, my wife, who was given the flexibility to work from home, is given an LCD monitor. So for space sake, I took off the old monitor and in its place, the LCD monitor. To be fair, the monitor is to be plugged into her office laptop and it would be troublesome to connect/disconnect from the tower CPU case to her laptop.

By then, Ubuntu 11.10 was released. So I did an upgrade. But since it became so sluggish, change the X windows to Xubuntu, but that did not help that much.

Then the idea of headless linux struck as I look around the Internet.

I am still working on it to see how else to make it better, but this is what I did:

1. Install ssh into the machine. Installed OpenSSH. It was done a while ago, so could not capture the steps here, but its fairly easy

2. Install VNC. Used various VNC software (again, it was a while ago, so can't recall) but the X Window could not display Ubuntu's UI properly. In the end, run x11vnc, which I think is the best way to see the my user screen.

Ah... but later I also read about a light weight Linux Distro called SliTaz, and reviews were good. Decided to give it a go since the PC became so slow! You can always google Slitaz for more information. Will not layout the details here.

Once installed, the PC felt like brand new. Everything just run. Of course, there were some programs such as the default browser, Midori, is less familiar, and how packages installed must be tazpkg, and movie files with the mkv file format does not quite run (still working on it...), I was quite happy to have SliTaz installed.

So with that now, Slitaz has got a light-weight SSH installed, called DropBear. By following the instruction at http://doc.slitaz.org/en:handbook:ssh, SSH is now running.

Then, I install x11vnc using the instruction at http://doc.slitaz.org/en:guides:conspy (near the bottom of the page) where below instruction is found:

SlitazBox# tazpkg get-install x11vnc
SlitazBox# tazpkg get-install x11vnc-extra
SlitazBox# /etc/init.d/x11vnc start

By just doing that, voila! my VNC is now running again! Based on the previous x11vnc setup, I can now let my VNC start automatically by setting it as a "Auto Started Application" that can be configured via the UI. Also, to make sure that the x11vnc does not end process when the connecting VNC viewer ends the session, the command ought to be:


/usr/bin/x11vnc -bg -reopen -forever

where:

-bg - is running on the background
-reopen - after you will log in and the x11vnc will be terminated this swich renew x11vnc connection
-forever - after you close vnc client the x11vnc server won't close but keep "running"


(reference from http://ubuntuforums.org/showthread.php?t=995746)

Somehow, after adding the command in "Auto Started Application", it does not appear as one of the item (maybe I have to restart? but I doubt it). But when I view the "Configuration", it is found there.

Well, this is as far as I could go for now. Will explore further if TeamViewer can work properly. Hope I can connect to this machine from my android phone. :)

No comments:

Post a Comment