Friday, January 30, 2015

How Does This Remote Work?

As sad as it may seem, there are some applications and utilities I use in my Network Administrator position which are simply not available for PPC OS X or Linux that are essential to doing my job in a effective and efficient manner.  One in particular is managing our vSphere 5.5 virtual environment and infrastructure.  VMware's vSphere Web Client requires Adobe Flash (minimum version of 10.1.0), which is of course, not officially supported on the PPC architecture and hasn't been for sometime. Even if it was, I have a strong feeling it would perform poorly.

I decided to try out a few pieces of software that would allow me to connect either via VNC or RDP to other machines on our network and to other PPC machines at my humble abode.  The first one I attempted to use was the well-known and popular Remmina application, which I was surprised still supported the PPC architecture. Remmina is incredibly straightforward and has a unique array of settings you can adjust to best fit your needs for each remote session/device.  What I find most useful is the fact that you can save as many individual connections as necessary for each of the devices you would or might be needing to connect to while being able to maintain separate settings for each one, including resolution, color depth, performance, etc.  The VNC connection to my G4 PowerMac running Jessie works flawlessly, so I'll continue to use it for my VNC connections.

Upon trying to RDP into my Windows 8.1 machine, I would initially receive the login prompt, where I could input my username, password, domain, and accept the certificate, but from there, a simple generic error would appear right afterwards as such:

Not very useful, am I correct?  This was with the default Security setting of Autonegotiate under the connection's Advanced tab. By leaving the setting as is, Reminna should work with Windows 8.1 to figure out what security was to be used automatically whether that be NLA, TLS, or RDP.  Just as a test, I tried to set the Security to each of the 3 available individual options with different failed results. What I needed was a bit more information in order to determine the cause of the failure.  I decided to run Remmina from the terminal to watch for the output that would appear while trying to RDP to my 8.1 PC.  This is the more detailed error I received during the connection attempt:

SSL_read: Failure in SSL library (protocol error?)
Authentication failure, check credentials.
If credentials are valid, the NTLMSSP implementation may be to blame.


First of all, I love the error.  Seems like a bit of finger pointing. Anyways, based on that information, I figured it has something to do with Microsoft's NLA, or Network Level Authentication, which was a new feature for Windows RDP 6.0 made available as of Windows Server 2008 and Vista (Windows XP SP3 supports it as well now).  NLA requires users properly and successfully authenticate themselves before establishing the actual RDP session. As stated in the article above, this helps combat DDoS attacks because no resources are used on the remote server/device until authentication is successful.  Somebody could previously make an unprecedented number of connections to a remote device without needing to authenticate themselves thus using this as a way to consume all available resources on the remote device.

My initial thought was that perhaps it was an incomplete implementation of NLA in Remmina or a bug, so I downloaded and tested both rdesktop and freerdp.  Both are command line only with freerdp actually being a fork of rdesktop with supposedly better support for newer protocols such as NLA.  However, I received the exact same error message (verbatim actually) with both utilities as I was with Remmina.

At this point, I ended up spending quite a bit more time trying various things to overcome the issue and ended up deciding to go with a workaround for now by disabling NLA on my Windows 8.1 laptop.  You can do this under Control Panel -> System and Security ->  Allow Remote Access.  Under the window that appears, uncheck the option "Allow connections only from computers running Remote Desktop with Network Level Authentication (recommended)".  Again, the caveat being that disabling this will make the connection less secure, but for the meantime it will have to do.  Thankfully (sort of), this worked and I was able to RDP to the PC witih Remmina via my saved connection.  On the downside, the colors were way off and there was what seemed like a heavy blue tint to the display.  I tried adjusting the Color depth option to set it at the highest possible value of 32 bpp (True color) as well as trying to make RemoteFX work, but the results were again, exactly the same.  Here is a screenshot of what I'm talking about:
(Makes me think of this song)

Eventually, I tried rdesktop again (since I had disabled NLA on the Windows 8.1 PC), but this time with successful results all around!  Here is a screenshot of the resulting RDP window:


From the command line, I simply ran the following:rdesktop -u HarryPotter -d Hogwarts 192.168.10.1

