Apple’s switch to SMB2 with Maverick and Developing with VMWare and Ubuntu

On Tendenci development configuration…. Through one of the thousands of sources of input that hit me in a given week between websites, newsletters, other programmers, employees and random people I talk to, it finally clicked with me the significance of Apple switching to SMB.

OK, to back up for non-geeks. Computers talk to each other and devices like printers using common protocols. Microsoft, going back to modifications to DOS has used SMB. (skipping a bunch of history here.) Fast forward to a few weeks ago when Apple released OSX Maverick for free. In the release of Maverick everyone talked about how it was FREE. They are giving away the software counting on us to buy the hardware. OK, I get that.

Tendenci Open SourceWhat they also did was change from their own network protocol, called Apple Filing Protocol, and switched to Microsoft’s protocol SMB. Wait, what? Why?

Well, first Apple made their OSX Server software $50 in the app store. A comparable server software package from Microsoft is $2500. So I purchased a Mac Mini server. Sadly with even 35 users it wasn’t that fast. AFP is slower that SMB I’m told. But they could have improved AFP. Instead Apple made the switch to SMB. This not only speeds up their server but most importantly it allows MACs to connect to local area networks managed by Microsoft Servers without any extra software or tech support needed.

Apple is moving into corporate America folks.

Apple owns the home/consumer market in my opinion, even if I have an android phone our house is full of mostly Macs. 1 or 2 PCs or Linux but mostly Macs. Our company is already fully switched to Macs and Linux and the Cloud. But a lot of companies have not. I’ll leave predictions of Apple’s strategy to break into the Fortune 500 to reporters far more qualified than me.

What I do know as a programmer is that my life just got a LOT easier.

/back to geek speak/ We program on Linux but use Mac laptops. So we are always connecting back and forth which is a pain. And developing locally, on an airplane for example, I need virtual linux machines that run on my local computer. For that I used to use open source Virtual Box by Oracle, but it’s too slow on a Mac IMHO. I tried VMWare Fusion 6 and apparently they have a deal with Apple allowing direct access to the hardware. All is know is that VMware is MUCH faster than virtual box or vagrant. And I’m impatient so I’ll pay the $70 ish for VMWare Fusion.

Previously to share folders between my local computer (Mac) as the host computer running a virtual Linux computer on VMWare (Guest) required me to set up sharing through VMWare. This gets complicated. Your host folders are mapped to /mnt/hgfs/ inside of linux. If you symlink into a project and install software, given it is a symlink that means your files will still install in the /mnt/hgfs/ folder. For example:

Project folder path to virtualenv inside of Linux 12.04 LTS might be:
/var/www/projects/mydjangoproject/venv/
Linking from VMware Fusion you would create a share perhaps similar to
/mnt/hgfs/shares/projects/mydjangoproject/venv/
that pointed to your virtual environment folder.

Because this is a sym link, if you install a virtualenv for example the path maintains the linux path. So a “which python” gets you something in the /mnt/hgfs/shares/projects/ folder instead of the /var/www/projects/mydjangoproject/venv/. This makes portability a problem.

Samba to the rescue. The above method required configuration of the virtual machine through VMWare fusion, which slows down designers. And doesn’t easily port to VirtualBox or Vagrant. You can make magic happen by using Samba:
https://help.ubuntu.com/12.04/serverguide/samba-fileserver.html

Installed in the guest OS, for me 12.04 Ubuntu, and setting up your /etc/samba/smb.conf file with something similar to this:

[www]
path = /var/www
browsable =yes
writable = yes
guest ok = yes
read only = no

Restart you VM and magically in Apple’s Finder you will now see the local VM in your “shared” portion of finder.

Lastly for the programmers out there, do a bit more research before using anything other than NAT on your local for security. You have to configure file sharing security on the Mac host. Samba sharing security via smb.conf. And chmod/chown security on the folders and files inside the linux guest. While it might be tempting to just blow down the house with 755, remember that whoever takes that image might bridge the adapter and…. well, that would be your fault. So be careful out there kids.

Still, loving the fact that my directory structures can be identical, that I can pass off a vmware image to a colleague and it JUST WORKS. Dreamweaver edits, bash, git, whatever. Between SSH and the adobe suite you are now all powerful to make better looking applications using better software. Rock. On.

airplay won’t play on your laptop? here’s your problem

Mac airplay is awesome and has really helped us in meetings. We connected an apple TV to all of the projectors and whoever is speaking, if they have relevant content, just grabs the screen wirelessly. No more plugging in monitor cables etc. But as luck would have it today airplay worked on everyone’s laptop EXCEPT mine. It’s not like I’m always messing with my hardware configuration or anything (cough).

Anyway, here is your problem if you are faced with the same issue. I had moved my menu bar to my larger desktop monitor at work so it was my primary when I plugged in, but reverted to my laptop when I wasn’t connected. Works great. One catch – airplay won’t work in this configuration on Mac OS X 10.8.2. In short:

This does NOT work with airplay:
display preferences dialog box

This is the part that is wrong:
this is wrong for airplay

And this is how it needs to look for Airplay to work with the Macbook Air and Apple TV in Monitor Preferences on Mountain Lion.
this is right for airplay

Your welcome. Because that was a real pain to figure out. No errors, it just wouldn’t connect and kept prompting for the password for the Apple TV then dropping back to the “Airplay Off” setting with no further error message. Hopefully this saves someone else some time.