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.
What 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:
Linking from VMware Fusion you would create a share perhaps similar to
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:
Installed in the guest OS, for me 12.04 Ubuntu, and setting up your /etc/samba/smb.conf file with something similar to this:
path = /var/www
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.