Mittwoch, 29. April 2015

TinyCore Linux


After some experiences running Lubuntu (14.04 LTS and 14.10 – 64 Bit) on my recently build thinclient, I search for a more lightweight system. Don't get me wrong, Lubuntu is fine, has a good hardware detection and configuration– everything (dual-head X, Sound) is running out of the box, but the distribution is too large to install on the build-in DOM (1 GB) of my HP-T 5730. Therefore I do a USB stick installation, which works but has a really bad IO performance. A startup time from about 2 minutes is really bad. However, some month ago, when I started using docker, I installed Boot2Docker on my MacBook Air. Boot2Docker starts a headless virtualbox instance running a tiny core linux with installed docker engine to provide Docker services on OSX. The base image used for such a 'boot2docker' instance is incredible small, about 20 Mbytes of size, which is an impressive value for kernel + ssh + docker. Nowadays, when waiting that Lubuntu finished booting, I remembered Tiny Core Linux and google for it.
TinyCore Linux is a very small linux distribution and comes in three basis flavors :
  1. Micro Core (kernel + core.gz) - 9MB
  2. Tiny Core (Micro Core + X) – 15 MB
  3. Tiny Core Plus (Tiny Core + WLAN driver + Installer) – 75 MB
TinyCore has very small hardware requirements (a 486er and a minimum of 48 MB of RAM is needed) and run completely from RAM and is therefor subjectively much faster than other distributions. So called extensions can be installed from an online repository using tce-ab (cmdline), which is a kind package system similar to apt on debian based systems.



Tiny Core is different than other distributions, because users are not encouraged to perform a 'traditional', hard-drive installation of the operating system. Sure, a hard drive installation is possible, but Tiny Core is designed to run from a RAM copy created at boot time. Besides being fast, this protects system files from changes and ensures a pristine system on every reboot. Easy, fast, and simple renew-ability and stability is a principle goal of Tiny Core.
(from TinyCore concepts)

I used a TinyCore 32 Bit image as base for my current installation. Startup to X from an USB stick is done in about 10 seconds – what a big different to Lubuntu. After a frugal installation in default mode to my 1GB 'hard-disk', the startup time decreases to only a few seconds. After the base installation is done I just had to do some configuration work to have a perfect thin client ... :-) ... well, it was not as easy as writing this sentence, but not so complicated – the Tiny Core team/community have done really good work here. Thanks!



Configure X

The greatest challenge was to configure my dual head graphics configuration. Remember my hardware configuration? I have a Nividia Quadro NV 290 connected to two monitors. Since this configuration work out of the box with Lubuntu, it is a bit complicated to get it running with TinyCore. First I need to install Xorg instead of Xvesa and a suitable driver for my graphics card. The extension Xorg-7.7 (Meta package for all the necessary Xorg stuff) and xf86-nouveau should do the work, but in fact Xorg uses only a slow VESA and not the better fitting nouveau driver. I create a minimal /etc/X11/xorg.conf to force using the nouveau driver:

Section "Device"
  Identifier "Card0"
  Driver "nouveau"
  BusID "PCI:1:0:0"
EndSection


Running X with this configuration fails. In the corresponding log file I found that KMS (which is mandatory when using nouveau) can't be used because its not enabled. Loading the graphics-XXX-tinycore extension should help but this packages doesn't contain the necessary nouveau kernel module.I decided to compile the missing module by myself and package it into a nouveau_kms package.
Building the neccessary kernel modules are much easier than expected. I need the following packages compiletc.tcz, linux-kernel-source-env.tcz and optional ncurses.tcz for a more comfortable kernel configuration ;-). I build and package the following kernel modules into nouveau_kms.tcz :
  • drivers/i2c/algos/i2c-algo-bit.ko
  • drivers/gpu/drm/ttm/ttm.ko
  • drivers/gpu/drm/drm_kms_helper.ko
  • drivers/gpu/drm/drm.ko
  • drivers/gpu/drm/nouveau/nouveau.ko
  • drivers/char/agp/nvidia-agp.ko (possible unnecessary)
  • drivers/char/agp/agpgart.ko (possible unnecessary)
