Peter's Blog

Redefining the Impossible

Items filed under linux


andLinux is designed to make any sentence sound ungrammatical. It is also a linux distribution that runs under Windows 2000/XP/Vista. I was put onto it by long-time commenter spikeles and I am really impressed with it.

You install it on your Windows box and it creates a Windows service that is a linux kernel. It also includes enough X smarts to be able to run X applications alongside your windows apps. Here is the obligatory screenshot of IE7 peacefully coexisting with Krusader and Konsole on a Windows Vista desktop:

andLinux

andLinux

Notice how the different 'linux' apps have their own windows taskbar entries. And you can NEVER have enough dual-pane file managers. And yes, konsole is about a billion times better than the windows command terminal. Oh, and note that the last quicklaunch bar entry is for Konsole and was created by the andLinux installer.

It's support for linux is about as deep as I can trawl, I was able to get autofs running exactly as I would under ubuntu. It is based on Kubuntu (most of the apps that come with it are KDE) and while the current install gives you a version of gutsy I was able to upgrade it to hardy from the standard ubuntu repositories.

I can cut and paste between linux and windows apps. The linux apps can access the windows files using Samba: there is an alternative method of accessing the windows files called cofs but the cofs website says:

Please note: The cofs device is new in coLinux 0.6.2. It's still in the experimental phase and is very buggy! So don't blame us if it breaks your disk ;)... YES it is, it crashed my server when I tried to rename a file from within coLinux This and other crashes are fixed in coLinux 0.6.3. Please see Cofs in 0.6.3 for a description how to use it there.

so sod that.

One bugbear at the moment is that with a dual-screen setup, andLinux seems to think there is just one big monitor and so windows pop up in the centre of the big screen, windows tend to be too large for one monitor etc. It is something I can live with.

andLinux makes cygwin look mighty primitive. There is always an element of finger crossing to using cygwin and I have struggled to get it working properly with NetBeans. andLinux makes running linux in a vm look like a cludge. If you want to use apps written by developers for developers rather than apps designed by marketing for management and you are compelled by your corporate overlords to do it on a windows box then this is what you want.

Thanks spike!

UPDATE: OMG Konsole is good.


Filed under: andlinux linux ubuntu

Add a comment

Could this be the best of both worlds?

Best of Both Worlds

Best of Both Worlds

On the left we have kubuntu running under vmware player on Windows Vista. To the right we have Outlook and some Vista widgets running on the Vista host.

