2007-05-20

OpenSuSE 10.2, Fedora Core 5, Kubuntu Fiesty Fawn, Vista, XP, VMWare, Windows Development, Open-Source, Java, Computer Forensics, and Everything Else

In the screen shot below, the black space on the bottom of the left comes from the image having to be rectangular. My screen ends where the black begins on the left. The black on the right is where I have Windows resolution set smaller so I don't have scroll bars on the outside of my screen. I have a newer resolution I'll post more images of once I get them. I'll have to think of something cool to show you like developing Windows, Linux, and Java applications at the same time.


My employer targets Microsoft platforms. I also have to create ISAPI Web Applications and Windows Desktop Software (using Windows APIs). However, I end up writing Java source more than anything as part of some of our contracts.

Personally, I have always loved Linux and all the utilities and flexibility which comes with it; the entire operating system is built for computer work and application development/software engineering. The reality is no matter where I work, even for myself, I will run into Windows development, so, no matter what, I can never (in the foreseeable future) do away with Windows development and Windows.

I do a lot of different computer related things in the software field. I have recently been working on becoming a certified computer examiner and getting into computer forensics. I have been using Linux a lot for forensics. Unix class systems such as Linux offer a lot for forensics as there are many ways in which to access data without mounting a drive and altering time stamps or data; one can even see exactly what much of the source code is doing if something comes into question. Windows makes this much harder.

My development laptop's screen started acting weird, so I decided I needed to get another backup computer so I could fix it. My current computer was my last backup. This time I went to Best Buy and bought a Toshiba Satellite P105-S6177.

It has some decent (not awesome) hardware built in. However, it is not without issues. Even while running Vista, the operating system which came pre-installed, it could not hibernate without blue screening. I know it was blue screening because the error message in the log said it was, but the screen would just go black any time I tried to hibernate; the patch Vista found on the Microsoft web site did not remedy the issue. One certainly wonders why they pay 299.99 for an Ultimate Upgrade with noticeable issues such as this. I have used hibernate ever sense it became possible. It seems to save me a lot of time as I use it daily unless forced to reboot.

After the computer seemed to be having a few issues with Vista, I decided to try a new method for development. I have used virtualization for different things such as testing on different versions of operating systems, and the company uses virtualization for web servers. I have not tried to use it, until now, to run a mutli-OS desktop development environment.

I have used dual and triple booting, but I wanted to be able to work on different projects in different contexts at the same time and on the same machine for multiple operating systems, and I have been wanting to see what it would be like to get to use Linux all day every day, setup a multi-monitor X system, and contribute more to a Linux distro.

OpenSuSE 10.2 seemed promising and I have used 10.1 on another system for some time, so I ended up going with it. I downloaded CentOS 5 (which is Red Hat Enterprise for free), but it could not detect the graphics card and monitor. I even gave Kubuntu Fiesty Fawn a test drive, but I didn't like it as much as I like SuSE. I have used CentOS for different things and like it a lot, but I needed to get going as fast as possible and had hardware issues from the beginning, and I find the SuSE administration tools extremely useful. The YaST tools are not 100% perfect but what is.

I have used Linux off and on since 1996. I had all kinds of cool features when consumers thought Windows 95 was cool. Through the years I have given different distributions a shot including different Debian based ones. Mostly I have been back and forth with Red Hat and SuSE, and I have always had a place in my heart for Slackware even though I don't use it any more (nothing personal...I'm not using Red Hat or Fedora at the moment either). I think mostly I love the word slack :-). I also use Helix and Knoppix for specialized tasks.

I think it is important to make sure everyone knows this is not my first time with Linux as it wasn't like I just installed this from a CD or DVD and all was good without some manual labor. It took a week or so to get this computer just right.