Values have obviously been changed for security purposes. The -u is for username and the -d is for the domain name.  I could have passed in the password as well, but decided to let the connection ask me for it. The colors were near perfect to that of what I saw when actually sitting right in front of the PC. However, the default window size was a bit small. To be honest, I'm not sure what the dimensions were nor did I care to look. What I did care about was adjusting that default window size when starting the connection so that it would occupy the entire display of the PowerBook, which again, has a resolution of 1440x960.  Even if not the entire screen, perhaps a good portion of it. So as usual, I dove into rdesktop's man pages to see what other flags and options were available to make this happen.

To adjust the window size, you pass in the -g option (g for geometry!) or try out the -f option to have it start in full screen mode.  For the -g option, you can either pass in a percentage value, which is what I did first, or it pulls the value from the extended window manager hints property (a.k.a _NET_WORKAREA).

Here is a screenshot of the entire screen with a set screen size of 90% for the RDP session:

Based on what little I know, it appears the blue tint with Remmina is an implementation bug.  I'll probably look in the next day or two to see if the bug is out there and if it isn't I'll do my due diligence and file a bug report.

The application only uses between 10 - 15% and at times up to 20% of the CPU on my 1.67 GHz PowerBook, so impact is usually small and does not affect performance of other applications I have open.  Most of that CPU consumption is to redraw the screen as of course all actual applications on the remote session are running on the remote machine.  As I had mentioned earlier, what I really wanted to do was access the vSphere Web Client, which I can do in a Mozilla browser on the PC while still accessing all the applications I use on my Debian install.

Lastly, there are a few oddities I still need to work out with this setup.  The first being that when I initially remote into my PC, it brings up the login screen where I have to actually select the Other User option as it will not let me sign in automatically to my existing desktop session.  The Other User option already has my username entered (assuming because it was the last user to login) and once I type in the correct password, it connects me to my existing desktop session.  Secondly, I cannot run the session in full screen mode as I have not yet figured out how to successfully either exit the rdesktop application or change applications on my PowerBook as the Option (Alt) + Tab shortcut actually switches applications on my Windows machine. I'll play around with each of these and provide updates (good ones hopefully) in a future post.

Again, I have not researched the small possibility of somehow running Adobe Flash applications on PPC and have yet to play with any of the Flash alternatives such as Gnash or Sparkle that are available on Linux.  I'm not quite yet ready to try and tackle them at this current time.  If I do, I'll probably try it out first and use it only on my G5 as it has more adequate processing power and memory needed to provide somewhat smoother playback and performance.   My luck, is that by the time I do figure something out, VMware will have hopefully decided to rewrite the Web Client in HTML5, which should happen sooner rather than later.  I say that because even YouTube recently announced that HTML5 is now the default video playback format in most modern browsers.  Now that is something to be stoked about!


Monday, January 19, 2015

Pour Me a Bowl Of Serial

Hopefully you'll enjoy yet another one of my funny and sometimes not so clever titles that are indeed relevant to my posts.  One of my job responsibilities as a Network Administrator is connect to and configure new network devices, most often either a layer 2 managed switch or a Cisco router. To do some of the initial configuration, I usually connect the appropriate Female DB-9 to RJ-45 console or F DB-9 to F DB-9 serial cable and I'm off on my way using a program such as Putty or HyperTerminal when using my Windows (not)workstation..

Fortunately (not unfortunately) the aluminum G4 PowerBook does not include a built in serial communications port.  However, I found a Tripp Lite male USB to DB9 serial adapter cable in storage and decided to see if I could make it work with my Wheezy install to configure a couple of brand new Cisco routers that will consolidate a bit of our spoke and hub network design. In short, just another way to make this old PowerBook useful in my everyday life.

Not knowing if it would work without any extra configuration or drivers, I decided to just plug it in and see what would happen.  But wait, what would I use to configure the serial communications interface and settings such as setting the bps rate etc?  Luckily, it's a well documented procedure.  It required a quick install of minicom and some very simple and straightforward initial configurations. Since there are PCMCIA serial adapters available, I should be able to also use my 1400CS to do the same thing, once I have put it into production.

Once minicom is installed, you'll want to run sudo minicom -s to start terminal emulation. This should bring up the software's configuration menu.  To start, you'll first want to arrow down to Serial port setup, hit Enter and then tap the A key to configure the filesystem location of the serial device you'll be using for your serial com port connections.  Since I was using the USB to serial adapter, mine was located at /dev/ttyUSB0.  Depending on your system and which USB port you use, this device may vary.  The fastest way to determine the device name is to change directories into the /dev folder and do an ls -alh | grep ttyUSB. It will almost always be ttyUSB0 though, so no worries there.