Vmware player is incredibly solid and linux installs nicely unlike Microsoft Virtual PC which runs into various problems (which Microsoft aren't rushing to fix). Vmware player is free and I prefer it to Vmware server as I don't need the 'server' element. It's missing features like pause/rewind/snapshot so it is less useful for testing setup programs (cannot roll back to a clean o/s install) but is ok if all you want is a simple desktop os. It supports USB, unlike the free versions of VirtualBox.

I found a site called Easy VMX that allows me to make new virtual machines for vmware player so I can build whatever vm's I like.

Somehow (not sure how) the seamless mouse thing works and I can switch between kubuntu and windows just be moving the mouse. Unfortunately cut and paste between them does not seem to be working.

So why use Vista as the host? Because I'd need another license to run it in a vm on a linux host sad

I'm giving kubuntu/KDE a try. Compared to gnome it is either more suited to the power user or more bloated, depending on your viewpoint. I think I'm leaning to krusader as a file manager, I could probably run it under gnome but it costs nothing to try KDE.

TBH there's something about the gnome philosophy of cloning windows that irritates me. KDE may have once used 'non free' software but I don't really care.

Good to see the blog works in Konquerer and the text editor has a spell checker! Ironically Konquerer is flagged in red.


Filed under: kubuntu linux vista vmware

2 Comments

My Mythical Convergence Box was working ok as a mythtv backend but as a server it was frustratingly slow: slow to boot firefox, task switch, run wow, whatever. I was itching to upgrade it.

I decided the cheapest solution was a good old processor/motherboard/memory upgrade so now the box has a Dual Core 64 bit AMD processor, a AMD690GM motherboard and 2g of 800Mhz ram. I also splurged on a 750G SATA hard disk since they were on special offer. I installed the native Ubuntu 64 bit version for a free 64 bit state of the art operating system. Why pay more?

This fixed the performance problems smile

Myth and everything all worked fine, 64 bits did not cause any compatability problems. The 750G disk will hold about 375 hours of TV recordings, should I have 15 solid days (and nights) spare to watch tv.

The motherboard I bought had an AMD/ATI chipset so my biggest problems were getting WoW to run without crashing, ATI's linux drivers not being the best. I used the ones installed by ubuntu, I tried installing newer ones at one point but they made no difference. I tweeked more things than I can remember googling for but the most important thing is to add

SET gxAPI "opengl"

to WTF/Config.wtf as otherwise it tries to runs in direct 3d mode and immediately dies with a fatal exception. The frame rate was then crap and I had to turn all the settings down but it does run wow acceptably: while setting it up I became preoccupied with gathering turtle meat.

The graphics are still odd, there is something wrong with the colour balance that makes everything looks cartoonish and when watching recordings the top line on the display flickers. It's awfully tempting to get an nvidia card..

On my desktop Wow still runs just fine, even with mythtv showing Alien vs Predator on the second monitor. Add a nice mug of coffee and life is sweet.


Filed under: linux moneypit mythtv ubuntu wow

4 Comments

I resolved my issues with Ubuntu hardy heron. Extensive googling revealed I was pretty much alone in my misery so I fixed it the Windows way, with a clean install. To be more accurate, I installed Xubuntu rather than Ubuntu and I'm glad I did. The difference is that I am using xfce rather than gnome and so I'm missing a lot of gee whiz features but, oddly enough, I've never found anything extra in gnome that I can't live without. Gnome development seems to be going in the direction of dumbing it down to make Windows converts feel at ease and all the brilliant new features of gnome are cunningly hidden in case Windows folk turn them on by mistake and their brains explode from the amazement and confusion.

I reinstalled as follows:

  • backed up my xorg.conf in case I broke my carefully crafted X setup.
  • backed up assorted irreplacable stuff in my home directory. How nice it is having a home directory, one place to store all my files.
  • downloaded and blew xubuntu install cd
  • swapped my primary and secondary monitor leads as I am sooo sick of my small secondary monitor being considered the primary monitor (despite my protests).
  • booted cd
  • selected install option
  • cd booted and gaved me a totally orange desktop
  • rebooted cd and pressed f4 for safe graphics mode
  • ran install, carefully overwriting my old linux setup
  • install complete.
  • make sure the nvidia restricted (urgh nasty closed source) driver is installed.
  • Most importantly, run
    sudo aptitude install nvidia-settings
    nvidia-settings
    
    to set up the multi-monitor. I've learn from my last install not to touch the main display control panel.

Um, that's it. It was easy and took maybe 30 minutes (which didn't include downloading the cd image).

Xubutu has a great advantage over ubuntu: a crisp blue theme instead of that brown!

One problem I am having with all the (x)ubuntu work: I have to type my password about 300 times a day, both for ssh and sudo and it is driving me MAD.


Filed under: linux ubuntu xubuntu

2 Comments

I upgraded my home desktop to Ubuntu 8.04 (Hardy Heron) as soon as it came out last week. I used the feature in the Upgrade Manager which told me the new version was available so doing the actual upgrade was fairly idiot proof.

Since then Firefox (version 3 beta) has been broken, the menu's don't work, I click on them and nothing happens, as if they were disabled. Also the user interface locks up after five to ten minutes of doing anything. When it happens again the menu's die, the mouse moves about and some of the panel widgets work but essentially it is useless. Ctrl-alt-backspace fortunately works so I can reboot the desktop and start again.

World of Warcraft is the only thing that works for any period of time ( smile ). Apart from that the system is useless and I've had to use Windows.

I've googled and found other people complaining about 8.04 but they appear to have kernel lockups which would be much more dire.

It's a pity as I had been enjoying using a linux desktop. The only thing that didn't work before was my printer and I hadn't put any effort into fixing that.

I had already upgraded my Mythical Convergence Box to Xubuntu 8.04 which is Ubuntu with a lean mean xfce user interface rather than gnome. Xfce gives a passable Windowsy level of functionality. That box is running just fine and now reacts to the Hauppauge Remote Control. Unfortunately 8.04 has a newer version of mythtv so if I rolled my desktop back to the previous version (gutsy gibbbon) I wouldn't be able to use a gutsy mythtv frontend with the hardy backend and I don't want to roll the myth box back.

When gnome is working on Hardy it has changed it's behaviour somewhat. The application menu works in a contrary way such that the menu is only there while your mouse button is down so you press your mouse down to open it, find your menu item while holding the button down and then release to activate. I can see that this needs just a mouse down and up rather than two clicks but it's annoyingly different, especially as I can't find a way to turn it off.

Gnome also has interesting behaviour when moving windows around in that it tries to guess where you are dragging it to and how big the window will be. I can drag a maximised app from one screen to another and even though the screens are different sizes I get the result I want. I think this may actually be useful once I learn to predict what it is going to do.