The issues:
  1. Dual Monitor Support:

    Sax2 setup the main screen fine. It could not setup dual monitor support correctly. Even cloned display was incorrect. I had to edit the xorg.conf file by hand. Once configured I noticed the support works better than the dual monitor support under Windows XP. I didn't even have to have extra software to have a taskbar on each screen.

    I had to read and figure out exactly how the X configuration files work. Once I spent the time to learn the files, I quickly learned I could use Sax2 to get the initial file created. Then, by reconfiguring for my specifics I could get it working correctly. I can use Xinerama which lets me drag from screen to screen or is one giant desktop, I can use the normal view which is an X server on each display, thus each has its own sepearte taskbar and I can not drag between the two, or I can use a cloned display which isn't very useful for anything except maybe a cash register, kiosk, dual developers on the same machine during a code review, or something similar to these.

    The big gotcha on my system is that the two screens are not the same size and resolution. They are even different aspects. One is a wide screen laptop display capable of 1280x800 and some higher resolutions and the other a LCD monitor capable of 1280x1024.

    I noticed to really test the X configuration I had to completely reboot, otherwise it didn't look as it should and I would keep changing the file with no good result. I'm not sure if this is some type of a bug in X or something to do with a buggy ACPI system in the Toshiba or some other firmware issue. The LCD monitor is a zero configuration monitor which I push a button and it auto configures the screen layout based on its input.

    The display related sections below show some of the things. Notice I have the one mode for the external monitor. This might not be so good for other external monitors, but it is the only resolution,I have found, which works well with this monitor (a Samsung SyncMaster 960BF).
  2. Sound Support:

    I had issues with sound. I also had some other issues with USB device removal and certain devices not working once they were plugged in again. I had a suspicion these were ACPI errors. I could disable ACPI:
    apm=off acpi=off noapic
    and things worked correctly except for anything ACPI specific and no dual core support on my dual core CPU.

    I had decompiled my DSDT and had looked it over. I noticed it had a determination for the OS, so I set the boot parameter acpi_os_name="Windows 2006" per the decompiled Intel DSL code. This had no affect. So, I thought maybe this was an issue with something else. I had seen talk about ICH7 and the Conexant codec. I saw another post where the individual had completely hard coded the DSDT setting of OSYS, and was replacing ALSA with a newer version. So, I started to work through his steps. Turns out the first step, hard coding the DSDT setting of OSYS the Windows 2006 value (0x07D6). was all I needed.

    In total:

    I downloaded and built the Intel ACPI tools and compiler iasl and added them to the PATH.

    I then extracted my DSDT to my project folder using (you have to have started with ACPI enabled even if with bugs):
    cat /proc/acpi/dsdt > dsdt

    Next, I decompiled the code:
    iasl -d dsdt

    I then found the following code and changed it by commenting out the OS checks and hard coding the Windows 2006 value:
    If (CondRefOf (_OSI, Local0))
    {
    /*If (_OSI ("Linux"))
    {
    Store (0x03E8, OSYS)
    }
    Else
    {
    Store (0x07D1, OSYS)
    If (_OSI ("Windows 2001 SP2"))
    {
    Store (0x07D2, OSYS)
    }

    If (_OSI ("Windows 2001.1"))
    {
    Store (0x07D3, OSYS)
    }

    If (_OSI ("Windows 2001.1 SP1"))
    {
    Store (0x07D4, OSYS)
    }

    If (_OSI ("Windows 2006"))
    {
    Store (0x07D6, OSYS)
    }

    If (LAnd (MPEN, LEqual (OSYS, 0x07D1)))
    {
    TRAP (0x3D)
    }
    }
    */
    Store (0x07D6, OSYS)
    }

    Then, I compiled the code using:
    iasl -tc -f dsdt.dsl

    There will be errors and warnings, but the -f forces the dsdt.aml file to be created even though there are compiler errors. If you try to fix the errors you get from this code it will not work. I have already been down that path. Apparently the _T_0,_T_1,etc variable/storage names are required even though the Intel compiler says they are reserved words which I could find no documentation. I assumed they were just variable names, but this must not be the case for these particular storage identifiers with these names.

    Next, you need to be root:
    su -
    enter your password, and you'll be back at a prompt. Now cd back to your project directory.

    Next I copied this to the etc directory.
    cp dsdt.aml /etc/DSDT.aml

    I then started YaST. I then went to System|/etc/sysconfig Editor|System|Kernel|ACPI_DSDT. I set it to /etc/DSDT.aml. I clicked Finish.

    Next, we have to tell the Kernel where to find it (after setting the ACPI_DSDT in YaST SuSE now knows where the DSDT we want to use is):
    mkinitrd

    Then reboot your system. Either use the user interface (Restart) or type:
    reboot

    You should now be able to configure your sound card and it work. If the card is already configured, even if no sound was coming out previously, you should notice sound upon reboot. This was my experience.
  3. IRQ Balancing:

    Looking in /proc/interrupts, I noticed that CPU 0 was the only CPU getting interrupts. The irqbalance start up script was not starting irqbalance even while telling it to manually on the command line. Looking in /etc/init.d/irq_balancer (the script which runs it), I noticed this code:
    start)
    echo -n "Starting irqbalance "
    if [ $PHYS -gt 1 ] || [ $PROC -gt 1 -a $PHYS -eq 0 ] ; then
    startproc $IRQBALANCE_BIN
    # Remember status and be verbose
    rc_status -v
    else
    rc_status -u
    fi
    ;;

    where PHYS and PROC are set by:
    PHYS=$(grep '^physical id' /proc/cpuinfo | sort -u | wc -l)
    PROC=$(grep -c '^processor' /proc/cpuinfo)

    So, any system must have at least 1 CPU, so the test:
    $PHYS -eq 0
    will always fail, so I changed it to:
    $PHYS -eq 1

    and now irqbalance is actually started, and works correctly on a multi-core system versus only working on a true multi-processor system. The only bottle kneck now should be the CPU cache locking and serialization.
  4. Installing and Configuring VMWare:

    The free version of VMWare I'm using doesn't work directly on SuSE. I had to make sure I had all the source packages for SuSE and dependencies for VMWare installed. Once I had the dependencies installed I had to run vmware-config.pl and allow it to build the modules for my kernel. Once I did this VMWare seemed to run fine.
  5. VMWare Sound Issues:

    VMWare sound doesn't work exactly the best. Actually, without doing a couple things it would make VMWare lockup while it had input control, so while it was locked up I could not operate my system until it unlocked. I found a VMWare forum message which mentioned adding a serial port to the virtual machine and in the same message mentioned setting sound.smallBlockSize and sound.maxLength to some value other than the 512 default.

    I found on my system this required setting the values to 64 and also adding a serial port which output to a file. Anything else and I still had the issue, though if I had a real serial port on my system I'm sure hooking it up to the virtual machine would have had the same effect as the fake one. Sound still has some issues, but the performance is not hindered and doesn't lock up the virtual machine and it doesn't break up all the time. I tried to use 128, 32, 48, 256, etc, but 64 was the only one to work correctly.

    Some of my issues may come from using Napster. I have a paid Napster account, and it says it only runs on XP, and Napster crashes quite frequently on Vista. So, I can't be sure if the issues are all VMWare.
