Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Tuesday, March 6, 2018

How to Install Windows 7 or 10 on Mac

Written by Pranshu Bajpai |  | LinkedIn

I like dual booting my systems since I switch between Windows, Mac OS X and Linux fairly regularly. On a PC, I would usually dual boot Windows and Linux, and on a Mac, I usually dual boot Mac OS X and Windows. Installing Windows on a Mac may or may or may not go smooth depending on how old the Mac is. I've installed Windows 7 on a 2011 iMac without a problem so this procedure should work at least as far back as 2011 Macs in my personal experience. But the process itself can get convoluted and there are some pitfalls to be avoided so I decided to document it here.

Bootcamp: To Use or Not to Use?

 

Definitely use Bootcamp. Bootcamp is Apple's native utility for installing Windows on a Mac. Installing Windows and the relevant boot configuring without Bootcamp can be a painful and unnecessarily long process and using Bootcamp is recommended. For example, when I tried to boot my Macbook Pro off of a USB drive containing Windows installation, it got to the installation screen but then would not let me install Windows on the disk as shown below. Note that the disk was MS-FAT. It did not install even when I deleted the partition so I had plenty of unallocated space. I could not even format the unallocated space into NTFS.


I tried to fix this from command line but it was a lot of hassle and should be avoided:



Meanwhile, I messed up the original Mac OS X installation while trying to install Windows and had to reformat the entire drive and reinstall the Mac OS:


 I had to reformat the hard drive because without the reformatting, it would not even show up as an option during Mac installation.


 So I had to format the drive as shown before so I could reinstall the Mac OS X.

All this to show that installing Windows on a Mac without Bootcamp is an unnecessarily cumbersome activity that should be avoided. 

Using Bootcamp

 

Apple did a great job of documenting the procedure here. Follow Apple's instructions there to use Bootcamp. Note that you should have a Windows ISO and a USB drive ready.




Make sure you also download the correct version of drivers needed for your particular Mac. My 2012 Macbook Pro needed version 5.1.5621. If you are installing Windows 7 like me, quit at the screen shown below to manually download the archive containing the right drivers.


Unzip the archive and place it at the root location of your thumb drive.


Next, open Bootcamp again and this time check the 'install Windows 7 or later version'.

It now asks you to resize your partition to make room for Windows. 

It is here that I encountered a strange error: "Your disk could not be partitioned. An error occurred while partitioning the disk. Please run Disk Utility to check and fix the error."


So of course I followed the advise and ran Disk Utility 'First Aid' on my drive to see if it is failing. Everything seemed OK. I thought maybe I will have better luck fixing drive errors if it wasn't mounted so I rebooted into Single User mode (Command+S) and ran '/sbin/fsck -fy' to fix errors:


No luck though. The same error persisted while trying to partition the drive. Long story short, it was 'File Vault' on Mac that was causing the error in partitioning. File Vault is Apple's disk encryption utility and if it is functional, it will protect the drive against manipulating by Bootcamp. So turn off File Vault. This, unfortunately, can take a bit of time as disk encryption and decryption can be slow.



After turning off File Vault, I was able to partition the drive and the system rebooted into the thumb drive to install Windows:


I had Windows running on the Mac in a short while but the Bootcamp drivers still needed to be installed. Otherwise, there is no network connectivity, no display drivers, no sound etc.

So we use the drivers we downloaded earlier into the root folder of the USB stick and let them install:


I still did not have the display right after all the drivers were installed. Turns out that Windows needed to update itself before that problem was fixed. So I updated Windows to the latest definitions and the display drivers for the resident NVIDIA GT 650M card on the 2012 Macbook Pro showed up right away under 'Device Manager'.

Thus ends the dual boot saga.

Friday, February 7, 2014

How To Recover Grub After Installing Windows | Ubuntu / Kali / Debian Linux

Written by Pranshu Bajpai |  | LinkedIn

A Little Rant


It's 2014 and Windows still assumes that it's the only OS out there.

When you install windows and then install Linux, in the grub boot menu you would find Windows properly accounted for. Grub recognized windows and creates an entry for it in the Boot Menu.