Conclusion: I wish I'd waited for 8.0.5 sad I may go back to gutsy on the desktop and live without the myth frontend for a while. I don't want to go back to windows.


Filed under: linux mythtv ubuntu

Add a comment

I set up a cron job to backup my web sites to my Mythical Convergence Box, just a simple rsync of the subversion repository and, to be safe, /var/www. The latter was 500Mbytes.

Next morning the cron job had run and my server was inaccessable. Oops, with 10g of WoW and 10g of family photos I had filled the main disk up, my 250g Myth disk being mounted on /var/lib/mythtv. The box hadn't crashed but it was in a kind of coma, you ask it to do something and it went urgh.

I had to reboot into recovery mode and move the photos to the mythtv disk, leaving me 68%. Observations:

  • Interesting how hard the system failed when the disk filled up. Have to be careful.
  • Linux recovery mode is actually useful! Whenever I've tried the (admittedly pre-vista) Windows recovery modes it has spent a quarter of an hour loading drivers for obscure disk controllers, then I've tried the automated recovery that never works, then I've rebooted, I've waited another quarter hour, then it's given me something with the raw power of a 1985 dos prompt, then I've given up and reformatted the disk.

Last night my cron job worked fine and my websites are so thoroughly backed up that my head is spinning.


Filed under: backup linux ubuntu

Add a comment

I had a need to put an ftp server on my slicehost slice so someone could upload stuff to a site I was hosting. I'd rather avoid ftp as a potential security hole but the alternative is to try to convert them to sftp and also the E editor only supports ftp.

