windows

Developing with VirtualBox and Vagrant on Windows

I've been supporting Drupal VM (a local Drupal CMS development environment) for Windows, Mac, and Linux for the past couple years, and have been using Vagrant and virtual machines for almost all my development (mostly PHP, but also some Python and Node.js at the moment) for the past four years. One theme that comes up quite frequently when dealing with VMs, open source software stacks (especially Drupal/LAMP), and development, is how much extra effort there is to make things work well on Windows.

Problem: tool-builders use Linux or macOS

The big problem, I see, is that almost all the tool-builders for OSS web software run either macOS or a flavor of Linux, and many don't even have access to a Windows PC (outside of maybe an odd VM for testing sites in Internet Explorer or Edge, if they're a designer/front-end developer). My evidence is anecdotal, but go to any OSS conference/meetup and you'll likely see the same.

Using SMB with symlinks instead of native synced folders with Vagrant and VirtualBox

VirtualBox's native shared folders will be used by default on Windows with the type of your synced folder set to nfs, or if it's not set. This method works great in many cases, but can be fairly slow when doing work with projects with many files in a synced folder, as is often the case with Drupal sites that I work with in Drupal VM.

Another option is to switch the type to smb. This is often a plug-and-play change (vagrant reload to make the change take effect—you'll likely need to enter in your Windows username and password during the startup process. However, symlinks inside the synced folder will likely break, and so we need to make one more important change:

The synced folder configuration needs to have:

rsync in Vagrant 1.5 improves file performance and Windows usage

I've been using Vagrant for almost all development projects for the past two years, and for projects where I'm the only developer, Vagrant + VirtualBox has worked great, since I'm on a Mac. I usually use NFS shared folders so I can keep project data (Git/SVN repositories, assets, etc.) on my local computer, and share them to a folder on the VM, and not suffer the performance penalty of using VirtualBox's native shared folders.

However, this solution only scaled well to other Mac and Linux users with whom I shared development responsibilities. Windows users were left in a bit of a lurch. To extend an olive branch, I hackishly added SMB support by installing and configuring an SMB share from within the VM only on windows hosts, so Windows devs could mount the SMB share and work on files in their native editors.

Running Ansible within Windows

2016 Update: If you are using Windows 10 or later, check out my newer instructions for Using Ansible through Windows 10's Subsystem for Linux.

Ansible is a simple and powerful infrastructure and configuration management tool that Server Check.in uses to manage it's infrastructure. Installing and using Ansible on Mac OS X or Linux workstations is incredibly easy, and takes all of 30 seconds to set up.

Running Ansible via Cygwin on Windows 7

"You have inserted a Blank DVD" – Opening discs from Windows on a Mac

A few times in my life, I've received DVD-Rs or CD-Rs that a Windows user burned and gave to me, and popped them in my Mac, only to receive a message, "You inserted a blank DVD [or CD]. Choose an action from the pop-up menu or click Ignore."

The problem is, there's no way to read the data from the disc on the Mac; you can try burning stuff onto it or simply ignoring it, but you can't read the pictures off the disk. I checked the data side of the disc, and, sure enough, there's a different color band where data was written. But it's a no-go on the Mac.

The problem here is that Microsoft/Windows decided to implement it's 'Drag to Disc' file copying feature in a somewhat annoying way; people with Windows computers can copy individual files to a burnable disc, eject the disc, and put it back in and copy more files to it. But they can't delete files from the disc, and this kinda breaks the way write-once media is supposed to work. (To Windows users: Make sure that you finalize/burn the disc completely before you hand it off to someone. Otherwise only Windows users can read the files).

Running a Windows XP VM in Parallels (Mac) from a USB Flash Drive

I thought I'd post my experience here, for the benefit of others, because I couldn't find a whole lot of information about this specific use of an external USB flash drive.

I have a MacBook Air with a dainty 128GB SSD drive, so I try to keep large files that I rarely use on external drives. I have plenty of external USB and FireWire storage (over 6 TB), and running VMs in either Parallels or VMWare Fusion works great (very highly performant) off any of these external drives.

However, there's no way I'm going to lug around an external hard drive and USB cable (and maybe power adapter) just so I can test things in Internet Explorer (basically, the only use I have for Windows).

Flash Drive to the Rescue!

I found a cheap 32GB USB flash drive that only sticks out of my MacBook Air half an inch, and copies at a consistent rate of 30MB/second (which is quite sufficient for most tasks). Also, the little drive should have very good read performance, since it's not a spinning platter. Write speed wouldn't be anything to brag about, but writing shouldn't happen all that often when simply opening up Internet Explorer—I hope!

Simple MAMP/MAMP Pro VirtualHosts in Parallels / Windows XP

(This tip should also work similarly with Vista, Windows 7, etc.).

After browsing around a bunch of different forums, the MAMP site, and Parallels documentation, I was still flummoxed by Parallels' weird Shared Host networking behavior, which seemingly didn't allow me to access virtualhosts I set up with MAMP for developing sites locally.

After much experimentation, I found that the simplest way to be able to type in 'local.example.com' (or 'dev.example.com', if that's your style) in Internet Explorer on Windows, and get a virtual host running via MAMP on my Mac, is to do the following:

Installing Windows XP from a Microsoft-downloaded .exe file

I recently received a downloaded copy of Windows XP SP3 from Microsoft (I ordered the downloadable file, rather than a mailed CD, for installing on one of my Macs), and noticed that, unlike usual disk images, this file had the extension .exe rather than .iso or .img...

To get it to work with VMWare, I needed to either turn the file into an image, or burn it to a physical CD or DVD. After searching fruitlessly for hours, I finally found a great little app, nlite, that helped me burn the files that came out of the .exe archive to a disc (the app is also a great help for slipstreaming an XP install).

To burn the .exe to a disk image or disc:

  1. Expand the .exe image by double-clicking on it, and choosing a folder into which to expand the files.
  2. Download nlite, and run it.
  3. Follow the steps to create a bootable ISO, and select the folder into which you expanded your install files in step 1.
  4. Burn the disc, or copy the ISO where you need it, and enjoy!

My First Computer (386 PC running MSDOS 6.0)

[Update: I have posted an article about all the computers I've owned].

Pictured below (in the final year of its existence) is the first computer I ever called my own. Built out of scrap parts my Dad brought home from his office, I managed to build the computer as a 33 Mhz 386, with 2 MB of RAM and a 20 MB hard drive, eventually upgrading it (in stages) to a 66 Mhz 486 with 8 MB of RAM and a 512 MB hard drive!

My First PC - 386 DOS Computer
mmm... SCSI in a PC!

How, you may ask, could a diehard Mac/Apple fanboy start on a 386? Well, it was all about budget, you see. Free is good, especially when you're a little kid with absolutely zero dollars in the bank.