iPixel Creative is a Singapore web design and development Company. At iPixel Creative, we provides web design solution which helps your company stand out from the competitors. Our Solutions includes web design, website development, cms development, ecommerce solution and hosting solutions.
Editor’s Note:Previously, we published a post by Daniel Pataki on How To Install Windows on Mac when all else fails. Alvaro is one of the many readers who left a comment on that thread. Below is his version on how to get Windows Boot Camp, and thus, Windows, on your Mac.
I have a late 2009 27" iMac which has a built-in Optical Drive, one that is not operational anymore. I’m not sure why it refuses to work, but I tried cleaning it with canned air, which improved its condition a little because now at least it "swallows" the dvd and spins it – it just never recognises it. I also have a MacBook Air which I successfully installed Boot Camp on with the use of an external drive. Still, I wanted a way to install it without the drive.
What Didn’t Work
So I tried lots of things.
The first one, was enabling the Boot Camp Assistant app to create bootable USB drives. It didn’t work, because after the application created the USB drive, it made a partition and rebooted. I was supposed to see the windows installer, but instead, all I saw was a blinking white line on a black screen. After several minutes of this, I gave up and force-booted my computer.
Next, I tried creating a partition on my own, using disk utility, formatting it as FAT32 and then attempted to boot from the USB. This did not work either. When I booted my Mac in the boot option menu, it did not show the partition, nor the "bootable" USB.
And that’s when I found this tutorial by Daniel Pataki, which I tried on my MacBook Air and it worked like a charm, despite the long and complex process. When I tried it on my iMac, however, things didn’t go well. When I tried to boot the VM from the Boot Camp partition and install windows, the VM booted into a black screen saying "Missing Operative System".
Finding Plan B
I had given up on other methods, and I decided to sleep on the problem of installing Boot Camp on my Mac when I suddenly thought about the Apple Watch. You see, what Apple has always wanted is for us users to buy a new model of Mac whenever the older one cannot do something. It’s the answer to why certain Mac models can create bootable USB drives while others can’t.
I then asked myself if USB drives have the same restrictions. One thing led to another and this is the way I install Windows on My Mac now. And it is way, way easier.
What Did Work
Here’s what we’ll be doing:
Create a Bootable USB
Create Partition
Install Windows
Yes, it’s really that simple.
Create a bootable USB
1. Locate a Windows PC.
2. Download two things: a Windows 7 USB download tool directly from Microsoft, and a full Windows ISO of the version you want to install.
3. Open the Windows 7 USB download tool and browse to your ISO file, click continue and follow the instructions in the next section to create your Bootable USB.
Create a Windows Partition
We will be using Boot Camp Assistant.. well, sort of.
1. First, we need to make the application recognise USB drives. Go to Finder > Applications > Utilities, and right click on Boot Camp Assistant, then click "Show package contents".
2. Navigate into Contents, locate the "info.plist" file then make a copy (do not move the original) of it to your desktop. If you like, make another copy as a backup, just in case something goes wrong.
3. Open the "info.plist" file located on your desktop, look for the line of text saying PreUSBBootModels and erase the "Pre" from there, save the file (CMD+S) and close it.
4. Drag the modified info.plist file from your desktop to the Contents folder we opened previously. It will ask you to Authenticate with your administrator Name and Password. Click Replace.
5. If you were to open Boot Camp Assistant now, and it crashes, that’s because it detected that a modification has been made. If this happens, open terminal and type the following command:
Enter your Administrator Password and hit enter. Now you can open Disk Utility.
6. Make sure your Bootable USB is plugged in. Open Boot Camp Assistant and you will see 3 options.
Check Install windows, and hit continue, select the size you want to dedicate to windows and click Install. The process might take several minutes.
Install Windows
Once the Partition is ready, your computer will restart into the Windows installer, follow all the instructions, and enjoy your new windows partition!
Remember that when you finish the installation process, you should download and install the proper Boot Camp Support Drivers so that everything works perfectly.
Editor’s note: This is written by Alvaro Martinez for Hongkiat.com. Alvaro is a tech lover, Google fan, Android enthusiast, gamer and loves helping people solve their problems. You can reach him on Twitter , Facebook or Google+.
Editor’s Note:Previously, we published a post by Daniel Pataki on How To Install Windows on Mac when all else fails. Alvaro is one of the many readers who left a comment on that thread. Below is his version on how to get Windows Boot Camp, and thus, Windows, on your Mac.
I have a late 2009 27" iMac which has a built-in Optical Drive, one that is not operational anymore. I’m not sure why it refuses to work, but I tried cleaning it with canned air, which improved its condition a little because now at least it "swallows" the dvd and spins it – it just never recognises it. I also have a MacBook Air which I successfully installed Boot Camp on with the use of an external drive. Still, I wanted a way to install it without the drive.
What Didn’t Work
So I tried lots of things.
The first one, was enabling the Boot Camp Assistant app to create bootable USB drives. It didn’t work, because after the application created the USB drive, it made a partition and rebooted. I was supposed to see the windows installer, but instead, all I saw was a blinking white line on a black screen. After several minutes of this, I gave up and force-booted my computer.
Next, I tried creating a partition on my own, using disk utility, formatting it as FAT32 and then attempted to boot from the USB. This did not work either. When I booted my Mac in the boot option menu, it did not show the partition, nor the "bootable" USB.
And that’s when I found this tutorial by Daniel Pataki, which I tried on my MacBook Air and it worked like a charm, despite the long and complex process. When I tried it on my iMac, however, things didn’t go well. When I tried to boot the VM from the Boot Camp partition and install windows, the VM booted into a black screen saying "Missing Operative System".
Finding Plan B
I had given up on other methods, and I decided to sleep on the problem of installing Boot Camp on my Mac when I suddenly thought about the Apple Watch. You see, what Apple has always wanted is for us users to buy a new model of Mac whenever the older one cannot do something. It’s the answer to why certain Mac models can create bootable USB drives while others can’t.
I then asked myself if USB drives have the same restrictions. One thing led to another and this is the way I install Windows on My Mac now. And it is way, way easier.
What Did Work
Here’s what we’ll be doing:
Create a Bootable USB
Create Partition
Install Windows
Yes, it’s really that simple.
Create a bootable USB
1. Locate a Windows PC.
2. Download two things: a Windows 7 USB download tool directly from Microsoft, and a full Windows ISO of the version you want to install.
3. Open the Windows 7 USB download tool and browse to your ISO file, click continue and follow the instructions in the next section to create your Bootable USB.
Create a Windows Partition
We will be using Boot Camp Assistant.. well, sort of.
1. First, we need to make the application recognise USB drives. Go to Finder > Applications > Utilities, and right click on Boot Camp Assistant, then click "Show package contents".
2. Navigate into Contents, locate the "info.plist" file then make a copy (do not move the original) of it to your desktop. If you like, make another copy as a backup, just in case something goes wrong.
3. Open the "info.plist" file located on your desktop, look for the line of text saying PreUSBBootModels and erase the "Pre" from there, save the file (CMD+S) and close it.
4. Drag the modified info.plist file from your desktop to the Contents folder we opened previously. It will ask you to Authenticate with your administrator Name and Password. Click Replace.
5. If you were to open Boot Camp Assistant now, and it crashes, that’s because it detected that a modification has been made. If this happens, open terminal and type the following command:
Enter your Administrator Password and hit enter. Now you can open Disk Utility.
6. Make sure your Bootable USB is plugged in. Open Boot Camp Assistant and you will see 3 options.
Check Install windows, and hit continue, select the size you want to dedicate to windows and click Install. The process might take several minutes.
Install Windows
Once the Partition is ready, your computer will restart into the Windows installer, follow all the instructions, and enjoy your new windows partition!
Remember that when you finish the installation process, you should download and install the proper Boot Camp Support Drivers so that everything works perfectly.
Editor’s note: This is written by Alvaro Martinez for Hongkiat.com. Alvaro is a tech lover, Google fan, Android enthusiast, gamer and loves helping people solve their problems. You can reach him on Twitter , Facebook or Google+.
Developing locally is one of the best things that can happen to you. Not only does it let you dispense with upload/download times, you can create as many projects as you want, work with real domains locally and generally speed up everything you do.
Vagrant is a great piece of software that creates reproducable and portable virtual machines which you can use as local web server environments. In this article I’ll show you why Vagrant is so awesome and how you can get up and running with awesome WordPress testing environments pretty quickly.
You may also be interested in the following posts:
In Vagrant’s own words, it can be used to “create and configurelightweight, reproducible, and portable development environments”. Let’s find out what each of those terms mean, with regards to your local environment.
Configurable:
Your virtual machine is easy to create, easy to configure and more importantly: it can be extensively configured. Default setups are just fine for most projects and casual testing ,so you don’t have to fiddle around with it but if you need the power, it’s there.
You can set things up just like you would in a real server environment; from configuring the IP to automatically installing git and other software, it’s all possible and up to you.
Lightweight:
I run multiple virtual machines on my computer, each one has two configuration files with a combined size of no more than 4KB — that’s right, 2 files, 4KB in total. To be honest, my setups are all pretty basic but even if you have something extremely elaborate it would amount to 10-100KB at the very most.
Portable:
Portability comes with the fact that the files have a tight waistline. One file is a special Vagrantfile, the other is a bash file; each contain simple text, nothing special. As a result you can email them back and forth, save them on Evernote, Google Drive or Dropbox.
Reproducable:
This is one of the best features of Vagrant. Due to the size and portability of the files required, specific server configurations can be replicated with ease. Suppose you create an application which requires a highly tuned server. Create the Vagrantfile and the installation bash file for it and get it up and running.
You can now email the configuration to your team members and they will be running the exact same server within a few minutes.
Installation
Generally speaking there are three parts to getting started with a development environment using Vagrant.
Install Vagrant & Virtualbox
Create a server configuration
Create your web environment (eg: install WordPress)
Installing Vagrant
Vagrant can be installed by visiting the download page, selecting your OS and running the downloaded package. Since Vagrant relies on virtualization, you’ll virtualization software. Vagrant has built-in support for VirtualBox but can be made to work with others, but for the sake of this example, we’ll go with VirtualBox. Grab it here.
Creating A Server Configuration
You can use ready-made scripts to do everything for you. Jeffrey Way has put together a great tutorial about ditching MAMP and going with Vagrant instead. Take a look and make sure to note down the code at the top:
If you create a folder, navigate to it using your terminal or command prompt and paste the code above, you will have created a local environment in one quick move. Let’s dissect this though, and see what is happening.
It consists of 3 parts:
curl -L -o "install.sh" http://bit.ly/1hBfq57
This command downloads a pre-made installation file: the install.sh file responsible for installing and configuring software once the virtual machine is running. PHP, Apache, MySQL and other similar things are taken care of here.
curl -L -o "Vagrantfile" http://bit.ly/1mE3Qt9
This will download the Vagrantfile which contains information about the server configuration and other basic installation instructions. This determines the operating system the server uses, the IP the network is mapped to; it can be used to control file permissions and ownerships and more.
vagrant up
This command boots up the server.
When you do this for the first time it will take anywhere between 5-20 minutes. The so-called “box” needs to be downloaded (this contains the OS for example), which may be around 700+ MB. The server is then provisioned (installed and configured) and will be up and running.
If you restart your computer or shut down the virtual machine (VM), you will need to run the command again. This time it will only take a couple of seconds to get it running.
In a nutshell this is very much like installing your OS and environment on a computer. The Vagrantfile takes on the responsibilities of the Windows/Linux/Mac installation disk; it has everything needed to get the basic system working. The install.sh file automates the initial software needs. For your computer this would be like installing the newest video driver, Photoshop, your favourite text editor, browsers and so on.
The vagrant up command is akin to turning on your computer. When you do this for the first time it takes quite some time because you’ll need to install the OS and the software. After that it takes 10-20 seconds to get things up and running.
Installing WordPress
If you’ve followed the instructions here you should now have a server up and running, but what can you do with it, how can you use it?
Here are a few things to know:
You can reach the local environment via http://192.168.33.21
The html folder within the installation directory is your root directory
Access to your MySQL database is as follows: Username: root, Password: root and Host: localhost.
The first thing we should do is use SSH to gain access to our server so we can set our database up, getting it ready for WordPress.
Use the terminal to go to the folder you’ve installed your virtual machine in and type vagrant ssh.
Once you’re in, you can type mysql -uroot -p to gain access to MySQL, type root when prompted for the password.
All we need is a simple empty database for WordPress which we’ll create with the following command: CREATE DATABASE wordpress
Next, go to the WordPress download page and grab the latest version. Extract it into the html directory (the root directory) and make sure to move all the files from the created wordpress sub-directory a level up.
In the end you should see the two WordPress directories (wp-admin, wp-includes) and the default WordPress files right inside your html directory.
Detour: Troubleshooting
If you follow these instructions you’ll find that you may not be able to upload files via the WordPress interface. This has to do with user and group issues which can be easily fixed.
SSH into the server and type the following sudo vi /etc/apache2/apache.conf. This will open a VI editor you can use to edit this file.
Note: This will be a bit alien to many but never fear, here are some specific instructions. If you need some more help, take a look at a VI cheat sheet.
Type /User. This searches the document for occurrences of “User”. You should see the section where you can define the user and the group.
Press “i” to go into Edit mode. Use the arrow keys to navigate with the cursor and edit the user and the group to be “vagrant”, like this:
User vagrant Group vagrant
Once done, press escape, then type the following command: :wq. This saves the file and quits the vi editor.
You should now type vagrant halt to stop the virtual machine, followed by vagrant up to restart it.
That’s it, file operations will now work in WordPress.
At this point you can visit http://192.168.33.21 and install WordPress as usual. Make sure to use the database access credentials above and the database name you created. You can install plugins, themes, create your own code and do anything else you normally would do on a real server.
Changing The Hostname
http://192.168.33.21 is not exactly the most friendly way of opening up a project. Luckily it’s easy to change this to something easier to remember such as http://wordpress.local.
SSH into the server and navigate to the site configurations folder by typing cd /etc/apache2/sites-available.
Type ls to list the contents of the folder. You should see a file named 000-default.conf. Let’s edit this file to see what it contains by typing sudo vi 000-default.conf.
Press “i” to enter Insert mode and navigate down to line 8 which should say #ServerName www.example.com. Using the ServerName directive you can create a named route to website.
Uncomment the line by removing the hash at the beginning and change the server name to whatever you’d like. It is customary to use something like wordpress.dev, wordpress.local, or perhaps even just wordpress — it’s up to you. In fact, you could even use facebook.com!
Save the file by pressing escape and typing the :wq command and restart the server by typing sudo service apache2 restart.
Finally, outside of your virtual machine (make sure you are not SSH-d in) edit your hosts file using the sudo vi command. On Windows this can be found at C:windowssystem32driversetchosts, on linux based systems it can be found at /etc/hosts
Add the following line to the file anywhere:
192.168.33.21 wordpress.local
Make sure to use the host name you defined in the config file and save the hosts file. This file essentially tells our computer where to load a server name from, and how to resolve it. By default your computer will look to the Internet. If you type in facebook.com it will load it from the web.
However, if you’ve bound facebook.com to the virtual machine IP and defined it as the ServerName, it will load it locally.
You should now be able to type wordpress.local and see the same result as when you typed 192.168.33.21.
If you do this after you install WordPress you may see things such as styles and scripts broken. The reason is that WordPress stores the installation target location in the database and it will be set to the IP.
To make sure this doesn’t happen you should create your named server first and install WordPress by going to wordpress.local (or whichever other name you chose) instead of using the IP.
Using Virtual Servers
We’re now doing well but as it stands we’ll have to run a virtual machine for each project which is a waste. By using virtual servers you can run as many independent websites as you’d like from the same virtual machine.
The key to this lies in the site configuration file, the same file we used to change the ServerName. Let’s create two virtual hosts now.
First, go to the directory you created the virtual machine in and create two sub-directories: blog and store. Your original html directory should still be there as well.
Next, SSH into the server and navigate to the /etc/apache2/sites-available directory.
Create two new files by copying the default config file:
Edit the shop.conf file using the method we discussed previously. Make sure the ServerName is set to shop.dev and set the DocumentRoot directive to /var/www/shop — this is the directory we created just now.
Do the same with the blog.conf file, using the correct values.
Use the sudo a2ensite blog and sudo a2ensite shop commands to enable these sites and use the sudo service apache2 restart command to restart the server and quit the SSH connection by using the exit command.
Now edit the hosts file to make sure our computer knows how to resolve the virtual hosts:
192.168.33.21 blog.dev 192.168.33.21 shop.dev
Now you have two more sites to work with: one can be reached by typing blog.dev in the URL bar and the root directory of this site will be the blog directory. The other is the shop.dev site which uses the shop directory as its root.
This is a lot easier than creating multiple virtual machines and will require less resource usage from your computer.
Conclusion
We went through a lot in this article: we installed Vagrant, learned how to create a local environment and installed WordPress. We also learned a few tricks such as using server names and virtual hosts.
This should get you started on the path to local development. Don’t forget that you can easily recreate your environment anywhere, all you need is the Vagrantfile and the install.sh file.
Do More!
We’ve only just scratched the surface of what Vagrant can do. You can find custom boxes to work with at Vagrantcloud or you can even look up boxes which will mimic your actual online host environment.
A lot of tasks can be automated and/or customized and you can use automation tools such as WP-CLI to install WordPress and related plugins/themes using a few commands.
Developing locally is one of the best things that can happen to you. Not only does it let you dispense with upload/download times, you can create as many projects as you want, work with real domains locally and generally speed up everything you do.
Vagrant is a great piece of software that creates reproducable and portable virtual machines which you can use as local web server environments. In this article I’ll show you why Vagrant is so awesome and how you can get up and running with awesome WordPress testing environments pretty quickly.
You may also be interested in the following posts:
In Vagrant’s own words, it can be used to “create and configurelightweight, reproducible, and portable development environments”. Let’s find out what each of those terms mean, with regards to your local environment.
Configurable:
Your virtual machine is easy to create, easy to configure and more importantly: it can be extensively configured. Default setups are just fine for most projects and casual testing ,so you don’t have to fiddle around with it but if you need the power, it’s there.
You can set things up just like you would in a real server environment; from configuring the IP to automatically installing git and other software, it’s all possible and up to you.
Lightweight:
I run multiple virtual machines on my computer, each one has two configuration files with a combined size of no more than 4KB — that’s right, 2 files, 4KB in total. To be honest, my setups are all pretty basic but even if you have something extremely elaborate it would amount to 10-100KB at the very most.
Portable:
Portability comes with the fact that the files have a tight waistline. One file is a special Vagrantfile, the other is a bash file; each contain simple text, nothing special. As a result you can email them back and forth, save them on Evernote, Google Drive or Dropbox.
Reproducable:
This is one of the best features of Vagrant. Due to the size and portability of the files required, specific server configurations can be replicated with ease. Suppose you create an application which requires a highly tuned server. Create the Vagrantfile and the installation bash file for it and get it up and running.
You can now email the configuration to your team members and they will be running the exact same server within a few minutes.
Installation
Generally speaking there are three parts to getting started with a development environment using Vagrant.
Install Vagrant & Virtualbox
Create a server configuration
Create your web environment (eg: install WordPress)
Installing Vagrant
Vagrant can be installed by visiting the download page, selecting your OS and running the downloaded package. Since Vagrant relies on virtualization, you’ll virtualization software. Vagrant has built-in support for VirtualBox but can be made to work with others, but for the sake of this example, we’ll go with VirtualBox. Grab it here.
Creating A Server Configuration
You can use ready-made scripts to do everything for you. Jeffrey Way has put together a great tutorial about ditching MAMP and going with Vagrant instead. Take a look and make sure to note down the code at the top:
If you create a folder, navigate to it using your terminal or command prompt and paste the code above, you will have created a local environment in one quick move. Let’s dissect this though, and see what is happening.
It consists of 3 parts:
curl -L -o "install.sh" http://bit.ly/1hBfq57
This command downloads a pre-made installation file: the install.sh file responsible for installing and configuring software once the virtual machine is running. PHP, Apache, MySQL and other similar things are taken care of here.
curl -L -o "Vagrantfile" http://bit.ly/1mE3Qt9
This will download the Vagrantfile which contains information about the server configuration and other basic installation instructions. This determines the operating system the server uses, the IP the network is mapped to; it can be used to control file permissions and ownerships and more.
vagrant up
This command boots up the server.
When you do this for the first time it will take anywhere between 5-20 minutes. The so-called “box” needs to be downloaded (this contains the OS for example), which may be around 700+ MB. The server is then provisioned (installed and configured) and will be up and running.
If you restart your computer or shut down the virtual machine (VM), you will need to run the command again. This time it will only take a couple of seconds to get it running.
In a nutshell this is very much like installing your OS and environment on a computer. The Vagrantfile takes on the responsibilities of the Windows/Linux/Mac installation disk; it has everything needed to get the basic system working. The install.sh file automates the initial software needs. For your computer this would be like installing the newest video driver, Photoshop, your favourite text editor, browsers and so on.
The vagrant up command is akin to turning on your computer. When you do this for the first time it takes quite some time because you’ll need to install the OS and the software. After that it takes 10-20 seconds to get things up and running.
Installing WordPress
If you’ve followed the instructions here you should now have a server up and running, but what can you do with it, how can you use it?
Here are a few things to know:
You can reach the local environment via http://192.168.33.21
The html folder within the installation directory is your root directory
Access to your MySQL database is as follows: Username: root, Password: root and Host: localhost.
The first thing we should do is use SSH to gain access to our server so we can set our database up, getting it ready for WordPress.
Use the terminal to go to the folder you’ve installed your virtual machine in and type vagrant ssh.
Once you’re in, you can type mysql -uroot -p to gain access to MySQL, type root when prompted for the password.
All we need is a simple empty database for WordPress which we’ll create with the following command: CREATE DATABASE wordpress
Next, go to the WordPress download page and grab the latest version. Extract it into the html directory (the root directory) and make sure to move all the files from the created wordpress sub-directory a level up.
In the end you should see the two WordPress directories (wp-admin, wp-includes) and the default WordPress files right inside your html directory.
Detour: Troubleshooting
If you follow these instructions you’ll find that you may not be able to upload files via the WordPress interface. This has to do with user and group issues which can be easily fixed.
SSH into the server and type the following sudo vi /etc/apache2/apache.conf. This will open a VI editor you can use to edit this file.
Note: This will be a bit alien to many but never fear, here are some specific instructions. If you need some more help, take a look at a VI cheat sheet.
Type /User. This searches the document for occurrences of “User”. You should see the section where you can define the user and the group.
Press “i” to go into Edit mode. Use the arrow keys to navigate with the cursor and edit the user and the group to be “vagrant”, like this:
User vagrant Group vagrant
Once done, press escape, then type the following command: :wq. This saves the file and quits the vi editor.
You should now type vagrant halt to stop the virtual machine, followed by vagrant up to restart it.
That’s it, file operations will now work in WordPress.
At this point you can visit http://192.168.33.21 and install WordPress as usual. Make sure to use the database access credentials above and the database name you created. You can install plugins, themes, create your own code and do anything else you normally would do on a real server.
Changing The Hostname
http://192.168.33.21 is not exactly the most friendly way of opening up a project. Luckily it’s easy to change this to something easier to remember such as http://wordpress.local.
SSH into the server and navigate to the site configurations folder by typing cd /etc/apache2/sites-available.
Type ls to list the contents of the folder. You should see a file named 000-default.conf. Let’s edit this file to see what it contains by typing sudo vi 000-default.conf.
Press “i” to enter Insert mode and navigate down to line 8 which should say #ServerName www.example.com. Using the ServerName directive you can create a named route to website.
Uncomment the line by removing the hash at the beginning and change the server name to whatever you’d like. It is customary to use something like wordpress.dev, wordpress.local, or perhaps even just wordpress — it’s up to you. In fact, you could even use facebook.com!
Save the file by pressing escape and typing the :wq command and restart the server by typing sudo service apache2 restart.
Finally, outside of your virtual machine (make sure you are not SSH-d in) edit your hosts file using the sudo vi command. On Windows this can be found at C:windowssystem32driversetchosts, on linux based systems it can be found at /etc/hosts
Add the following line to the file anywhere:
192.168.33.21 wordpress.local
Make sure to use the host name you defined in the config file and save the hosts file. This file essentially tells our computer where to load a server name from, and how to resolve it. By default your computer will look to the Internet. If you type in facebook.com it will load it from the web.
However, if you’ve bound facebook.com to the virtual machine IP and defined it as the ServerName, it will load it locally.
You should now be able to type wordpress.local and see the same result as when you typed 192.168.33.21.
If you do this after you install WordPress you may see things such as styles and scripts broken. The reason is that WordPress stores the installation target location in the database and it will be set to the IP.
To make sure this doesn’t happen you should create your named server first and install WordPress by going to wordpress.local (or whichever other name you chose) instead of using the IP.
Using Virtual Servers
We’re now doing well but as it stands we’ll have to run a virtual machine for each project which is a waste. By using virtual servers you can run as many independent websites as you’d like from the same virtual machine.
The key to this lies in the site configuration file, the same file we used to change the ServerName. Let’s create two virtual hosts now.
First, go to the directory you created the virtual machine in and create two sub-directories: blog and store. Your original html directory should still be there as well.
Next, SSH into the server and navigate to the /etc/apache2/sites-available directory.
Create two new files by copying the default config file:
Edit the shop.conf file using the method we discussed previously. Make sure the ServerName is set to shop.dev and set the DocumentRoot directive to /var/www/shop — this is the directory we created just now.
Do the same with the blog.conf file, using the correct values.
Use the sudo a2ensite blog and sudo a2ensite shop commands to enable these sites and use the sudo service apache2 restart command to restart the server and quit the SSH connection by using the exit command.
Now edit the hosts file to make sure our computer knows how to resolve the virtual hosts:
192.168.33.21 blog.dev 192.168.33.21 shop.dev
Now you have two more sites to work with: one can be reached by typing blog.dev in the URL bar and the root directory of this site will be the blog directory. The other is the shop.dev site which uses the shop directory as its root.
This is a lot easier than creating multiple virtual machines and will require less resource usage from your computer.
Conclusion
We went through a lot in this article: we installed Vagrant, learned how to create a local environment and installed WordPress. We also learned a few tricks such as using server names and virtual hosts.
This should get you started on the path to local development. Don’t forget that you can easily recreate your environment anywhere, all you need is the Vagrantfile and the install.sh file.
Do More!
We’ve only just scratched the surface of what Vagrant can do. You can find custom boxes to work with at Vagrantcloud or you can even look up boxes which will mimic your actual online host environment.
A lot of tasks can be automated and/or customized and you can use automation tools such as WP-CLI to install WordPress and related plugins/themes using a few commands.
iOS 8 comes with many improvements and plenty of new features such as Continuity, Apple Pay and SMS Relay. Sadly, many of these features will not work on older Apple devices, like the iPhone 4, due to limitations. Worse still, many apps now will require at least iOS 7 to run smoothly. Trying to install an app will probably prompt a notification like this:
However, that doesn’t mean you cannot get a compatible version of the app installed. Here’s how to do it. First of all, you will need to login to the App Store through iTunes in Mac. Search for the app you would like to install. In this case, I am trying to install the 9Gag app.
Once the app is installed, the app will be added to your Purchased history but it won’t turn up on your iPhone if you don’t have it connected to your Macbook (which is fine because keep in mind that although the app has been "installed", it needs iOS 7 to run and thus can’t function on your iPhone 4).
Now, to get the latest compatible version of the app on your phone.
On your iPhone, launch the App Store and go to the Purchased page via the Updates tab. Try installing the app. Your device will notify you that the current version of the app requires iOS 7 or later. Then, it will offer you the option to install a previous version that is compatible with the iPhone you are holding.
Here’s what you will see:
At this point, tap Download to proceed.
And you should now have the compatible version of the app installed and functioning.
You can try installing other apps this way too but note that this only works with apps that have been around since iOS 6. Only then would there be a version built for iOS 6 aka the "compatible version" you can fall back on.
iOS 8 comes with many improvements and plenty of new features such as Continuity, Apple Pay and SMS Relay. Sadly, many of these features will not work on older Apple devices, like the iPhone 4, due to limitations. Worse still, many apps now will require at least iOS 7 to run smoothly. Trying to install an app will probably prompt a notification like this:
However, that doesn’t mean you cannot get a compatible version of the app installed. Here’s how to do it. First of all, you will need to login to the App Store through iTunes in Mac. Search for the app you would like to install. In this case, I am trying to install the 9Gag app.
Once the app is installed, the app will be added to your Purchased history but it won’t turn up on your iPhone if you don’t have it connected to your Macbook (which is fine because keep in mind that although the app has been "installed", it needs iOS 7 to run and thus can’t function on your iPhone 4).
Now, to get the latest compatible version of the app on your phone.
On your iPhone, launch the App Store and go to the Purchased page via the Updates tab. Try installing the app. Your device will notify you that the current version of the app requires iOS 7 or later. Then, it will offer you the option to install a previous version that is compatible with the iPhone you are holding.
Here’s what you will see:
At this point, tap Download to proceed.
And you should now have the compatible version of the app installed and functioning.
You can try installing other apps this way too but note that this only works with apps that have been around since iOS 6. Only then would there be a version built for iOS 6 aka the "compatible version" you can fall back on.
I have a 2011 iMac and I’ve installed Windows on it successfully before. The process was extremely straightforward. I popped in my Windows disk and let Bootcamp do its thing. Recently though I had to reinstall and I found that my built-in Superdrive is broken. Installing Windows went from being a breeze to being a nightmare in an instant.
This guide is for those of you who have tried every solution – and upon reading the numerous forums which conclude that Windows "can only be installed via Bootcamp" – have given up.
It took me a while to stumble on to the solution, which uses a combination of different tools, but it works like a charm and once you’ve done it once, it’s not that difficult. Skip ahead to the "What Does Work" section if you want to get down to work.
During the course of my Windows install venture I figured out at least 6 ways which didn’t work. They all have their eureka moments, but don’t work out in the end.
1. Cleaning The Superdrive
Apparently you can drape something like a lens cleaner over a thin business card, stick the thing into the slot and get to work on it. The business end of the drive is at the bottom so if you wiggle it just right, and you’re lucky, you could be successful in cleaning the thing. You can also try blowing some compressed air into it.
If you were successful in doing so you can basically skip this guide and install via Basecamp, well done!
2. Bootable USB Via Bootcamp
The only snag with this was that I didn’t have this option. Apparently this is only available for computers without an optical drive. There is a way in which you can enable this pretty easily though. This is something we will need to do further on as a part of our installation, but it still doesn’t work on its own.
When I saw the option, I promptly clicked on it and let Bootcamp create a startup USB for me. It worked at first, but then refused to even acknowledge it in the boot menu. I tried this with and without Bootcamp drivers and I even tried checking the "Install Windows" options which would automatically start the process for me.
I was a bit downcast but I thought: hey, let’s create a bootable USB in Windows! I found a Windows laptop and created an USB using Rufus. Of course, it didn’t work, it wasn’t seen by the boot manager. I went back and used the Windows 7 USB/DVD Download Tool which was made by Microsoft. Still nothing. Changed another pen drive. Nope. Sigh.
3. Firmware Update
Good news, my iMac model has a firmware update, and what’s more, this update has to do with "booting" stuff (is luck finally on my side?). I downloaded and installed the firmware update and after a terrifying BIOS beep, everything was back to the good old not working ways.
Oh well, at least my firmware is updated.
4. rEFInd Boot Manager
After reading a whole lot of forums I saw that using rEFInd, an alternative boot loader may help.
Once installed and loaded on startup it "saw" the USB, however, while it was able to access the drive, I always receive a "No bootable disk found" message. This was weird since the message obviously came from the boot device, why is it looking for (maybe) a CD? Try as I may, rEFInd was not the answer, although just like Bootcamp, it is a part of the final solution.
5. Using An External Drive
Nope. This was the second thing I tried but it didn’t even see the CD. Once I had rEFInd installed I tried again; the CD showed up in the boot manager, but it refused to boot from it. All I got was a horizontal cursor and nothing more. One thing I didn’t try was an Apple-made external drive but while it’s possible that (for some unknown reason) this would work, I have read that it doesn’t.
6. Virtual Machines
I remember from using Parallels that it can use a Bootcamp partition, allowing me to use the bootable partition as a virtual machine. I had a feeling this wouldn’t work, but it was worth a shot. Parallels (and other virtualization apps) can’t install Windows as boot partitions. They can use them once created, but only if created separately.
Again, virtual machines will be a part of our solution, but not THE solution.
What Does Work
Technically, it is a specific series of operations that works. My source for it is Yes, This Big – a huge thank you to them for figuring out the final solution.
Here is the simplified rundown of the solution:
Force Bootcamp to create a bootable disk
Create a custom virtual machine with VMware (the trial version is sufficient)
Modify the virtual machine and install Windows onto the Bootcamp partition
Delete all the files and copy them, from the USB key
Boot into the Bootcamp partition using rEFInd and Install Windows normally
Curse Apple a little bit for making this so difficult
Let’s take a look at the specifics of all these steps, by the end of which you will have a nice little Windows install!
1. Force Bootcamp to create a bootable disk
If you don’t have this option enabled, you’ll need to edit some files.
You’ll need your computer’s (1) Boot ROM version and (2) Model Identifier which can be found in System Report. (Open up Spotlight, with Cmd + Space, and type "System Information".)
Here’s a sample of what you will see:
Head on over to the Applications/Utilities folder, right-click "Boot Camp Assistant.app" and choose "Show Package Contents".
Go into the "Contents" folder and make a copy of "info.plist" somewhere, just in case. Next, open the original "info.plist" file in a text editor, and search for "USBBootSupportedModels" – it should be somewhere at the bottom.
Look up your model identifier and add it as a string, something like this:
Open Bootcamp and wonder at the appearance of the "Create a Windows 7 or later version install disk". Click all the checkboxes and let Bootcamp do its thing. You’ll need to supply it with an ISO image which you can generate with Rufus or the Windows 7 USB/DVD Download Tool.
Once Bootcamp is done, it won’t be able to install Windows. When it reboots, press the alt button until the boot manager comes up and boot back into OS X.
2. Create a custom virtual machine with VMware
Note: I’m pretty sure this can be done with other virtualization software as well but I don’t know enough about this topic to go rogue. The trial version of VMware is more than enough for this task so you can get it done free either way.
Before we jump in, we’ll need to take a look at the disk identifier of our Bootcamp partition.
Using Spotlight to type "Disk Utility", click on the BOOTCAMP partition and press CMD + i. This will bring up a disk info window where you can find the Disk Identifier – make a note of it.
Open VMware fusion and press CMD + N to create a new virtual machine. You’ll need to click "More options…" and select "Create a custom virtual machine". Then click Continue.
Now, select the operating system you are installing, click Continue and select "Create a new virtual disk" from the next menu. Click Continue and select "Customize Settings" from the bottom of the next screen; this will let you specify the location for the virtual machine. I selected my desktop for easy access – you can safely delete it once this is all over anyway. Finish up and close VMware.
3. Modify the virtual machine and install Windows onto the Bootcamp partition
Now, we’ll use some trickery to make VMware use our Bootcamp partition as the target location for the install.
To edit the settings for the virtual machine you’ll need to open up a terminal. Once ready, type "cd " (add a space at the end) and drag the icon of your virtual machine into the terminal and press Enter.
Now you’ll need to issue a command which will link the VM to Bootcamp, take care to replace [X] and [Y] with the correct values.
You won’t see any feedback from the terminal but if it worked, you should see a new file within the VM file.
Click on the icon for your virtual machine on the Desktop and click "Show Package Contents". This should result in a list of files – the new file you should be looking for is "win7_raw.vmdk". The next step is to edit the "Windows 7 x64.vmx" file.
Open it in your text editor and search for the line starting with "scsi0.virtualDev" and edit its value to "lsilogic". Then search for "scsi0:0.fileName" and edit its value to "win7_raw.vmdk".
Open VMware and start the virtual machine. It will ask for your password because it needs to access the Bootcamp partition. You’ll need to install Windows from the iso file you created earlier. You may need to press CMD + A to open the settings and go to the CD/DVD section. Click Autodetect and choose the iso image and click enable.
Let the installer do its thing. You’ll need to format the Bootcamp partition using the drive tools because it won’t install on a FAT32 partition. Other than that, all should be well.
4. Delete all the files and copy them from the USB key
When the installation is complete, stop VMware and delete all files from Bootcamp.
OS X will still not be able to boot from the Bootcamp partition so we’ll delete everything we’ve done, and copy the files from our USB device (I’m not quite sure what’s happening here, I suspect that we are essentially using VMware to make the drive bootable, but we need a proper bootsector from our USB drive).
In any case, you may run into some problems while deleting because OS X may refuse to write the files on your NTFS drive. I used the Tuxera trial version to get this done (worked like a charm).
Now, copy all files from your USB key onto the Bootcamp partition.
5. Boot into the Bootcamp partition using rEFInd & Install Windows normally
The last step is installing rEFInd. This is usually a simple matter of running a shell script, but with Yosemite, this has been complicated a bit.
Go to the download page and download the first option, the binary zip file and unzip it.
Open the terminal, type "cd ", drag the unzipped folder (it’s something like "refind-bin-0.8.3") into it and press enter. Type the following command:
sudo bash install.sh –esp
If you’re on Mavericks or earlier this should suffice, but if you’re on Yosemite, you’ll need to do some extra work. Yosemite users should go to "/Volumes/esp/EFI/refind/" and open the "refind.conf" file in their text editor. Find the line that has "dont_scan_volumes" in it. By default this line should be commented out, indicated by a hash sign at the beginning.
Uncomment the line and add two dummy values to it, mine looks like this:
dont_scan_volumes foo,bar
Once this has been done, reboot your Mac – it should use the new boot manager automatically. If it doesn’t reboot, hold down alt and select the "EFI Boot" option in the default boot manager.
Once in, select the Bootcamp partition and install Windows as usual. Once done it is a good idea to install the Bootcamp drivers. You can grab them from Apple and install them through your brand-spanking new Windows.
6. Curse Apple a little bit for making this so difficult
Seriously, Apple? There is no need for such complexity here.
First of all, if Macs do offer the opportunity of installing Windows in the first place, and the option to do it via a bootable USB that’s already built in, why hide this from some users just because they have a disk drive? Also, I’m pretty sure that the default boot manager not seeing boot devices is an artificial limitation, it has nothing to do with the Mac not supporting things.
But in any case, hopefully this article has helped some of you who were struggling with installing Windows on your Macs. I can finally play my Windows games from Steam which was kind of the goal of this whole enterprise in the first place!
I have a 2011 iMac and I’ve installed Windows on it successfully before. The process was extremely straightforward. I popped in my Windows disk and let Bootcamp do its thing. Recently though I had to reinstall and I found that my built-in Superdrive is broken. Installing Windows went from being a breeze to being a nightmare in an instant.
This guide is for those of you who have tried every solution – and upon reading the numerous forums which conclude that Windows "can only be installed via Bootcamp" – have given up.
It took me a while to stumble on to the solution, which uses a combination of different tools, but it works like a charm and once you’ve done it once, it’s not that difficult. Skip ahead to the "What Does Work" section if you want to get down to work.
During the course of my Windows install venture I figured out at least 6 ways which didn’t work. They all have their eureka moments, but don’t work out in the end.
1. Cleaning The Superdrive
Apparently you can drape something like a lens cleaner over a thin business card, stick the thing into the slot and get to work on it. The business end of the drive is at the bottom so if you wiggle it just right, and you’re lucky, you could be successful in cleaning the thing. You can also try blowing some compressed air into it.
If you were successful in doing so you can basically skip this guide and install via Basecamp, well done!
2. Bootable USB Via Bootcamp
The only snag with this was that I didn’t have this option. Apparently this is only available for computers without an optical drive. There is a way in which you can enable this pretty easily though. This is something we will need to do further on as a part of our installation, but it still doesn’t work on its own.
When I saw the option, I promptly clicked on it and let Bootcamp create a startup USB for me. It worked at first, but then refused to even acknowledge it in the boot menu. I tried this with and without Bootcamp drivers and I even tried checking the "Install Windows" options which would automatically start the process for me.
I was a bit downcast but I thought: hey, let’s create a bootable USB in Windows! I found a Windows laptop and created an USB using Rufus. Of course, it didn’t work, it wasn’t seen by the boot manager. I went back and used the Windows 7 USB/DVD Download Tool which was made by Microsoft. Still nothing. Changed another pen drive. Nope. Sigh.
3. Firmware Update
Good news, my iMac model has a firmware update, and what’s more, this update has to do with "booting" stuff (is luck finally on my side?). I downloaded and installed the firmware update and after a terrifying BIOS beep, everything was back to the good old not working ways.
Oh well, at least my firmware is updated.
4. rEFInd Boot Manager
After reading a whole lot of forums I saw that using rEFInd, an alternative boot loader may help.
Once installed and loaded on startup it "saw" the USB, however, while it was able to access the drive, I always receive a "No bootable disk found" message. This was weird since the message obviously came from the boot device, why is it looking for (maybe) a CD? Try as I may, rEFInd was not the answer, although just like Bootcamp, it is a part of the final solution.
5. Using An External Drive
Nope. This was the second thing I tried but it didn’t even see the CD. Once I had rEFInd installed I tried again; the CD showed up in the boot manager, but it refused to boot from it. All I got was a horizontal cursor and nothing more. One thing I didn’t try was an Apple-made external drive but while it’s possible that (for some unknown reason) this would work, I have read that it doesn’t.
6. Virtual Machines
I remember from using Parallels that it can use a Bootcamp partition, allowing me to use the bootable partition as a virtual machine. I had a feeling this wouldn’t work, but it was worth a shot. Parallels (and other virtualization apps) can’t install Windows as boot partitions. They can use them once created, but only if created separately.
Again, virtual machines will be a part of our solution, but not THE solution.
What Does Work
Technically, it is a specific series of operations that works. My source for it is Yes, This Big – a huge thank you to them for figuring out the final solution.
Here is the simplified rundown of the solution:
Force Bootcamp to create a bootable disk
Create a custom virtual machine with VMware (the trial version is sufficient)
Modify the virtual machine and install Windows onto the Bootcamp partition
Delete all the files and copy them, from the USB key
Boot into the Bootcamp partition using rEFInd and Install Windows normally
Curse Apple a little bit for making this so difficult
Let’s take a look at the specifics of all these steps, by the end of which you will have a nice little Windows install!
1. Force Bootcamp to create a bootable disk
If you don’t have this option enabled, you’ll need to edit some files.
You’ll need your computer’s (1) Boot ROM version and (2) Model Identifier which can be found in System Report. (Open up Spotlight, with Cmd + Space, and type "System Information".)
Here’s a sample of what you will see:
Head on over to the Applications/Utilities folder, right-click "Boot Camp Assistant.app" and choose "Show Package Contents".
Go into the "Contents" folder and make a copy of "info.plist" somewhere, just in case. Next, open the original "info.plist" file in a text editor, and search for "USBBootSupportedModels" – it should be somewhere at the bottom.
Look up your model identifier and add it as a string, something like this:
Open Bootcamp and wonder at the appearance of the "Create a Windows 7 or later version install disk". Click all the checkboxes and let Bootcamp do its thing. You’ll need to supply it with an ISO image which you can generate with Rufus or the Windows 7 USB/DVD Download Tool.
Once Bootcamp is done, it won’t be able to install Windows. When it reboots, press the alt button until the boot manager comes up and boot back into OS X.
2. Create a custom virtual machine with VMware
Note: I’m pretty sure this can be done with other virtualization software as well but I don’t know enough about this topic to go rogue. The trial version of VMware is more than enough for this task so you can get it done free either way.
Before we jump in, we’ll need to take a look at the disk identifier of our Bootcamp partition.
Using Spotlight to type "Disk Utility", click on the BOOTCAMP partition and press CMD + i. This will bring up a disk info window where you can find the Disk Identifier – make a note of it.
Open VMware fusion and press CMD + N to create a new virtual machine. You’ll need to click "More options…" and select "Create a custom virtual machine". Then click Continue.
Now, select the operating system you are installing, click Continue and select "Create a new virtual disk" from the next menu. Click Continue and select "Customize Settings" from the bottom of the next screen; this will let you specify the location for the virtual machine. I selected my desktop for easy access – you can safely delete it once this is all over anyway. Finish up and close VMware.
3. Modify the virtual machine and install Windows onto the Bootcamp partition
Now, we’ll use some trickery to make VMware use our Bootcamp partition as the target location for the install.
To edit the settings for the virtual machine you’ll need to open up a terminal. Once ready, type "cd " (add a space at the end) and drag the icon of your virtual machine into the terminal and press Enter.
Now you’ll need to issue a command which will link the VM to Bootcamp, take care to replace [X] and [Y] with the correct values.
You won’t see any feedback from the terminal but if it worked, you should see a new file within the VM file.
Click on the icon for your virtual machine on the Desktop and click "Show Package Contents". This should result in a list of files – the new file you should be looking for is "win7_raw.vmdk". The next step is to edit the "Windows 7 x64.vmx" file.
Open it in your text editor and search for the line starting with "scsi0.virtualDev" and edit its value to "lsilogic". Then search for "scsi0:0.fileName" and edit its value to "win7_raw.vmdk".
Open VMware and start the virtual machine. It will ask for your password because it needs to access the Bootcamp partition. You’ll need to install Windows from the iso file you created earlier. You may need to press CMD + A to open the settings and go to the CD/DVD section. Click Autodetect and choose the iso image and click enable.
Let the installer do its thing. You’ll need to format the Bootcamp partition using the drive tools because it won’t install on a FAT32 partition. Other than that, all should be well.
4. Delete all the files and copy them from the USB key
When the installation is complete, stop VMware and delete all files from Bootcamp.
OS X will still not be able to boot from the Bootcamp partition so we’ll delete everything we’ve done, and copy the files from our USB device (I’m not quite sure what’s happening here, I suspect that we are essentially using VMware to make the drive bootable, but we need a proper bootsector from our USB drive).
In any case, you may run into some problems while deleting because OS X may refuse to write the files on your NTFS drive. I used the Tuxera trial version to get this done (worked like a charm).
Now, copy all files from your USB key onto the Bootcamp partition.
5. Boot into the Bootcamp partition using rEFInd & Install Windows normally
The last step is installing rEFInd. This is usually a simple matter of running a shell script, but with Yosemite, this has been complicated a bit.
Go to the download page and download the first option, the binary zip file and unzip it.
Open the terminal, type "cd ", drag the unzipped folder (it’s something like "refind-bin-0.8.3") into it and press enter. Type the following command:
sudo bash install.sh –esp
If you’re on Mavericks or earlier this should suffice, but if you’re on Yosemite, you’ll need to do some extra work. Yosemite users should go to "/Volumes/esp/EFI/refind/" and open the "refind.conf" file in their text editor. Find the line that has "dont_scan_volumes" in it. By default this line should be commented out, indicated by a hash sign at the beginning.
Uncomment the line and add two dummy values to it, mine looks like this:
dont_scan_volumes foo,bar
Once this has been done, reboot your Mac – it should use the new boot manager automatically. If it doesn’t reboot, hold down alt and select the "EFI Boot" option in the default boot manager.
Once in, select the Bootcamp partition and install Windows as usual. Once done it is a good idea to install the Bootcamp drivers. You can grab them from Apple and install them through your brand-spanking new Windows.
6. Curse Apple a little bit for making this so difficult
Seriously, Apple? There is no need for such complexity here.
First of all, if Macs do offer the opportunity of installing Windows in the first place, and the option to do it via a bootable USB that’s already built in, why hide this from some users just because they have a disk drive? Also, I’m pretty sure that the default boot manager not seeing boot devices is an artificial limitation, it has nothing to do with the Mac not supporting things.
But in any case, hopefully this article has helped some of you who were struggling with installing Windows on your Macs. I can finally play my Windows games from Steam which was kind of the goal of this whole enterprise in the first place!