I settled for vsftpd as the ftp server but it took ages to get this person's login to work. I had him set up chrooted to the directory he needed to be in and with his shell set to /bin/false to prevent him logging into a shell. When testing I couldn't log in as him without getting a generic error 530, login denied according to the log file (which didn't feel the need to say why login was denied). Of course my own login was fine.

The answer was in the vsftpd faq, it seems that vsftpd looks through a file called /etc/shells to see if the person connecting has a legitimate login shell and /bin/false wasn't in there. It says this check can be disabled but the incantation didn't work so I had to add /bin/false to the shells file.

I don't quite understand the logic of this design. Isn't it fairly standard to have users who can ftp in but not login? The /bin/false trick was following a precedent from the noble ubuntu/debian distributions.

I'm getting into the habit now of adding any file I edit in /etc to subversion (as noted here), if only as a way to keep track of which ones I have fiddled with. The 95% that I don't need to touch are not in subversion. I like this, I can recall what I did and why (through subversion comments) which will help me restore the system or replicate it. That way, next time I need to install vsftpd I can recall what other obscure system files need tweeking.


Filed under: ftp linux subversion vsftpd

2 Comments

I forgot to blog that over christmas I had a brief look at the state of the art in linux desktop distributions. I tried three, two from cover disks in 'Linux Format' magazine:

Ubuntu 7.10
Interesting to see that the ubuntu CD is now a live CD that boots to let you play with it but the desktop has an 'install' shortcut so you can install it as well. Nice presentation.
Fedora 8
This installed nicely and was ok, a bit like Ubuntu but blue. Seen one gnome desktop, seen them all.
PCLinuxOS
This was an interesting new distribution that uses KDE rather than gnome and also uses apt for repositories which I still prefer to rpm/yum.

These distributions all have the nice new Beryl/Compiz guis to give Vista style windows animations (I like the bouncing effect) but what I really liked was the 'cube', a quick way to move between virtual desktops using the keyboard. Unfortunately none of them would work properly with my home desktop multi-monitor setup despite hours wasted editing X config files. Is it really at the limit of modern computer science for X to not get confused as to which monitor is which? Do microsoft have a patent on it? I got it running apart from the title bars not appearing on windows (ffs).

I ended up installing PCLinuxOS on my laptop (Dell D410) as I decided I like the depth of KDE compared to gnomes attempt to mimic windows 'simplicity'. Unfortunately I'm now in a situation where I have to sign in as root to get it to connect to a wireless network (argh). There's probably an easy way to do this but in the googling I have done it has eluded me thus far. If it weren't for this I'd be perfectly happy with it on the laptop. I'm not sure the battery life is as good as it is with Windows but with its extended life battery it runs for a couple of hours between charges which is about as long as I get to use it.

Conclusion: the year of the linux laptop maybe, probably not the desktop.


Filed under: linux ubuntu

Add a comment

I've been testing my C libraries by compiling them into ruby extensions and then using ruby's unit testing to test them. Under Windows I had it all running nicely and I could run a main test script that would invoke all the other test scripts. Sweet.

Then it came to getting it running under linux (the target system) and while the unit tests ran fine individually, when I tried my main test script I was getting weird errors from my test extensions, including segment violations (!).

It took me a while to track down the problem but it turned out to be due to the behaviour of gcc and the linux program loader. All my test libraries were loaded into one ruby process and because they all contained functions with similar names it became a bit of a lottery as to which function in which library was called. I am used to the behaviour of windows dll's where all functions are by default hidden from the outside world unless you explicity export them. gcc/elf/whatever seems to export everything from shared libraries (linux equivalent of a dll) by default with hilarious results.

In version 4 of gcc they have added a facility for hiding these internal functions. I solved my problem as follows:

  • Add '-fvisibility=hidden' to the gcc arguments to cause all functions to be hidden by default.
  • Add this code to my stddefs.h:
       1  #ifdef _MSC_VER
       2    #ifdef BUILDING_DLL
       3      #define DLLEXPORT __declspec(dllexport)
       4    #else
       5      #define DLLEXPORT __declspec(dllimport)
       6    #endif
       7    #define DLLLOCAL
       8  #else
       9    #define DLLEXPORT __attribute__ ((visibility("default")))
      10    #define DLLLOCAL __attribute__ ((visibility("hidden")))
      11  #endif
    
  • Change the functions that ruby calls to load the ruby extension to the following form (i.e. add DLLEXPORT):
       1  /*
       2   * Initialise the test class.
       3   */
       4  DLLEXPORT void Init_testtimer( void)
       5  {
       6      VALUE oMyClass = rb_define_class( "TestTimer", rb_cObject);
       7      rb_define_method( oMyClass, "initialize", test_initialise, 1);
       8      rb_define_method( oMyClass, "TimerSet", test_TimerSet, 1);
       9      rb_define_method( oMyClass, "TimerUpdate", test_TimerUpdate, 1);
      10      rb_define_method( oMyClass, "TimerStart", test_TimerStart, 1);
      11      rb_define_method( oMyClass, "TimerTest", test_TimerTest, 0);
      12  }
    

These functions are the only ones that need to be visible outside the library.

Results:

images/TestsDone.gif

Filed under: c gcc linux ruby

Add a comment

Somebody at work was fiddling with the fuse box and took out all the servers in the IT room. I rebooted them all but our main file server wouldn't boot, the hard disk partition was fried.

I used a knoppix CD (excellent tool for any pc that won't boot from its hard disk) to delete the corrupt partition and then reinstalled Windows 2k server on it. Experience has taught me that there is little point in trying to repair windows installations. Fortunately this file server is set up with two disks, one for the OS and another for the data. This is a nice arrangement as if either disk dies, that's approximately half the work required to get the thing back up. I only had to reinstall Windows.

Things were back online by lunchtime, the only problem being that one of the computers in the building was unable to access the new shared file system: mine! Vista strikes again (this is one reason why I am using Vista, to iron out these sillies). It wouldn't connect to the file share without prompting for user name and password and it wouldn't accept any that I gave (apart from those for a local account on the PC, it wouldn't accept domain account details).

I decided the problem may be that in my haste to get the files online and people working, I omitting to install the latest service packs on the server. I ran the setup for service pack 4 and then remotely rebooted the server from home early this morning while nobody was using it. I connected to it using an ssh tunnel and ultravnc. For reference, the ssh tunnel command was:

ssh -L 5900:192.168.0.54:5900 me@work.com

This is saying, 'connect port 5900 on the pc 192.168.0.54 on the remote network to port 5900 on my local pc'. I connected to a linux server and used this as a relay to connect to the file server. I was able to open ultravnc at 127.0.0.1:5900 and see the windows desktop of the file server. Secure, magical, free. Yes, I could do all this with VPN's, Windows Remote Desktop, Terminal Services or whatever but ssh/vnc is much easier to set up and is immune to random weird Active Directory problems.

I opened 'Computer Management' and 'Shared Folders' and 'Open Files' which gives a nice list of who is using the file server. One user had 'desktop.ini' opened, nothing important so ZAP.

Anyway, the service pack did the trick and when I got to work Vista connected instantly.

Lessons learnt:

  • Know where the Windows Install disks are
  • Have the licence numbers printed and hung on the wall (not in a file on the server that just died, in an Access 2003 database, in a room full of servers with no copies of Access).
  • Buy a UPS, although it runs the risk that nothing ever fails and everyone thinks administration is easy. With the right tools it is, but don't let the world know.

4 Comments