5

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.

  • How did you acquire the Boot Camp Support Software (BCSS) when you tried to install Windows? Do you know the BCSS version? Which version of Ubuntu are you trying to install? Can you give the name of the iso file? Would you prefer installing Windows of Ubuntu? Or, would you want a triple boot? Are your USB drives broken or is it that you can not get Ubuntu to boot from the flash drive? How did you create the Ubuntu flash drive installer from the iso file? Is your MacBook the Mid or Late 2007 model? Was Windows 10 the 32 bit or 64 bit version? – David Anderson Jan 14 '18 at 19:05
  • Is your internal drive a HDD or SSD? What is the drive size? Have you added any other drives? In other words, have you replaced the DVD drive with a HDD or SSD? How much RAM memory do you have installed? – David Anderson Jan 14 '18 at 19:15
  • Installing Windows 10 I used two different BCSS versions for installing the drivers manually: 1) those downloaded by BootCamp from within OSX Lion (which I honestly don't know the version number for); and 2) 5.1.5769. – gaspanic Jan 14 '18 at 21:30
  • Now I'm trying to install Ubuntu 16.04.3 (64 bit). I've tried with the official iso (ubuntu-16.04.3-desktop-amd64.iso) as well as a modified version which I hunted down online (link) once I realized my MacBook runs 32-bit EFI (but 64-bit kernel). In neither case would my flash drive show up in the boot menu (not even with rEFit or rEFind). I created the bootable Ubuntu flash drives using the dd command following the same instructions I've found at several sites online. My USB stick is brand new and doesn't seem to have any other problem. – gaspanic Jan 14 '18 at 21:38
  • I'd prefer Ubuntu over Windows 10, but any of the two is fine as long as it runs smoothly. Working sound is for example vital. Triple boot is not necessary. The Windows 10 version I tried was 64-bit. MacBook is mid-2007 (not Santa Rosa) with 32-bit EFI but 64-bit kernel. Internal drive is HDD of only 80 GB. DVD drive has not been replaced. 4 GB RAM, of which only 3 GB is usable. Hope I answered all your questions. – gaspanic Jan 14 '18 at 21:44
3

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

  1. To start I will assume your current hard disk is configured as shown below.

    /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        +80.5 GB    disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            79.7 GB    disk0s2
       3:                 Apple_Boot                         650.0 MB   disk0s3
    

    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.

    diskutil resizevolume disk0s2 40g
    

    The results can be summarized by the output from the diskutil list command, shown below.

    /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        +80.5 GB    disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            40.0 GB    disk0s2
       3:                 Apple_Boot Recovery                650.0 MB   disk0s3
    
  2. 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.

    • 1.9 GB partition to hold the contents of the Ubuntu Desktop Live iso. This will allow you to replace Ubuntu Server with Ubuntu Desktop.
    • 1 MiB Bios Boot Partition to hold GRUB boot code.
    • 4 GiB Linux Swap Partition. This was chosen to be the same size as your RAM.
    • The remaining space to be allocated for Ubuntu files.

    The output from using the gdisk /dev/disk0 command to edit the GPT is given below.

    GPT fdisk (gdisk) version 1.0.3
    
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present
    
    Found valid GPT with protective MBR; using GPT.
    
    Command (? for help): p
    Disk /dev/disk0: 157286400 sectors, 75.0 GiB
    Sector size (logical): 512 bytes
    Disk identifier (GUID): A7A204BD-463D-4EE5-9A78-8E9804D1539F
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 157286366
    Partitions will be aligned on 8-sector boundaries
    Total free space is 77482197 sectors (36.9 GiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1              40          409639   200.0 MiB   EF00  EFI System Partition
       2          409640        78534639   37.3 GiB    AF00  Macintosh HD
       3        78534640        79804175   619.9 MiB   AB00  Recovery HD
    
    Command (? for help): n
    Partition number (4-128, default 4): 
    First sector (34-157286366, default = 79804176) or {+-}size{KMGTP}: 
    Last sector (79804176-157286366, default = 157286366) or {+-}size{KMGTP}: +1900M
    Current type is 'Apple HFS/HFS+'
    Hex code or GUID (L to show codes, Enter = AF00): 8300
    Changed type of partition to 'Linux filesystem'
    
    Command (? for help): n
    Partition number (5-128, default 5): 
    First sector (34-157286366, default = 83695376) or {+-}size{KMGTP}: 
    Last sector (83695376-157286366, default = 157286366) or {+-}size{KMGTP}: +1M
    Current type is 'Apple HFS/HFS+'
    Hex code or GUID (L to show codes, Enter = AF00): ef02
    Changed type of partition to 'BIOS boot partition'
    
    Command (? for help): n
    Partition number (6-128, default 6): 
    First sector (34-157286366, default = 83697424) or {+-}size{KMGTP}: 
    Last sector (83697424-157286366, default = 157286366) or {+-}size{KMGTP}: +4G
    Current type is 'Apple HFS/HFS+'
    Hex code or GUID (L to show codes, Enter = AF00): 8200
    Changed type of partition to 'Linux swap'
    
    Command (? for help): n
    Partition number (7-128, default 7): 
    First sector (34-157286366, default = 92086032) or {+-}size{KMGTP}: 
    Last sector (92086032-157286366, default = 157286366) or {+-}size{KMGTP}: 
    Current type is 'Apple HFS/HFS+'
    Hex code or GUID (L to show codes, Enter = AF00): 8300
    Changed type of partition to 'Linux filesystem'
    
    Command (? for help): p
    Disk /dev/disk0: 157286400 sectors, 75.0 GiB
    Sector size (logical): 512 bytes
    Disk identifier (GUID): A7A204BD-463D-4EE5-9A78-8E9804D1539F
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 157286366
    Partitions will be aligned on 8-sector boundaries
    Total free space is 6 sectors (3.0 KiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1              40          409639   200.0 MiB   EF00  EFI System Partition
       2          409640        78534639   37.3 GiB    AF00  Macintosh HD
       3        78534640        79804175   619.9 MiB   AB00  Recovery HD
       4        79804176        83695375   1.9 GiB     8300  Linux filesystem
       5        83695376        83697423   1024.0 KiB  EF02  BIOS boot partition
       6        83697424        92086031   4.0 GiB     8200  Linux swap
       7        92086032       157286366   31.1 GiB    8300  Linux filesystem
    
    Command (? for help): w
    
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    
    Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/disk0.
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Warning: The kernel may continue to use old or deleted partitions.
    You should reboot or remove the drive.
    The operation has completed successfully.
    

    Note: It would be a good idea to restart the Mac.

    The output from the command diskutil list is shown below. This includes the new partitions created by using gdisk.

    /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        +80.5 GB    disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            40.0 GB    disk0s2
       3:                 Apple_Boot Recovery                650.0 MB   disk0s3
       4:           Linux Filesystem                         2.0 GB     disk0s4
       5:        Bios Boot Partition                         1.0 MB     disk0s5
       6:                 Linux Swap                         4.3 GB     disk0s6
       7:           Linux Filesystem                         33.4 GB    disk0s7
    
  3. Create folder named "VirtualBox" in your Documents folder.

    Note: At this point, one should realize it would be easier to copy the commands from this document and paste them into the Terminal application window.

  4. 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.

    cd  ~/documents/virtualbox
    sudo  chmod  go+rw  /dev/disk0s4
    sudo  chmod  go+rw  /dev/disk0s5
    sudo  chmod  go+rw  /dev/disk0s6
    sudo  chmod  go+rw  /dev/disk0s7
    sudo  vboxmanage  internalcommands  createrawvmdk  -filename  "$PWD/linux.vmdk"  -rawdisk  /dev/disk0  -partitions  4,5,6,7
    sudo  chown  $USER  linux*.vmdk
    

    Note: This access granted by the chmod command will only last until OS X is rebooted.

    The result should be the creation of the files linux.vmdk and linux-pt.vmdk in your "VirtualBox" folder. Later, you will select the file linux.vmdk to give a virtual machine access to the physical partitions.

  5. 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.

    a1

    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 the linux.vmdk file. Your window should appear similar to what is shown below.

    a2

    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.

    3a

    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)

    a4

    Click OK to close the window. Your "Oracle VM VirtualBox Manager" window should appear similar to what is shown below.

    a7

  6. 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".

    35_55

    Select #6, as shown below.

    37_12

    Select "Use as:", as shown below.

    37_37

    Select "swap area", as shown below.

    37_53

    Select "Done setting up the partition", as show below.

    38_06

    Select #7, as shown below.

    38_17

    Select "Use as:", as shown below.

    38_34

    Select "Ext4 journaling file system", as shown below.

    38_45

    Select "Mount point:", as shown below.

    39_04

    Select "/ - the root file system", as shown below.

    39_13

    Select "Done setting up the partition", as show below.

    39_50

    Select "Finish partitioning and write changes to disk", as shown below.

    40_11

    Select "Yes", as shown below.

    40_27

  7. When prompted to "Install the GRUB boot loader to the master boot record?", select "Yes", as shown below.

    47_18

    The install should proceed to completion.

Use Ubuntu Server to Setup Ubuntu Desktop Live

  1. Using VirtualBox, boot to Ubuntu Server.
  2. After logging in, enter the command below. This will give you root user privileges.

    sudo  bash
    
  3. Copy the MBR to an unused sector in the BIOS boot partition.

    dd  if=/dev/sda  count=1  seek=1800  of=/dev/sda5
    
  4. Insert ubuntu-16.04.3-desktop-amd64.iso into the virtual DVD drive.

  5. Enter the commands given below to copy the files from the iso to the hard disk.

    Note: The rsync command may take a while to complete.

    mkfs.ext4  /dev/sda4
    mkdir  live
    mount  /dev/sda4  live
    mkdir  dvd
    mount  /dev/sr0 dvd
    rsync  -a  dvd/*  live
    eject
    rmdir  dvd
    umount  live
    rmdir  live
    
  6. Configure GRUB. Start by entering the following commands to edit the 40_custom file.

    cd  /etc/grub.d
    nano  40_custom
    

    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.

    menuentry "Ubuntu Desktop 16.04.3 Live" {
            set root=(hd0,4)
            linux /casper/vmlinuz.efi boot=casper ignore_uuid
            initrd /casper/initrd.lz
    }
    menuentry "Install Ubuntu Desktop 16.04.3" {
            set root=(hd0,4)
            linux /casper/vmlinuz.efi boot=casper only-ubiquity ignore_uuid
            initrd /casper/initrd.lz
    }
    

    After saving your changes to the 40_custom file, enter the following commands to edit the grub file.

    cd  /etc/default
    nano  grub
    

    Find the following line in the grub file.

    GRUB_DEFAULT=0
    

    Change the line to appear as shown below.

    GRUB_DEFAULT=3
    

    Find the following line in the grub file.

    GRUB_TIMEOUT=2
    

    Change the line to appear as shown below.

    GRUB_TIMEOUT=-1
    

    After saving your changes to the grub file, use the following commands to update grub and return to your home directory.

    update-grub
    cd  ~
    
  7. Exit being the root user and shutdown the virtual machine.

    exit
    shutdown  now
    

Use OS X to Setup Ubuntu Desktop Live

  1. Copy the MBR GRUB boot code from the BIOS boot partition to the MBR.

    cd  ~
    sudo  dd  if=/dev/disk0s5  count=1  skip=1800  of=mbr.binary
    sudo  fdisk  -u  -y  -f  mbr.binary  /dev/disk0
    sudo  rm  mbr.binary
    
  2. 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.

    sudo  gdisk  /dev/disk0
    

    The output from using this command is shown below.

    GPT fdisk (gdisk) version 1.0.3
    
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present
    
    Found valid GPT with protective MBR; using GPT.
    
    Command (? for help): r
    
    Recovery/transformation command (? for help): h
    
    WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
    just hit the Enter key at the below prompt and your MBR partition table will
    be untouched.
    
    Type from one to three GPT partition numbers, separated by spaces, to be
    added to the hybrid MBR, in sequence: 2 3 4
    Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
    
    Creating entry for GPT partition #2 (MBR partition #2)
    Enter an MBR hex code (default AF): af
    Set the bootable flag? (Y/N): n
    
    Creating entry for GPT partition #3 (MBR partition #3)
    Enter an MBR hex code (default AB): ab
    Set the bootable flag? (Y/N): n
    
    Creating entry for GPT partition #4 (MBR partition #4)
    Enter an MBR hex code (default 83): 83
    Set the bootable flag? (Y/N): y
    
    Recovery/transformation command (? for help): w
    
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    
    Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/disk0.
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Warning: The kernel may continue to use old or deleted partitions.
    You should reboot or remove the drive.
    The operation has completed successfully.
    

    Note: As the above message states, It would be a good idea to restart your Mac.

  3. Use the bless command to set your Mac to BIOS boot.

    sudo  bless  --device  /dev/disk0  --setBoot  --legacy
    

Replace Ubuntu Server with Ubuntu Desktop

  1. 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".

    00-03

  2. 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.

    c0

    The window, with the partition information, will appear similar to what is shown below.

    c1

    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.

  3. 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.

    c2

  4. 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.

    c3

    Set the popup window as shown below, then select "OK".

    c4

    Select the free space as shown below, then select the + character.

    c5

    Set the popup window as shown below, then select "OK".

    c6

    Select the free space as shown below, then select the + character.

    c7

    Set the "Mount point" in the popup window, as shown below, then select "OK".

    Note: Do not change the "Size:" value. Your value may be different from what is shown below.

    c8

    The final results are shown below. To proceed with the installation, select "Install Now".

    c9

  5. Select "Continue". Let the installation proceed to conclusion.

    c10

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)

  • Wow, an outstanding guide! I've just completed the steps up until "Replace Ubuntu Server with Ubuntu Desktop", which I will have to do during the weekend. Once completed I'll mark this as answered. Just a conceptual question: would it be possible to complete the steps of "Replace Ubuntu Server with Ubuntu Desktop" from within VirtualBox in OS X by booting VirtualBox into "Install Ubuntu..."? – gaspanic Jan 25 '18 at 12:03
  • To test this procedure, I did exactly what you propose. So, yes you can. The problem is Ubuntu Desktop will install based on the virtual hardware. A pretest would be to boot Ubuntu Desktop Live from outside VirtualBox. The live version does not require installation. Your HHD will remain unchanged. This will give you a chance to test your Mac's hardware compatibility with Ubuntu. – David Anderson Jan 25 '18 at 12:45
  • So, after finishing all steps up until "Replace Ubuntu Server with Ubuntu Desktop" I reboot, but instead of the GRUB boot screen I get stuck with "No bootable device--insert boot disk and press any key." Booting back into OSX and running Ubuntu Server from VirtualBox I do see the GRUB boot screen as expected, with the manually added menu items. From here I can boot both Ubuntu Server and Ubuntu Desktop Live without any problems. – gaspanic Jan 26 '18 at 1:11
  • I've revised all steps, commands, and inputs in sections "Use Ubuntu Server to Setup Ubuntu Desktop Live" and "Use OS X to Setup Ubuntu Desktop Live" and they seem correct. Any suggestions? – gaspanic Jan 26 '18 at 1:12
  • You could post the output from these commands to your question: sudo hexdump -C -v -n 512 /dev/disk0 and sudo gpt -r show /dev/disk0. – David Anderson Jan 26 '18 at 4:21
0

This answer address your attempt to install Windows 10. All Mac models through the 2007 model year, which could run Windows, did so using the BIOS boot method. All the drivers included in the Boot Camp Support Software (BCSS) were design for a BIOS boot. If one was able to achieve a EFI boot, they usually were rewarded with the failure of one or more hardware devices.

The BCSS you downloaded using the Boot Camp Assistant should have been the same as from the website Boot Camp Support Software 4.0.4033. You should use this software regardless of a 32 bit or 64 bit install and for Windows 7 through Windows 10. I have a 17-inch, mid 2007 iMac, which also uses the same BCSS. I have successfully installed 64 bit Windows 7, 8 and 10.

If you install a 64 bit version of Windows, you might have trouble installing the BCSS. Basically, Apple inserted a scarecrow application to fool you into thinking you can not run the installer. Once you bypass this application, the Boot Camp Support Software should not have any problems installing. This bypass procedure is outlined at this Ask Different website.

  • I apologize, but you're right: my model is not the mid-2007, but instead the late-2006. And it was indeed using the command you mention that I discovered my model has a 32-bit EFI. – gaspanic Jan 15 '18 at 18:23
  • Thank you for the bypass procedure, I hadn't come across that one before. If I decide to go for Windows 10 again (I uninstalled it some days ago) I'll give it a shot. However, if Ubuntu is a valid option for this model I'd prefer that over Windows 10. – gaspanic Jan 15 '18 at 18:28
  • OK, I succeeded in installing 64 bit Ubuntu Desktop 16.04.3 LTS without using a USB flash drive. At least, I can do so in simulation. I do have more questions. First, can you run the 64 bit Ubuntu Server 16.04.3 LTS (ubuntu-16.04.3-server-amd64.iso) in VirtualBox?. Install using default settings. Second, can you create a USB flash drive installer from the 32 bit Ubuntu Server 16.04.3 LTS (ubuntu-16.04.3-server-i386.iso)? You do not have to install. Just tell me if you can boot the flash drive. – David Anderson Jan 17 '18 at 10:00
  • 64 bit Ubuntu Server 16.04.3 LTS .iso loads normally in VirtualBox, but I didn't have time to install yesterday. I'll do that ASAP. I suppose I can essentially follow these instructions? Created a USB flash drive installer from the 32 bit Ubuntu Server 16.04.3 LTS with the dd command using these instructions, but without luck; the disk doesn't show up in the boot screen. – gaspanic Jan 19 '18 at 10:47
  • Installed Ubuntu server successfully, and it boots fine. Having some keyboard input issues with multiple copies of the same character being input upon keypress, but I've been able to work around it to some extent. Haven't experienced this when running Ubuntu desktop nor Windows 10 though. – gaspanic Jan 20 '18 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .