dcsimg

A Virtual Solution for Mobile Development

Who needs a Dell when you can have a VirtualBox?

How long to get a new Dell?!

In my last column, I shared the news that my Dell Latitude simply gave up on me.

Thank you to the one reader who suggested that I could recover things by booting Linux from CD — I would have gladly tried that if the machine would have even POST-ed. She was just dead.

No problem, my company is a Dell reseller — we’ll just get another one here pronto and I can move my data over, re-install my compilers and get back to work, right?

Wrong. Delivery date was weeks out and I had work to do. Being tied to a desktop computer just didn’t feel right. I looked at some of the “retail” laptops at Staples but couldn’t bring myself to purchase 1/2 a laptop at 2/3 the price of a “real” machine — like the one I already had on order from Dell. And, besides, I had a somewhat seldom-used MacBook on my desk, it wasn’t as if I were entirely without a laptop.

Now, if I were to go out of the house with a MacBook, my first preference would be one of those cool, aluminum uni-body types — not the girlie-looking white plastic version sitting on my desk. I purchased it so I could do some iPhone development over a year ago. It’s just a color, I know, but thinking back, I could have purchased basically the same device in black with a little more video ram. Hindsight is 20/20 they say. But, the thing has a 2.4 GHz Intel Dual Core — not too bad, particularly considering the fact that the new (and expensive) varieties are not all that much faster — and certainly not worth the additional investment considering what I was about to try next.

VirtualBox

Using the MacBook itself isn’t really all that bad — I have been looking for an excuse to use MacOSX a little bit more anyway. It is a pretty intuitive platform and increasingly, software development environments support OSX right out of the gate. If you doubt it, just go to a mobile software conference and everyone it seems is using a Mac.

The trouble was that I had a handful of applications for which I just had to use Windows. Yes, I know I should be using Linux — you can make the comments if you like. And yes, I could use the Mac VPN client and the RDP client to connect to servers and run a couple of administrative applications at my consulting firm — software applications that only run on Windows. However, the idea of running Windows 7 “inside” my Mac was too enticing. So, I took the virtual plunge.

Armed with my MacBoox, a respectable 160GB, 5400 RPM hard drive and a meager 2GB of RAM, I ventured into the land of VirtualBox from Sun Oracle.

If you are not familiar with VirtualBox, you can learn more in this Linux Magazine article written by Ken Hess. My previous experience with VirtualBox was limited to using it for the Palm WebOS emulator environment. Using the same platform for running a full desktop OS intrigued me. And the price (free) is hard to beat.

After a couple of VirtualBox upgrades, most recently to version 3.1.2, I had a reasonably stable Windows 7 installation. However, it was awfully slow — yes, slower than one would expect, despite the virtual configuration.

After a Christmas Eve visit to the Genius Bar and a $200 donation to Mr. Jobs and his elves, I upgraded my MacBook to 4GB of RAM. Throw in a 500GB, 7200 RPM Hitachi hard drive and my MacBook was starting to show some brawn. Even if it is still the white plastic variety.

Even more cool is the nice wide-screen monitor on my desk which houses my “Windows 7″ environment in beautiful full-screen while I have the MacBook’s built-in display for running Firefox, Finder, iTunes, etc. Add to the mix the “Spaces” feature and I’ve now got four desktops x 2 monitors. Too bad I cannot get 8 GB of RAM into this thing!

OK, but can I get any work done you ask?

What about my files?

At this point my development files, and everything else I seemed to have accumulated over the past 37 months on my Dell, were still sitting on the orphaned hard drive. Borrowing a SATA/USB drive caddy from my network support friends, I copied the files over to a directory sitting in my home directory on the MacOSX side of things.

I was able to “share” the files via VirtualBox’s built-in \\vboxsvr sharing mechanism. However, the file access was pitifully slow. Unbearably slow. A number of Internet searches turned up some problems with NetBios over TCP, name resolution timeouts for every packet and other low-level networking stuff that just tested my patience. The guy who was responsible to procure for me a new Dell was getting quite weary of my constant inquiries regarding “shipping status”. After repeated “no update yet from Dell” remarks and other lame innuendo about Christmas season backlog and shipping delays, I decided I couldn’t turn back now and walked back to my office.

I was able to improve the speed a bit with some host file hacks. I even tried messing with different networking configurations — switching between NAT, Bridged and even “Host-Only” networking. The Host-Only option with a “virtual” NIC seemed to have decent performance for the file sharing between the Windows 7 partition and the MacOS environment, but I couldn’t hit any network resources, let alone the Internet. That was a non-starter.

I then switched on SMB sharing, killed the firewall on the Mac and was able to do a traditional “net use” file share from between the Mac and the Windows 7 environment. Ahh, now that’s more like it!

I now have my laptop running in a reasonable fashion. Programs are installed in the Windows virtual environment and all of my “data” is stored on the hard drive of the Mac. Data is backed up via Carbon Copy Cleaner and Time Machine and if I want to move my development environment to another machine, I can simply move my virtual Windows 7 image to another Virtual Box environment. Now, that is mobile computing! Well, at least for a programmer anyway.

The real motivation

For a long time I have wanted to have my development done in a more portable fashion. I have not enjoyed being tied to a particular install of Windows for so long — and this motherboard failure finally forced my hand to get to the configuration I wanted.

The setup is not perfect — I had one problem with a device driver from Microchip which blue-screened my VirtualBox. Yes, you can see the BSOD even on a virtual Windows machine — it was actually kind of funny — the first couple times. Then it became annoying. I wound up ordering a new microcontroller programmer (The PicKit2 in case you’re curious). It just arrived today, so I am off to see how it works. Me, and my white plastic MacBook. Who knew?

Fatal error: Call to undefined function aa_author_bios() in /opt/apache/dms/b2b/linux-mag.com/site/www/htdocs/wp-content/themes/linuxmag/single.php on line 62