Topic:   Linux   (Read 5714 times)


0 Members and 1 Guest are viewing this topic.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Linux
« on: June 30, 2013, 07:53:08 PM »
I'm studying to become a professional programmer, and it's important that I start getting some experience with Linux.  To that end I've decided to install Debian on my MacBook.  I've already backed up all my critical files on both the OS X and Windows partitions, and now the only thing left to do is to modify my machine's "boot settings" (for lack of a proper term) and start installing Debian.  This is the scary part because I'm not very familiar with how the machine boots up.  Some of you guys have mentioned using Linux before.  Have any of you ever installed it on a Mac?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Linux
« Reply #1 on: June 30, 2013, 07:56:42 PM »
I've installed Ubuntu on a few of my macs.
Fairly painless.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Linux
« Reply #2 on: June 30, 2013, 09:03:32 PM »
Thanks for responding Gan.

I'm worried because I've read that Windows and Linux don't like to coexist at the BIOS/EFI/hybrid MBR/whatever level.  Also, the method used to boot Linux can affect Linux's ability to use the GPU.  I've prepared myself for the worst-case scenario (messing up and having to reinstall everything) but it would be nice to do it right the first time.   ;D

Gan, did you have to use rEFIt/rEFInd to install a new boot menu?  Have you triple-booted OS X with Ubuntu and Windows, or just dual-booted OS X and Ubuntu?  Regardless, I'd really like to know what you did, and why you did it.  It would give me some much-needed insight.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Linux
« Reply #3 on: June 30, 2013, 09:10:15 PM »
Ubuntu is nice, albeit harder to use than Mac or Windows (just because I'm not used to it.

I use a form of Debian on my Raspberry Pi called Raspbein
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Linux
« Reply #4 on: June 30, 2013, 09:17:40 PM »
Thanks for responding Gan.

I'm worried because I've read that Windows and Linux don't like to coexist at the BIOS/EFI/hybrid MBR/whatever level.  Also, the method used to boot Linux can affect Linux's ability to use the GPU.  I've prepared myself for the worst-case scenario (messing up and having to reinstall everything) but it would be nice to do it right the first time.   ;D

Gan, did you have to use rEFIt/rEFInd to install a new boot menu?  Have you triple-booted OS X with Ubuntu and Windows, or just dual-booted OS X and Ubuntu?  Regardless, I'd really like to know what you did, and why you did it.  It would give me some much-needed insight.
I used Refit, had 10.8, 10.5, Windows and Ubuntu on the same hard drive.
Don't use Bootcamp to install Windows.

If Refit doesn't show up on boot, keep restarting until it does. First time I installed, took 3 restarts for it to show up.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Linux
« Reply #5 on: July 01, 2013, 02:15:53 AM »
Thank you so much, Gan.  This really helps me out.  If I may ask one more question, I promise* it will be the last one:

A tutorial on howtogeek states that a Linux installation should use a swap partition, a root partition, and a home partition.  The reasoning makes sense, but I noticed that this guide is about making a dedicated Linux PC, so this rule may not apply to a multi-boot setup.  Do you think it's still a good idea to create swap, root, and home partitions when using Linux on a multi-boot Mac, or should I just use one partition for all Linux functions?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Linux
« Reply #6 on: July 01, 2013, 02:33:13 AM »
That's above my knowledge. I only had linux limited to 1 partition.

I don't mind questions.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Linux
« Reply #7 on: July 01, 2013, 01:31:57 PM »
Thanks Gan.  In that case, I'll keep it simple and just use 1 partition.  If everything goes according to plan, I'll post a message here using "IceWeasel" (a Linux web browser) before the end of the day.    :)

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Linux
« Reply #8 on: July 02, 2013, 04:43:34 PM »
It worked!  I am now running Debian on its own partition alongside OS X and Windows 7.  rEFIt worked like a charm.  I still have a lot of work to do (downloading drivers, etc.), but right now I'm going to take a break.  Thanks for the help Gan!

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: Linux
« Reply #9 on: July 02, 2013, 06:26:22 PM »
I run Ubuntu in a virtual machine to do some of my web development.  A bit more convenient to use than a full Linux install, but quite a bit slower too.  The lag when typing is somewhat annoying.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Linux
« Reply #10 on: July 02, 2013, 07:55:28 PM »
Glad I could help.

Charlo, why do you use Linux for web development?

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: Linux
« Reply #11 on: July 05, 2013, 10:14:18 PM »
Glad I could help.

Charlo, why do you use Linux for web development?
I like to experiment with installing different languages and frameworks, and it's a lot easier to do that in Linux.  A lot of frameworks aren't really intended to be run on Windows.  For vanilla PHP and MySQL I still use Windows, though.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Linux
« Reply #12 on: July 08, 2013, 12:03:29 AM »
Installing Debian on my Mac wasn't as easy as I probably made it sound.  It didn't work the first time, and when it did work, I was unsatisfied because I hadn't installed it the "right" way.  I've written this tutorial so that others can learn how to install Linux on a Mac without having to repeat my mistakes.  I know that nobody has asked for a tutorial here, but it's good information to have, and someone will probably find it through a search engine.


