My Home on the Web. Where the Code Snippets Run Free.

Installing Visual Studio on a Mac

Installing Visual Studio on a Mac

This tutorial is designed for my fellow part-time BCIT classmates who use Mac systems and are currently taking classes that require Visual Studio:

Of course, this tutorial can be used with any class (such as COMP 1920 – Server-side Web Scripting with PHP Level 1) that requires a Windows environment on a Mac. Just don’t do the Visual Studio installation step at the end.
Note: An alternative method to this tutorial would be to use the BootCamp app included with your Mac. I find the rebooting back and forth annoying. I prefer running both Windows and OSX at the same time.

Get the Software

You will need these programs:

  1. Oracle’s VirtualBox
  2. Windows 8.1 ISO
  3. Visual Studio ISO

Oracle’s VirtualBox

Oracle’s VirtualBox is a free virtual machine app. If you currently do not have VirtualBox installed, please install now before proceeding. For your convenience, the software is available via the following link: https://www.virtualbox.org

Windows 8.1 ISO

As we will be setting up a virtual Windows environment, you will need a copy of Windows. I found the best results with Windows 8.1, but I’m pretty sure Windows 7 would work, too. If you have not already downloaded the Windows 8.1 ISO file, you can download it from BCIT’s DreamSpark site.
Note: The site is only accessible to BCIT students.

Visual Studio 2013 ISO

The installation process is the same regardless of the Visual Studio version, but check with your instructor which version they recommend. You will also need to download the Visual Studio ISO from BCIT’s DreamSpark site.

Installing Visual Studio

Setup the Virtual Environment

After you have installed the VirtualBox software, create a virtual environment for Windows. Make sure you specify the environment as Windows 8.1 32-bit. Also allocate at least 2GB of RAM to the virtual environment:

Image of the VirtualBox installation screen

Make sure you indicate the 32-bit version of Windows!

In a few seconds, your environment will be initialized. Now you will need to mount the Windows 8.1 ISO file you downloaded for the DreamSpark site. To do that, right-click on the virtual machine and go into Settings:

How to Mount the Windows ISO DVD in VirtualBox

Mount the Windows 8.1 ISO

Once you have completed the Windows installation, I highly encourage you to install the optional VirtualBox package called the VirtualBox Guest Additions. This package provides better video and mouse support for your Mac, plus the ability to share folders between the virtual machine and your Mac (discussed in detail below). To locate the VirtualBox Guest Additions ISO, right-click on the VirtualBox application in the Mac application folder and choose Show Package Contents. You will find the VBoxGuestAdditions.iso within the MacOS folder. Why the Guest Additions are not installed by default, and why Oracle makes it so hard to find, I don’t know. Copy this ISO to another location.

Now mount the ISO just like you had done with Windows 8.1:

Mount the VirtualBox Guest Additions for Networking

Adding the VirtualBox Guest Additions will increase your productivity

While you are in the menu, I also like to make sure the Bidirectional Clipboard is enabled from within the Devices menu:

Guest Editions will allow Bidirectional Clipboard access

The Bidirectional Clipboard makes sharing between the Mac and Windows a breeze!

With the VirtualBox Guest Additions installed, the last step is to install the Visual Studio 2012. Mount the ISO like before, then run it and choose the Custom Installation option. Follow the Visual Studio 2012 setup prompts.

File Transfer

It is important to understand that the data in the virtual machine is treated like a separate computer. The Mac will not automatically have access to the files within the virtual machine, nor will the virtual machine have access to class notes or downloads you saved on the Mac. Luckily, we have a few ways to get around this.

It’s in the Cloud, son!

One option is to install, on both the Mac and the virtual machine, a cloud sharing system, such as Dropbox, OneDrive or Google Drive.
Advantage: Files are accessible via the respective web interfaces anywhere. This is a great option if you use an iMac or MacMini and sometimes forgot to upload the files to the BCIT personal account.
Disadvantage: I have had situations where I thought I uploaded files before shutting down the Windows virtual machine, only to realize later the file transfers to the cloud had not been completed.

Network Mapping

A better option, especially if you use a MacBook, is to map a folder of your Mac to the virtual machine. If you have not yet installed the VirtualBox Guest Additions, you will need to. To map a folder to the virtual machine, access the Devices → Shared Folder Settings in the virtual machine and specify the folder:

Map the Mac Folders as Drives in VirtualBox

Set as ‘Auto-mount’ & ‘Make Permanent’

Then it’s just a matter of mapping the network drive in Windows using the traditional Windows method.

That’s all folks – congratulations! If you enjoyed this tutorial, please consider subscribing for more great content.

Resources

http://msdn.microsoft.com/en-us/library/windows/apps/jj945425.aspx
https://www.virtualbox.org/wiki/End-user_documentation