Once you have set the correct device location, hit Enter to be able to choose a different menu option.  Depending on the device you are connecting to (be that a router, switch, server, modem, etc) you may need to also adjust the Bps/Par/Bits setting to something other than the default 9600, which happens to be what you usually set it to in most cases. You'll also want to consult the vendor documentation of the device you are connecting with to see whether or not Hardware and/or Software control need to be on or off. When you are finished, hit Enter again and arrow down to Save set up as df1and hit Enter again. This should bring you back to the initial configuration menu, so go ahead and arrow down to Exit and hit Enter twice more. You should now see communication with the attached device. 

When you are finished, you can exit the minicom session by simply hitting Command + A, and then hitting the "x" key.  This should return you to your expected shell prompt.  Now have at it and enjoy another practical everyday use for your ole PowerPC machine.

And finally, in Debian PPC related news, I filed my first Debian bug report #757015 (well an extension to an existing one confirming I had the same issue) against the PPC Iceweasel package. It's a small subtle issue resting among many in a deep sea of Iceweasel bugs, but apparently one other individual has ran into the same issue.  In short, my synced XMarks folders do not appear in the Bookmarks toolbar.  It's not an XMarks issue because even just creating a simple folder and placing it in the Bookmarks toolbar does not work.  I tried it with a brand new and clean profile as well with the same results. However, when viewing my bookmarks via Command + B, it shows the folders as being on the Bookmarks toolbar. Web page bookmarks still appear and work as expected and it's not due to my only other extension I have installed, which is AdBlock.  I don't have high hopes for the bug being squashed, but at least it is out there.

Speaking of bugs, you may want to join the bug reporting party over at PowerPCLiberation. We need to do our part in whatever we can to improve the Linux PPC experience and platform!

Let me know if you have any questions or thoughts in the comments below.

Monday, January 12, 2015

New (Old) PowerBook Teardown & Resurrection

So as noted in an earlier blog post, I recently purchased both a PowerBook 1400CS and a PowerBook 190CS.  I plan on using the PowerBook 1400CS extensively in as many creative and useful ways as possible at both home and at my network administrator position.  Unfortunately, neither PB came with a power adapter, so for the first couple of weeks, I could not even determine whether they worked or not.  One thing I did not want to do was jump the gun and purchase some no good, rotten, dangerous, self-detonating piece of junk replacement adapter, but instead took my time to find a genuine Apple replacement for each.  Luckily, I scored on the 1400CS first although I'm not sure it's the official adapter originally shipped with a brand new unit.  It is a 45W adapter with a model number of M4402. In either case, it's compatible, works, as well a genuine Apple product/replacement.


Forgive my terrible photography skills.  My wife is a professional photographer and would be ashamed of these, but rightfully so!

Before powering on the near 7 pound beast (6.7 lbs according to everymac.com), I decided to tear the PB apart first just to take a quick look at its innards and see what it had for specs as well as make sure that from a quick glance everything seemed clean and in good overall condition. Never having owned a 1400CS before, I knew very little on how to tear it down appropriately, but my gut said it would be much easier than what it takes in this day and age to take a part a newer MacBook Pro or an iDevice. Wanting to be careful but curious,I decided to search the web for walk-throughs, but promising results were scarce.  Luckily, iFixIt, had a few walk-throughs for various parts of the PowerBook, but nothing too difficult like the motherboard or trackpad.  Eventually, I came across a 1400CS repair manual available here. This guide has an immeasurable amount of useful information, although the hardware replacement guides are a bit difficult to understand, but I attribute that to my lack of ability to properly read and follow instructions very well.  Your results may vary. :)

I removed, the Nickel metal hydride (NiMh) battery (which of course is shot), floppy drive module, speaker grille, cover plate, and keyboard to discover the system came with an upgraded 216 MHz NewerTech NuPowr G3 CPU, two memory modules, a video-out card (HDI45 slot), and an original 750 MB Apple Iomega HD.  Safe to say, I was quite pleased with these findings, although worried I might have a model with only 12 MB of onboard RAM.  Not sure yet whether my particular model supports 64 MB of RAM or only 56 or 60 MB as again, I do not yet know how much onboard RAM it holds and I did not look closely enough at either of the two memory modules to determine their capacity. The fact that the drive is 750 MB, makes me believe it was originally a 1G 117 MHz 1400CS. Sadly, the current 56 MB is not enough recommend memory for running Classila, although there are workarounds.