Should we assume Microsoft likes bullying (since there's no apparent technical reason for why they won't make a windows boot-loader that would recognize and make an entry for Linux in the Boot menu).

So if you have Linux and then you try to install Windows, it's nasty boot-manager would remove the linux entry and all you will see at Boot time is Windows and no entry for linux.

Kali Linux is the primary OS that I use on my laptop. I rarely ever use windows so I removed it altogether. However I was developing an App for Windows and needed to code in Windows SDK (Visual Studio) since I needed some libraries like 'wlanapi' that weren't present in Linux IDEs

Long story short, I installed Windows on top of Kali and as I expected, it removed the entry to Kali from the boot menu.

Here are a few commands that I used to solve this issue. This is by far the easiest way to bring the Linux / Ubuntu / Kali boot entry back.

How To Recover Grub (Kali Linux Boot Menu Entry) After Installing Windows 

For this you need:

1. Ubuntu (or Any linux) Live CD / USB
2. Eyes to read and Fingers to Type some commands 

Step 1. Boot from the Ubuntu / Kali / Fedora (any linux) live disk OR USB

Step 2. After the 'Live CD Desktop' loads up, Find Terminal.

Step 3. After the Terminal comes up. Type the following commands:

#sudo mount /dev/sda10 /mnt 

#Note that here for me the root ( / ) of my Kali Linux was on device '/dev/sda10'. For you this would be different and you should check this out under 'Disk Manager' in your Live CD. You are looking for the partition number of your main partition

#for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done

#sudo chroot /mnt

#update-grub

#grub-install /dev/sda

#update-grub


Step 5. That's it. Exit the Terminal and reboot.

You should now see Grub restored. This is one of the ways in which you can easily and quickly restore grub after installing windows

Note that sometimes you may loose the entry to your Windows OS after these steps. But all you need to do is run these 3 commands to get it back:

#apt-get install os-prober

#os-prober

#update-grub

 

Update

 

I recently lost Linux grub again after installing Windows 7 on my laptop and this time I decided to try an ISO called 'boot-repair disk'. I had heard of this a lot and seems to be the tool of choice for people who don't want to get their hands dirty using the linux terminal.

The tool is pretty good in that it does what it is meant for, without any glitches. This is all you have to do:

1. Download 'boot-repair disk' ISO
2. Burn it to a CD or make a bootable Pendrive
3. Boot into the boot-repair disk ISO

After that, it is all automated. As soon as you boot into this live disk, it will automatically begin mounting all your file systems and looking for grub. Once it is located, it will be restored automatically and at the end a message will be displayed to you.

So if you are someone who isn't all that thrilled about typing commands on a Linux terminal in the method I discussed previously, this ISO is for you.

References:
AskUbuntu.com

Sunday, October 6, 2013

VPN Configuration / VPN Client in Windows 7 / Windows 8 / Windows xp | How to set up | Anonymous Internet | Creating VPN Secure Connection

Written by: Pranshu | Find Pranshu on Google+ And LinkedIn

In my previous post, I have mentioned the reasons for using VPN and how to install or configure it in Linux.

The process becomes even simpler in the case of Windows.

How to set up / configure VPN connection in Windows

1. Subscribe to a VPN service provider. I have subscribed to AirVPN.

2. Locate 'VPN Configuration Generator' and choose 'Windows' as Operating System.



3. Download the .opvn file and .proxyauth file (in case your local network (proxy) is using Authentication)


4. Goto OpenVPN website --> 'Community' and download 'OpenVPN Client'

5. Install OpenVPN client. Then Goto programs --> OpenVPN --> Config

This should open the 'config' folder. Paste the downloaded .opvn and .proxyauth files there.

6. Run the OpenVPN client. Right Click the 'icon' in right corner below ; choose VPN Server and 'connect'



You should now see a window where VPN is self-configuring according to the information in the .opvn file.

After it finishes, you will notice a new connection with a new IP (Notice a private IP address).


In the 'cmd' terminal, type 'ipconfig' and you should now see the new connection and its IP.


Remove any local proxy settings from the browser and connect to the Internet. You should now be connected through a VPN tunnel.