I'm trying to give new life to my old white late-2006 MacBook by installing a new OS (dual boot), but I am having problems as my DVD/CD drive is broken and I just can't get my Mac to boot from my flash drive. The Mac has 64 bit processors, but the EFI is 32 bit.
I previously tried (and succeeded) installing Windows 10 with the help of VirtualBox following this incredible guide, but finally decided to drop that solution as I couldn't get the sound to work (everything else worked like a charm though). So, I would instead like to give 64 bit Ubuntu a try.
Could a similar approach, using VirtualBox as in the guide above, be used to install Ubuntu without USB or DVD, or would access to the physical disk via VirtualBox be a limitation?
I'm currently running OSX 10.7 Lion and VirtualBox 4.3.40.
Best Answer
My objective is to post a procedure that would allow you to boot a Ubuntu Desktop Live. Once you have booted, you could then install the regular Ubuntu Desktop. The only way I can figure out how to boot Ubuntu Desktop Live is by using GRUB. The problem is I can not determine a way to install GRUB without first installing some version of Linux. In this case, I choose to install Ubuntu Server inside a VirtualBox machine. This machine was configured to use a subset of the Mac's physical HD partitions. Once GRUB was installing in these partitions, Ubuntu Desktop Live could boot without using VirtualBox.
Install Ubuntu Server
To start I will assume your current hard disk is configured as shown below.
The command below will create approximately 40 GB of free space at the end of your internal disk. This command will automatically relocate the
disk0s3
partition.The results can be summarized by the output from the
diskutil list
command, shown below.Before using VirtualBox, all new linux related partitions have to be created. I choose the third party tool
gdisk
to create the partitions. Below is a list of the partitions that need to be created.The output from using the
gdisk /dev/disk0
command to edit the GPT is given below.The output from the command
diskutil list
is shown below. This includes the new partitions created by usinggdisk
.Create folder named "VirtualBox" in your Documents folder.
This step will create the files needed by VirtualBox to access the physical partition where you will install Ubuntu. In a Terminal application window, enter the following commands.
The result should be the creation of the files
linux.vmdk
andlinux-pt.vmdk
in your "VirtualBox" folder. Later, you will select the filelinux.vmdk
to give a virtual machine access to the physical partitions.Configure the virtual machine. Open the VirtualBox application and click on icon above the New label. Enter or select the values shown below, then click the "Continue" button.
Use the default settings except for the hard drive. Choose the "Use an existing virtual hard drive file" button. Navigate to your "VirtualBox" folder. Highlight the
linux.vmdk
file. Open thelinux.vmdk
file. Your window should appear similar to what is shown below.Click the "Create" button.
After returning to the VirtualBox application's "Oracle VM VirtualBox Manager" window, click on the icon above the "Settings" label. Next, click on the icon above the "Storage" label. Highlight "Controller: SATA" in "Storage Devices", then select the "Use Host I/O Cache" option. Your window should appear similar to what is shown below.
Highlight the Empty CD/DVD and select "Choose Virtual Optical Disk File..." to attach the "ubuntu-16.04.3-server-amd64.iso" file. (Hint: Look for the CD/DVD icons)
Click OK to close the window. Your "Oracle VM VirtualBox Manager" window should appear similar to what is shown below.
Click on the icon above the "Start" label to boot from the "ubuntu-16.04.3-server-amd64.iso" file. You can proceed with the installation by choosing the default values until you reach the image shown below. Here, you should choose "Manual".
Select #6, as shown below.
Select "Use as:", as shown below.
Select "swap area", as shown below.
Select "Done setting up the partition", as show below.
Select #7, as shown below.
Select "Use as:", as shown below.
Select "Ext4 journaling file system", as shown below.
Select "Mount point:", as shown below.
Select "/ - the root file system", as shown below.
Select "Done setting up the partition", as show below.
Select "Finish partitioning and write changes to disk", as shown below.
Select "Yes", as shown below.
When prompted to "Install the GRUB boot loader to the master boot record?", select "Yes", as shown below.
The install should proceed to completion.
Use Ubuntu Server to Setup Ubuntu Desktop Live
Using VirtualBox, boot to Ubuntu Server.
After logging in, enter the command below. This will give you
root
user privileges.Copy the MBR to an unused sector in the BIOS boot partition.
Insert
ubuntu-16.04.3-desktop-amd64.iso
into the virtual DVD drive.Enter the commands given below to copy the files from the iso to the hard disk.
Configure GRUB. Start by entering the following commands to edit the
40_custom
file.Add the following lines to the end of the
40_custom
file. This will create Ubuntu Desktop Live and Installation entries in the GRUB menu.After saving your changes to the
40_custom
file, enter the following commands to edit thegrub
file.Find the following line in the
grub
file.Change the line to appear as shown below.
Find the following line in the
grub
file.Change the line to appear as shown below.
After saving your changes to the
grub
file, use the following commands to update grub and return to your home directory.Exit being the
root
user and shutdown the virtual machine.Use OS X to Setup Ubuntu Desktop Live
Copy the MBR GRUB boot code from the BIOS boot partition to the MBR.
Convert to a Hybrid MBR/GPT scheme. The only reason for this step is to get around a bug in the Mac logic board BIOS firmware. Basically, the BIOS will not load the MBR into RAM unless there is an active partition in the MBR table. This conversion can be easily accomplished through the use of the interactive command shown below.
The output from using this command is shown below.
Use the
bless
command to set your Mac to BIOS boot.Replace Ubuntu Server with Ubuntu Desktop
After properly blessing your Mac, restart to boot GRUB. You should get an image similar to what is shown below. Select "Install Ubuntu Desktop 16.04.3".
Install until the message shown below appears. Shortly, after this message is displayed, the window will be populated by partition information. This information will obscure this message.
The window, with the partition information, will appear similar to what is shown below.
This message is wrong. The message clearly says "You will not be able to create, delete or resize partition on this disk." Well, this is exactly what we will be doing.
Delete the last 3 partitions. Select a partition, then select the
-
character. Repeat for the two remaining partitions. The result should appear similar to what is shown below.Add back the desired partitions, I choose the same as was deleted. You may want something different. Perhaps a LVM?
Select the free space as shown below, then select the
+
character.Set the popup window as shown below, then select "OK".
Select the free space as shown below, then select the
+
character.Set the popup window as shown below, then select "OK".
Select the free space as shown below, then select the
+
character.Set the "Mount point" in the popup window, as shown below, then select "OK".
The final results are shown below. To proceed with the installation, select "Install Now".
Select "Continue". Let the installation proceed to conclusion.
Where to Next?
To boot back to OS X, you need to hold down the option key at startup.
You will probably want to use rEFInd as your boot manager.
I made the swap space 4 GiB, because I read this is the amount of RAM installed. Upon review, I see only 3 GiB is usable. A little extra swap space probably is nothing to be concerned over. If you wish, you could make adjustments to my posted installation procedures.
References
There is no reason for readers to look up any of these references. They appear here for my use.
GNU GRUB Manual 2.02
Creating a BIOS/GPT and UEFI/GPT Grub-bootable Linux system
How do I set the grub timeout and the grub default boot entry?
Installation/FromLinux
Can I boot a Live USB fully to RAM, allowing me to remove the disk?
How to bypass “Try it / Install” screen when booting from USB Live Session? (without installing in the USB)