Here is a picture of the partial teardown:

Now that the system was partially torn down, I thought it might not be a bad idea to wipe it as clean as I possibly could, including the external shell, keyboard keys, speaker grills, and adapter, etc.  I will admit that the thorough cleaning has helped restored a look of being close to brand new. From there, I completed reassembly, plugged it in and waited.  Instantly, I heard the well known Apple startup sound, although it sounded terrible (not too worried about this though).  And as expected, the hard drive made a terribly loud grinding sound, so I'm a little concerned about the remaining life it holds but the PowerBook eventually booted into Mac OS 8.1!  Success!

However, my joy would be short lived as I soon discovered that the trackpad did not work.  Not only that, but I did not have an ADB mouse on hand to still peruse the system and its goods.  After double checking to make sure the trackpad ribbon cable was firmly inserted into its slot on the motherboard, I decided it was probably shot and started the hunt for a replacement as well as an ADB mouse.  I didn't necessarily need the mouse, but I thought it might be handy in the future for the other older Macs I acquire, tinker with, and restore.  While I was out shopping for replacement parts, I thought I would go ahead and purchase a HDI45 to DB15 adapter (Part # 590-0831-A) which will also eventually require a DB15 to VGA adapter (likely with dip switches) in order for me to have the ability to plug the PowerBook into any VGA display, albeit it at a maximum low resolution of 800 x 600.

I must admit that replacing the trackpad was simple, but yet at the same time incredibly tedious and difficult.  There were two screws I did not see as they were covered by circular stickers of the same color as the PB itself.  As a result I ended up busting the old trackpad while trying to remove it. Those two screws can be found on the left and right rear of the device, right at the seams whether the bottom and top halves of the PB's base meet.  You'll want to carefully remove these two circular coverings and keep them safe for the replacement trackpad. Of course, remove those two screws as well. As for the old trackpad... oh well. It was shot anyways and I was still able to salvage the screws and use them to properly attach the new trackpad. Re-inserting the trackpad ribbon cable was incredibly frustrating as my large hands proved to be a nuisance.  Luckily, the replacement trackpad works perfectly, (as does the used Apple ADB mouse).

It doesn't stop there. The uphill battle continued.  Come to find out certain keys on the keyboard were not working either including, j, u, m, p (funny I know).  A working replacement keyboard did not do any justice either, so it has to be something with the connector slot on the motherboard.  Perhaps there is a piece of debris blocking access to some of the contacts.  I'm still working on this one, but hopefully I have it resolved soon without having to go as far as replacing the entire motherboard.  That would be incredibly sad, but call me crazy, because I'd do it jump, I mean just because I want this thing in perfect working condition.  On the bright side (pun coming), I also found out the brightness and contrast controls to the right of the display work great.  Please let me know of any possible ideas or fixes for the keyboard/key issues.

At this point in time, the only other vital missing piece is a working CD-ROM drive module I could insert in place of the existing floppy drive module.  I have yet to locate one that a) was not incredibly expensive b) not for sale from some sketchy website or c)included with the purchase of an entire 1400CS laptop.  I've been keeping an eye on the LEM swap group as well, but if you know of anywhere that has them for sale at a more reasonable price, let me know!  Other than that, I'd like to find a working Ethernet card so I can cable it into my existing network.  I would do a wireless PC card, but from what I have read, no existing PC card offers support for any wireless protocols after 802.11b.  I wouldn't have minded if it supported 802.11g, but I can also understand why no such card is not available.  The machine simply wouldn't have enough processing power to adequately support it.

Once I do have a working CD Drive, I plan to install the latest version of FreeBSD.  I've already downloaded the latest copy of FreeBSD via the torrent networks and burned to a disc using my G4 PowerMac (Apollo11). From there, I may use it as a machine to handle most of my SSH connections to various machines as well as a tool for running various command line utilities. Even though the PB 1400CS is approaching 20 years in age, I strongly believe in the fact that this old laptop can still prove incredibly useful and at times even nostalgic. I'm so eager to put this machine into everyday production!

That's it for this post.  There are a few interesting pieces of software installed I would like to discuss briefly in the coming weeks that are in my opinion kind of cool.  Otherwise, I'm just tidying up the last few pieces of the introduction to Clang post, so look for that in the next week or two.