Showing posts with label 64bit. Show all posts
Showing posts with label 64bit. Show all posts

26 April 2009

Install Windows on Macbook Air with no external drive

Normally to install Windows on a Macbook Air through Boot Camp, you require an external SuperDrive. What a pain - I'm not prepared to pay for something I won't use for any other purpose. Of course I could (and have) installed Windows in a VM but it just isn't as speedy; sometimes I need good performance for my Windows apps.

The "normal" way to install apps on a Macbook Air is to use downloaded versions or Remote Disc. Neither will work for your Windows install. However after much experimentation I have come with a solution that will work.

Disclaimer: The solution I am proposing requires you to be both technically literate and careful. You could completely destroy your data if you are not careful so create full backups of everything before you begin. I'm not responsible for anything you do. Additionally, you shouldn't assume that I've done anything the "right" way - this process was created through trial and error, not an expert knowledge of the software or processes in question.


Here's what you need:

  • A Macbook Air with plenty of free hard drive space.
  • A full, legal copy of Windows Vista or Windows 7 (I haven't tried this with XP).
  • Parallels Desktop (A trial version should be enough).
  • A USB drive of any size.
  • Another computer with a DVD drive and Remote Disc software.
  • Your Macbook Air OS X install disc.
To clarify the above, I believe this is more likely to be a success with Vista or 7 because of their image based install process - a generic image is copied to the hard drive and then customised for your system. This process might work with Windows XP but I haven't tried it. If you do feel adventurous enough to try it then let me know how you got on. Additionally, I'll note that although Apple states that only 32-bit operating systems are supported, I have used 64-bit Windows 7 with no problems.

Let's begin.

If you don't have it already, you should download and install Parallels now. If you already have Parallels, be sure to get the latest Parallels updates. Earlier releases don't work with Windows 7, for example.

Now we need to get our Windows installation files onto the Mac. Use another computer to create an ISO disc image of your Windows DVD (unless your Windows is an ISO already). I like ImgBurn (a Windows app) for these purposes. Copy the ISO to your Mac in your favourite way (network, usb drive etc).

Now it's time to launch the Boot Camp Assistant. Follow the process as normal, right up to the point where it's time to start the Windows installation.

At this stage, just quit the installer (⌘+Q).

Hint: Check now that your Boot Camp partition has not decided to mount itself, otherwise Parallels sometimes gets upset. You can unmount it from Disk Utility if needed.
Start up Parallels and create a new virtual machine.
Skip Detection and select your version of Windows. Be sure to choose the Custom option.
 
The defaults are fine until you get to the Hard Disk Options.
As tempting as it is to select Boot Camp Partition, don't do that. Instead, choose No hard disk. Sometimes Parallels seems to set things up wrong when you choose the Boot Camp Partition option here.
Open the configuration for the virtual machine and configure the CD/DVD-ROM. Choose the Windows ISO file you copied over earlier.
 
Click the + button and add a Hard Disk. Now you can choose the Boot Camp Partition option.
 
Last thing to check - choose the Boot Order option and make sure the CD/DVD-ROM is top of the list.
Time to begin! Start your virtual machine.
Hint: Parallels can be really fussy about Boot Camp partitions sometimes. If you get an error when you try to save your configuration or start the VM, a fix that often works is to close Parallels and then run this command in your terminal: mv "/Library/Parallels/Parallels Service.app/Contents/MacOS/BootcampConfigurator" "/Library/Parallels/Parallels Service.app/Contents/MacOS/BootcampConfigurator.old"
Good ol' Windows installer.
Make sure you choose your BOOTCAMP partition. You might find you need to click the Drive Options link then Format your BOOTCAMP partition, depending on the version of Windows your are installing.
Follow the typical installation process but keep your eyes on it. You want it to keep on installing until the first time it tries to reboot. Just as it shuts itself down to reboot, stop the VM!
Quit Parallels.

Here comes the tough part. If you were to reboot now and try to force your Mac to boot Windows it won't work. A typical PC's hard disk has code right at the beginning of the disk which tells it where to find crucial operating system files - the MBR. Windows has gone ahead and installed the MBR but it's installed in its VM, not to the real hard disk. We have to copy this MBR to the real hard disk and at the same time be careful not to mess up the Mac install.

First we need to find the VM's MBR. To do this, locate your Windows VM on your Mac hard drive. Typically this will be in your Documents/Parallels folder. To get to the MBR, right click your VM and choose  Show package contents. Repeat this for your VM hard drive which will share the name of your real hard drive (mine is called SAMSUNG HS082HB.hdd). The PhysicalMbr.hds file is what we need. Copy this to your USB drive.

Now start up Terminal.

We'll use Fdisk to view and modify our MBR as necessary. Let's start by running sudo fdisk -e /dev/disk0. Enter your password.

Type print followed by pressing return to view your current MBR information.

It's important now to note this information, just in case. Note specifically the id column - notice how there's an EE? That's for the GUID Partition Table the Mac uses. You might want to read up about GPT. The takeaway point is that the first sector of the drive is reserved for the MBR, even though we've also got a GPT partition. Note that the Boot Camp partition is listed as Fat-32 despite the fact that I used NTFS on my Windows partition. This is because the real MBR has not been updated with the new partition information.

Type exit and return.

Now we're going to write the new MBR. This part is very dangerous if done incorrectly. Additionally, Mac OS does not allow you to write a new MBR from within the OS. If you try, you will find that access is denied (even for the super user). Instead, we need to boot the Mac OS X Installer and write the MBR from there. So reboot your Mac and use Remote Disc to start the Mac OS X Installer

Hint: Sorry, you can't use your wired ethernet here, only wireless. This is because we have to keep our one USB port free for the USB flash drive. A hub might work if you have one though.


When the OS X installer is ready to go, do not proceed with it. Instead, go to the Utilities menu and open Disk Utility. Click each of your hard drive's partition and unmount each.

Now we will open the Terminal. Make sure your USB drive is plugged in.


Hint: In case you don't know, you must press return after every command in the terminal.

Navigate to your flash drive. To do this, first type

cd /Volumes

Type ls and identify which is your flash drive. Type
cd

The first thing to do is back up your old MBR.

Be very careful entering these commands.
dd if=/dev/disk0 of=backup.mbr bs=512 count=1

This will back up the MBR to a file called backup.mbr on your USB drive.

Now we replace the physical MBR with the one copied from the VM.
dd if=PhysicalMbr.hds of=/dev/disk0 bs=512 count=1


This assumes you didn't rename the VM MBR when you copied it to your USB drive.


Hint: If something bad happens and you need to restore your MBR, type the same command as directly above, but substitute PhysicalMbr.hds for backup.mbr.

Now that we've replace the MBR we need to check it looks ok. Type

fdisk -e /dev/disk0

Type print to view your MBR. The most important thing to check which Windows may have stuffed up is the id of each partition. Your first partition must have an id of EE, your Mac Partition must have an id of AF. If either of these is wrong you must change them (don't worry, this doesn't modify the data on these partitions). For each that is wrong, type setpid n where n is the number of the partition whose id you are changing. Then, when prompted, type the correct id.

When you are done with fdisk, type write and then exit.

You can quit the Mac OS X Installer now.

As the computer boots, just after you hear the chime, hold down the option key on the keyboard. Windows should now be one of the options in your boot menu, so choose it.


Windows should start and continue with installation.


When Windows restarts, remember that you will have to hold down the option key again and choose Windows.

And finally...


Hello Windows.

17 February 2009

Hi AnchorFree!

According to my Analytics stats, I've recently received some visits from AnchorFree, the makers of Hotspot Shield, probably checking the source of some of the traffic to their iPhone page (i.e. my post about using Hotspot Shield in 64-bit Windows).

Great! Hopefully this will let them think about compatibility with 64-bit operating systems. There are difficulties around driver signing issues in 64-bit versions, however, so I don't expect anything in the short term. Meanwhile, I don't expect them to be concerned about people using my method of connecting to Hotspot Shield as they still show their advertisements.

19 December 2008

Use Hotspot Shield in Vista 64-bit (no software required)

Update 18/03/2009: Sorry everyone, it looks like this is not currently working. The entire Hotspot Shield for iPhone service seems to be down as it's not working on my iPod Touch right now either. Let's hope it's temporary.

Hotspot Shield is software that encrypts your internet traffic between your PC and their servers, purportedly to avoid snooping at open WiFi hotspots (a purpose for which it works great). My main use of it (being outside the US) is to access the multitude of US only sites and services (Hulu, Lala and Pandora to name only a few).

Unfortunately it comes bundled with a TUN/TAP driver that is not 64-bit compatible - it doesn't even fail gracefully during installation, rather you end up with this error:

An error occured installing the TAP VPN driver.
The application continues to install and even prompts to run at the end, but then immediately dies.
But there's another way. Hotspot Shield offers a service for the iPhone (and iPod Touch) which uses L2TP to create the VPN connection. You can use the same connection within Windows Vista (and any other operating system which supports L2TP) to use the same service. Here's how I did it:
  • Create a new VPN connection (Start > Network > Network and Sharing Center > Set up a connection or network > Connect to a workplace > Use my Internet Connection (VPN)).
  • Click the giant Get Account ID button.
  • The instructions given are obviously for the iPhone, but there's some important information we need:
Server: 64.55.144.10
Account: abc123 (I'm pretending abc123 is mine - yours will be unique)
Password: abc123 (ditto as above)
Secret: password
  • Enter 64.55.144.10 for the Internet Address. For Destination Name, put whatever you want. I put HotspotShield. Be sure that Don't connect now; just set it up so I can connect later is ticked, because we need to change some advanced settings later.
  • For username and password, enter what you were given by the Hotspot Shield website. Tick Remember this password. You don't need anything for Domain. Close the window when you finish.
  • Now go to Start > Connect To. Right click on the connection you created and choose Properties.
  • On the Networking tab, change Type of VPN to L2TP IPsec VPN and then click IPsec Settings.
  • Choose the Use preshared key for authentication option and type in password for the Key (this is what the iPhone calls Secret).

That's it! You can now connect to HotSpot Shield through the Connect To option on the Start menu - that's even easier than using the software from my point of view. I guess it would be possible to install a 64-bit TUN/TAP driver but I haven't investigated whether one exists for Vista because this way just seems so clean.

Just remember to disconnect after you're finished!
Update: Some folks seem to be having trouble connecting, or with keeping their connection to their ISP. As I haven't experienced such issues myself, it's not something I can help you with - but maybe other commenters can! Thanks to an anonymous commenter who pointed out a possible fix for those who find they lose their connection upon connecting to Hotspot Shield - try the instructions at this Yahoo! Answer post. If it works for you, let everyone know here by leaving a comment. 
Some have found their problems resolved by following the instructions carefully or fiddling with their settings.
Thanks also to the anonymous commenter who pointed out that these instructions will help those who run Windows XP 64 bit.

Update 2: Some commenters are worried about a redirect to rss2search.com, some even worried they are infected with malware. First note that there's no way I could infect you with malware - I haven't offered you anything to install and you are only using settings from Hotspot Shied's iPhone page. In case you haven't noticed, Hotspot Shield is funded by advertising and the rss2search.com page is part of this - you would be getting the same thing if you installed the Hotspot Shield software itself on a supported operating system.

Update 3: Bad news right now I'm afraid - Hotspot Shield's site appears to be returning an error when an Account ID is requested. Nothing I can do about that obviously - let's hope that it's temporary and they fix it soon! Ok, it's working again.



P.S. Hi AnchorFree!