Now that I'm past the issues, everything seems to be fine. It is a really awesome environment, and I think everyone should have one. I can program just about anything I want. I figure if I ever upgrade to VMWare Desktop I can even install MacOS, but I have not confirmed this as being supported, but it would be cool to be able to developer for all these different OS using Linux and virtual machines. When and if Xen (Linux Virtualization) gets to the point it can support Windows and MacOS and others such as Solaris, I'll give it a shot, and hopefully, I'll have a reason to get an even bigger drive!

If any of you go to setup a system like this let me know your experiences. It isn't the easiest thing the first time you run into new issues such as ACPI or try new things such as Xinerama with different monitors and resolution, but in the end, at least for me, it is worth it. Have fun!

Update 2007-05-24
I found out I had an issue with USB and VMWare as SuSE 10.2 and many other Linux distros no longer support usbfs. I downloaded the 30 day trial for VMWare Desktop 6, and it is amazing. It works so much better. I still have some sound issues, but everything else works so much better; even the display is faster. VMWare Tools is also a life saver. I definitely recommend this setup to others. I can even run Vista or XP as a large desktop which covers both my X terminals running in Xinerama. Good stuff! I'm going to purchase a commercial license for VMWare.

Update 2007-06-01
Multiple monitors and independent taskbars
I decided to post a new screen shot. I have setup my desktop with some new panels. KDE is amazingly configurable. You have to play around with it a bit. Once you figure it out, it is just awesome. I have, on both monitors, a similar taskbar, and each taskbar is independent yet shows the same windows. Check out the window floating between both monitors.

Notice the same titles are showing on the bottom. I can easily drag between the monitors, yet I have both showing all processes. I also have different applets and panels in each taskbar panel. On the right I have a color picker, the weather, and even a world clock. On each I have a trash can which makes it easy to move files to the trash bin.


Here is one I like: Linux and Vista side by side thanks to VMWare
The new VMWare Desktop does much more than the free version I was trying to use. For instance, I can full screen VMWare on a single monitor. I can then move my cursor freely between the two without pressing a key. I can also copy and paste from the virtual machine to my host operating system. In this case OpenSuSE 10.2. I can't drag a file or text across the boundary, but I can copy the file then paste it. I can do the same with similar data flavors as long as the target accepts the value.

finally, I can have VMWare allow the guest OS (Vista in this case) to use both monitors. This is so cool, and so flexible.

Anyways, I finally figured out my sound issue was only with Napster. Windows Media Player itself works fine. I can jam out to WMA and MP3 files easily using Windows. I get the flexible programming world of Linux. It is really powerful.

The only issue I now seem to have is that many Windows programmers seem to have crazy ideas about how to use file names. Seems they believe if they use filename in one location they should use FileName in another and FILENAME in another. Well, let's just say, sharing file systems is hard with software developers inconsistencies. I need to figure out a good case-insensitive file system to use or I need to be able to tell Samba to do this for me, so expect at least one more update to this blog post.

Update 2007-10-14
I finally have suspend/hibernate working correctly. Apparently it all had to do with the SuSE version of s2ram (suspend to ram) not knowing my machine (the actual hardware identifiers). I had to go into:
/etc/pm/config

and set:
S2RAM_OPTS="-f"

or "force" and this not only made suspend to ram from the applications menu work correctly, but apparently suspend to disk also requires suspend to ram to function properly. If suspend to ram fails then apparently suspend to disk doesn't just quit and leave the computer system running, it does something and then writes it to disk. You restart your computer, it will run for a few minutes, then it will just turn off completely without any warning forcing you to lose anything you were working on :-(.

I am very pleased now. I can truly hibernate this hardware, and it seems to work correctly. Even the wireless NIC starts itself correctly without me having to turn it off and back on and even reconnects itself. Previously , when hibernate was working incorrectly, I would notice that s2disk apparently didn't store the hardware state correctly as the wireless NIC would always have to be turned off, with the physical switch, then turned back on after 10 seconds (and you did have to wait the 10 seconds...any less and it just wouldn't work at all) just to be able to connect to the internet or network. Previously that was all futile as the computer would shutdown after it had been running for a few minutes. Now all seems well, and it has made life so much nicer with this system.