CIRCUIT'S GUIDE TO INSTALLING LINUX ON A MAC
edited 8/10/13

Should I install Linux on a partition or in a VM?
Linux runs faster outside of a VM.  However, installing it on the hard drive requires a lot of work, risk, and time.  You should only do it if you're sure you really want to.

Why is this guide for Macs?  Is installing Linux on a Mac different from installing it on a PC?
Yes.  Even though Apple switched to Intel architecture in 2006, Macs and PCs still have significantly different hardware:
  • Intel Macs use Apple's proprietary variant of a EFI to boot up, whereas PCs usually use a BIOS.
  • Intel Macs use a GPT to divide the hard drive into partitions, whereas PCs have historically used an MBR.
    This is changing.  All new Windows 8 machines are required to boot from UEFI and use GPT partitions.
  • In order to boot Windows XP or Windows 7, Boot Camp must construct a "hybrid MBR" and emulate a BIOS.  This is complicated, dangerous, and just barely works.

The point is: If you want to install Linux the same way you install Windows, you're asking for trouble!

So how should I install it?
You should install Linux on GPT partitions and have it boot natively via UEFI, which is the natural way to install it on a Mac.  I'll explain how.
You'll need the following:
  • A means for backing up your important files prior to partitioning (USB drive, DVD-Rs, cloud, etc.)
  • At least 30-40 free GB of contiguous free space on your hard drive
  • A bootable Linux install CD or DVD with an EFI or UEFI bootloader
  • Either rEFIt or rEFInd (preferably rEFInd) to use as a new boot menu
  • If you have Windows, you will need your Windows install CD/DVD
  • An OS X install disc just in case something goes terribly wrong

Okay, so what do I do?
  • Download rEFIt or rEFInd on your Mac partition and install it.  After you've restarted once or twice, it'll appear every time you boot up.
  • Create the Linux partition(s) using OS X Disk Utility or Windows Disk Manager.  It's best to partition the disk before installing anything, but if you have an OS installed already, you may need to use a special utility to move files away from the end of the disk so that you can have contiguous space for partitioning.
    rEFIt and rEFInd can only "see" 4 partitions in the hybrid MBR, and I'm not sure why that is.  To be safe, make sure that OS X, Windows, and the Linux boot partition are among the first 4 partitions of the disk.
    You can create multiple new partitions for different parts of the Linux system (/, /boot, /home, swap, etc.) just as long as the bootable partition is one of the first 4 partitions of the disk.
  • If you have Windows installed, that installation was broken when you repartitioned the drive.  Don't worry, it's easy to fix.  Reboot, use the gptsync utility at the rEFIt/rEFInd boot menu, and boot your Windows install disc to repair the installation.  (Note: If you're using rEFInd, you will need to edit a config file in OS X to make gptsync appear at the boot menu.)
  • Insert the Linux install disc.  Reboot again and hold down the Option key while booting.  (Do NOT hold down the C key!  Installation will fail if you use the C key.)  Wait for a DVD named "EFI-boot" to appear.  Select it and hit Enter.
    EDIT: The idea is to boot the install disc the same way you will boot the operating system: in EFI mode.  In theory, if the installer boots in EFI, then it will detect the EFI and install an EFI bootloader... but if it boots in BIOS, it will try to install a BIOS bootloader, which will fail because the machine uses EFI.  Unfortunately, this trick doesn't work with all Linux distros, and it may not even work with Debian on Macs different from my own (MacBook6,1).
  • Install Linux.  This is mostly straightforward.  You will have to do a "manual" install instead of a "guided" install to select your Linux partition(s).  The only partition you really need is a root directory partition, mounted as "/", and it must be marked as bootable.
  • Restart again, run gptsync again, maybe repair the Windows installation again, and restart once more.
  • If you see all of your operating systems at the boot menu, then your machine must not be completely screwed up!  Try loading each operating system.  If they all work, congratulations!  If one or more of them don't work... well, I told you this was risky.  Don't worry, this is easy to fix with the right tools, like the Windows install disc.

There's a good chance that this plan won't work for you 100% because each Mac is different.  You should supplement it with other tutorials that you find on the net.  You probably won't find a tutorial that's tailored for your exact machine and Linux distribution, but you will learn more about how things work, and eventually you will figure out how to run Linux on your Mac.

Will Linux be able to use my graphics card?
NVIDIA graphics card drivers don't work with Linux when booted from EFI.  There may be ways to get around this, but I don't know how.  You probably don't need the GPU in Linux anyway.
« Last Edit: August 10, 2013, 03:48:08 PM by Circuit »