After adding it to the onboot list (/mnt/[boot drive]/tce/onboot.lst) and a reboot (minimal xorg.conf still exists) X comes up with both screens mirrored. I use xrandr to expand the desktop over both screens.

xrandr --output DVI-I-2 --auto --right-of DVI-I-1

I add a small script named xrandr.sh containing the above xrandr command to the tc users .X.d directory. Every script inside this directory is run after X is started. In my case X comes up so fast that the second monitor is still sleeping and is not yet available, I just add a sleep 2 before calling xrandr.
There is still a problem existing. The console gets blank when loading my noveau_kms package, but X is working fine (with nouveau). If someone has an idea what the problems solves, please let me know. For now a running X without console is fine for me.
If you have a similar problem and want to use my nouvaue kms module, let me know - I can provide you my nouveau_kms.tcz package (build for Tiny Core version 6.1).


Enable Sound

Enable sound is easy and straightforward. I just have to add two extension (alsa.tcz and alsa-config.tcz) and it works out of box. The default alsa.tcz extension comes with a textual ncurse based mixer, which is fine for me. If you a like a more graphical interface just install the corresponding extension (alsa-mixer.tcz).


Setup SSHD

For some reasons (e.g. the console isn't available :-) )it is sometimes useful to provide ssh access. After installing the openssh.tcz package I have to create the host ssh-keys :
sudo ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
and start the sshd:
/usr/local/bin/sshd -D
Mostly for security reason I only want to use ssh-public-key access. So, I just copy my public ssh key to the tc users authority file and everything works like expected (By default the tc user doesn't have a password).


Persistent Configuration

Since all configuration work is lost when rebooting the system, I have to persist it.
  • add /etc/X11 (xorg.conf) and /etc/ssh (ssh-keys) to backup list
  • add xrandr.sh to ~/.X.d
  • add /usr/local/bin/sshd -D to /opt/startup.sh
An installation on a portable media like an USB storage device that is used on different hardware should possibly not persist the ssh-keys, but create new ones during startup.






Freitag, 17. April 2015

HP-T 5730 CPU Upgrade

The HP-T 5730 thinclient comes with a low power AMD Sempron 2100+ CPU. This kind of CPU has a TDP of 8 Watt at 1Ghz clock rate. For most tasks a thinclient is designed for this is fast enough, even today. As mentioned before I run thinlinc on my HP-T 5730 connected with two screens (each 1920*1200 pixel). The working speed is okay, but often not so smooth as it could be. Using the HP-T 5730 in such a dual head configuration the CPU seems to be the bottleneck. Surprisingly the CPU is not soldered and can be easily replaced by a more powerful one using the same socket (S1).

Mobile Sempron 2100+
As described on some pages I found in the web, a lot of different types of CPU would fit. I choose an AMD Athlon64 TF-20, which is a single core CPU running at 1.6 GHz (TDP 15 Watt) and is relative often offered on platforms like Ebay for around 10-15 Euro. However, there are faster (and of course also more economize) CPUs available that would fit, but they need extra cooling or are much more expensive. The 15 Watt TDP should be handled by the default passive cooling system.

Athlon 64 TF-20
If you like to have more speed and add some extra cooling – used AMD Turion X2 CPUs are dealt around 5-25 EUR depending of their clock rate (dual core, 1.6 – 2.4 GHz, TDP 31-35 Watt).

I do some benchmarks using the build-in benchmarks suite offered by hwinfo. However that's better than my subjective feeling but not as good as a 'real' benchmark, so results should handle with care.

Benchmark
Sempron 2100+
Athlon64 TF20
CPU BlowFish
36,59 sec
22,86 sec
CPU CryptoHash
34,9 Mb/sec
56 Mb/sec
CPU Fibbonacci
7,67 sec
8,15 sec
CPU N-Queens
20,32 sec
16,7 sec
FPU FTT
37,38 sec
23,25 sec
FPU RayTracing
27,94 sec
15,86 sec


The new CPU is about 50% faster than the previous one, it is an expected value. The increased power has the consequence that the CPU run in a low power mode at 800 Mhz clockspeed most of time.


With the last upgrade I have to think about the PSU again – 27 Watt of system (HP-T5730 + CPU upgrade) + 21 Watt of the external graphics adapter (NV-290) comes closely to the 50 Watt limitation of the original PSU. At last, to have more room when adding some USB devices I replace the original PSU (50 Watt) with a more powerful one (12V - 96 Watt) from my junk box.
12-96W PSU
After all the upgrades I did, my thinclient solution its not really cheap any more (around 50 Eur overall), but of course cheaper than buying a new one.

Mittwoch, 8. April 2015

Using HP-T 5730 as Dual-Head ThinLinc Client

As I mentioned before I prefer a noiseless hardware thinclient like the Igel UD3 for my office desktop. My tests with old (and somehow slow) hardware were positive, so I searched the web for an cheap dualhead solution that can I use at home.

  • A Linux driven HDMI stick computer seems to be a possibility, but these kinds of mini computers are normally support only one display up to FullHD resolution (1920*1080).
  • Older thinclients seems also fast enough and you can get refurbished models for only a few bucks on Ebay. There is only one problem you have to consider. Not all older thin clients supports a dual head configuration and the maximum resolution is often limited to 1280*1024 or 1600*1200 per connector.
I choose a HP-T 5730. It's a somehow bigger thinclient based on standard X86/X64 hardware and was first announced 2009. My refurbished ones comes with an extension bay and costs about 25 Euros. The original hardware specs are :

  • AMD Sempron 2100+ (1Ghz, 64 Bit, 8 Watt TDP)
  • 1 GB RAM
  • 1 GB FlashDisk
  • Radeon X1250 GPU with two screen connectors (DVI + VGA)
  • 8 * USB 2.0 (2 front, 4 rear, 2 internal)
  • Extension bay for a full size PCI  card, however the PCI-E riser was missing :-(
  • 50 Watt power adapter
I replace the preinstalled HP Linux (a  Debian Etch derivative) with TinyCore Linux. TinyCore linux is a very small and fast distribution. The core + xserver + radeon driver is only about 50 Mbytes large and starts within 10 seconds from power on to GUI ready. It's well documented and designed to be run from a “write not to often memory” mass storage device (like an USB stick). In fact everything is loaded and started from RAM and is written back when power down.

My first test with only one screen (1920*1200) was successful, the speed running the thinlinc client software was ok – subjectively the same like using my SunRay 3+ with identical display resolution. Using a dual head configuration is a bit tricky, you need to create your own X configuration overwriting a wrong default value for X1250 GPU in dual head configuration (see http://www.arm-blog.com/dual-screen-hp-t5730/).

Section "Device"
Identifier "ATI Radeon Xpress 1250"
Driver "radeon"
Option "ColorTiling" "off"
EndSection

However this test was disappointing. Yes, it works, but everything is extremely slow. It seems that there is no 2D Acceleration by the GPU when running in dual head configuration (with two 1920*1200 displays).

As mentioned before my HP-T 5730 comes with an ExtensionBay and offers one PCI or PCI-E x1 slot (but the PCIe riser card was missing). The idea was to use a full graphics card instead of the integrated GPU. I bought an Quadro NVS-290 PCI-E x1 for about 10 Euro and 10 PCI-e riser card for also 10 Euro on Ebay.  If somebody needs a PCI-E riser card for the HP-T 5730 – I have 9 left ;-) .

I replaced the PCI riser card with the PCIe one and install the NV Quadro graphics adapter. The original power adapter (50 Watt) should be ok for the ThinClient with deactivated integrated GPU (20 Watt) and Quadro NVS-290 graphics adapter (21 Watt).

After connecting two monitors -  I switch it on and ... nothing happens :-( The screens are blank – the graphics adapter seems to be broken. I tested the card in another PC – there it works. Searching the web for some helpful information that solves my problem returns nothing new, beside it should work ...

Having a fixed idea, I replaced the PCI-E riser card with the PCI one that comes with my extension bay and installed a Matrox G450 DH PCI graphics adapter I found in my “old-hardware” compilation. The thinclient starts with the internal GPU, but now I can switch to an additional installed graphics adapter deactivating the internal GPU in the BIOS. The menu entry did not appear before. However, the thinclient comes up, but was very slow using VESA driver. I did not try to use the native mga driver since it was not available from TinyCore repository and the Matrox card doesn't support two 1920*1200 displays.

I rebuild everything like before (NV Quadro instead of Matrox G450) and now it works ... maybe a BIOS bug or something else. My NV Quadro card is labeled as HP graphics and has an other part number than the card HP offered as optional extension for this type of thinclient ...


The thin client with the external graphics card has enough power to drive two 1920*1200 displays in dualhead configuration. Maybe it would be a bit smoother when replacing the Sempron CPU with a more powerful one (e.g. Athlon 64 TF20 – 1.6 Ghz, 15 Watt should be fit), I will try this in near future.

ThinLinc from Cendio


For several years our workgroup uses SunRays as workstation. This worked very well – no noise, small energetic footprint, support friendly, supporting dualhead - but it has also some (big) disadvantages :

  1. The SunRay server software run on top of Solaris OS. However there was also a linux variant available, but as I know it did not offer the same possibilities like the Solaris variant. Solaris is not too bad, but not supported by a lot of software any more. You have to compile mostly everything by yourself and hope that there are no problems you can't solve. However, it is a very time consuming task to compile software from source for Solaris and for binary only software (mostly commercial software, like e.g. Adobe Acrobat reader) there is no chance.
  2. The newer SunRay's (3 and 3+) have some USB 2.0 ports and supports beside mouse and keyboard also mass storage devices. But the transfer speed is incredible slow, seems that only USB 1 speed really used.
  3. Depending on your network configuration and your screen resolution (up to 3840*1200 Pixel using a SunRay 3+ in dualhead configuration) the screen composition is very slow and sometimes erroneous.
  4. The SunRay hardware clients (and also the SunRay Server Software) are discontinued in 2013 and are not longer supported by Oracle (maintenance until 2017).

Mostly for the last point our support searched for a new (and better) solution. One possible solution that may fit our requirements is “ThinLinc” from Cendio. ThincLinc is a remote desktop software solution for both server and client side. The server software can be installed easily on top of typically linux derivatives and is free up to 10 simultaneous connected clients - enough for most private installations. As I Know,Cendio doesn't offer any hardware with preinstalled client software any more, but since the client is available for a various number of operating systems and hardware platforms this isn't really a problem.

Most people uses their notebooks running OSX, Windows or Linux with the ThincLinc client, but I also test some more exotic hardware. From my point of view the solution works very well, also using very old hardware and having small bandwidth (DSL 3000 @Home). I run and test the thinlinc client on following hardware / operating systems :

  • MacBook Air from 2011 using an external screen (1920*1200)
  • Thinkpad T61 running Ubuntu 14.04 using an external screen (1600*1200)
  • NoName PC from 2002 (P4, 1 GB, Matrox G550DH, Win7) running a dualhead configuration (3840*1200)
  • ARM (V7) based micro computer running an Ubuntu derivative connected to a FullHD TV (1920*1080)
  • Atom based Nettop running Ubuntu 14.04 connected to a FullHD screen (1920*1080)
  • Igel UD3 running a dualhead configuration (3840*1200) during a short trial period

At home and when traveling the notebook solution is very cool. I can run my office desktop when- and wherever I want :-) At my the office I prefer a dualhead and noiseless solution like the Igel I used during a trial period.