Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install Ubuntu Linux over the network with the help of a Mac UNIX
This hint is about installing Ubuntu Linux over the Internet on a PC compatible with network boot (PXE) without using a CD/DVD drive, a USB Flash drive, or having previously downloaded a full disc image.

You will need another computer on the same LAN. I will be using a Mac, hence why you're reading this hint here. Both computers obviously need Internet access.

On the Mac:
  1. Install a DHCP server. The command below assumes you have Macports installed on your Mac, which allows for easy install of lots of Unix apps. In Terminal, run this command:
    $ sudo port install dhcp
    There are other ways to install a DHCP server, but I will not cover them. In fact, Mac OS X probably comes with one (for its Internet Sharing feature), but using Macports was easier to me than finding out where it is and how to use it.

  2. Create the folder /Users/Shared/tftpboot/

  3. Download TFTPServer and launch it. Click the toolbar button Change Path and set it to /Users/Shared/tftpboot/. Click the Fix button at the bottom to set folder permissions appropriately, and start the server with the Start TFTP toolbar button.

  4. Download Ubuntu Linux' netboot image. Login to the Ubuntu FTP server (user: anonymous).

    As of today, Lucid Lynx (download via FTP) is the latest release. Download all files on that ftp folder to /Users/Shared/tftpboot/, or use the first link above to pick another distribution.

  5. Open up your favorite plain text editor, and copy and paste the following lines:
        authoritative;
        ddns-update-style none;
        pid-file-name "/Users/Shared/tftpboot/dhcpd.pid";
    
        # Change X.X.X to your LAN's IP range (something like 10.0.0, 192.168.1, 192.168.0…)
    
        subnet X.X.X.0 netmask 255.255.255.0 {
          range X.X.X.151 X.X.X.205;
        }
        option domain-name-servers 8.8.8.8;
        host netbook {
    
          # Change X.X.X to your LAN's IP range (something like 10.0.0 or 192.168.1)
          # Change ??:??:??:??:??:?? to the MAC address of the computer you
          # want to install Linux on.
    
          hardware ethernet ??:??:??:??:??:?? ; 
          filename "pxelinux.0";
          next-server X.X.X.101;
          fixed-address X.X.X.202;
          option subnet-mask 255.255.255.0;
          option broadcast-address X.X.X.255;
          # Change the 'n' in the next line to the number in the last
          # segment of your Internet router's local IP address.
          option routers X.X.X.n;
        }
    Edit according to the comments preceded by #, and save it as dhcp.conf in the folder /Users/Shared/tftpboot/.

    If you do not know the MAC address of the computer you want to install Linux on, go to the next section ('On your network boot-compatible (PXE) PC'), do steps one and two, and give it some time. The MAC address will probably appear on screen at some point.

  6. Run the DCHP server by executing this command in Terminal:
    $ sudo dhcpd -f -d -cf /Users/Shared/tftpboot/dhcp.conf > /Users/Shared/tftpboot/dhcpd.log
On your network boot-compatible (PXE) PC:
  1. Plug it to your local network with an ethernet cable.

  2. Turn it on, and look for a way to change boot order of devices. You may have to press an F key, or change a setting in its BIOS. The former is preferable. Select Network boot or something that sounds like that.

    Note: it is usually not advisable to run more than one DHCP server on the same IP range. Your internet home router may be running one as well so that all your devices can access the internet without having to manually tweak their network configuration. Nevertheless, I did not switch my router's DHCP server off and everything still worked fine. Your mileage may vary.

  3. Follow on-screen install instructions.
Once the installation has finished, you can safely stop the DCHP server in your Mac pressing keys Command and period (in Terminal), quit the TFTPServer app, drag that application and the folder /Users/Shared/tftpboot/ to the Trash, and uninstall the DCHP server with the command below (if you installed it using Macports):
$ sudo port uninstall dhcp
[crarko adds: I haven't tested this one.]
    •    
  • Currently 2.71 / 5
  You rated: 5 / 5 (24 votes cast)
 
[16,011 views]  

Install Ubuntu Linux over the network with the help of a Mac | 22 comments | Create New Account
Click here to return to the 'Install Ubuntu Linux over the network with the help of a Mac' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: willgonz on May 05, '10 08:09:38AM

You don't need to download dhcp. It is built in using Bootp daemon.
Same with tftp. You can use the tftp daemon.

Edited on May 05, '10 08:10:26AM by willgonz



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: elmimmo on May 06, '10 01:07:30PM

Sure you don't. Yet the bundled tftp command-line tool does not come with easy to click "Start" button, or "Change Path" or "Fix permissions".

TFTPServer is no server at all, just an UI for OS X's command-line tool. The whole point of the hint is to make a difficult task less difficult.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: fritztoch on May 05, '10 08:36:46AM

I was very excited to see an article about using a Mac to install linux over the internet, only to see the instruction that I need a computer on the same LAN. These statements sound contradictory to me. Can anyone explain how I can do this install over the "internet" while being on the same LAN?



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: vashremix on May 05, '10 09:01:46AM

Suppose that one already has an Xserve running DHCP... and even DNS.

I'm trying to understand how to modify your configurations it so that it wouldn't break what the Xserve is already doing, but could also allow for the Linux' netboot.
Thanks for any pointers.
Jeff



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: xplora on May 05, '10 11:37:16AM

This is the second time I've had to point out that a hint that has been posted, ISN'T a Mac OS X Hint, I'd like to suggest that if this keeps up, perhaps the site should be renamed.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: robg on May 05, '10 01:38:41PM

Perhaps I shouldn't ever run a hint about Safari then either, correct? Because, really, Safari isn't OS X...nor is Firefox or Pages or Numbers or Keynote or Aperture or iPhoto. But we run hints on all of those things, and many more that aren't specifically "Mac OS X Hints."

So while the focus of the site is Mac OS X Hints, the actual hints cover a broad spectrum of topics. And yes, a few of those topics are even usable (gasp!) for someone not running a Mac or OS X. But that's the minority; the vast majority of the 13,000+ hints here are targeted directly at those using Macs and OS X.

If you don't like the mix, you're more than welcome to find another site to read, or if there are none that meet your needs, launch one. After all, that's why I started Mac OS X Hints in the first place.

-rob.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: xplora on May 05, '10 03:24:29PM

Ahh but those application based hints all have the same end to be able to use the app better on *GASP* Mac OS X. this one does not, it is designed to help someone install another OS on a machine that isn't even a *GASP-again* Mac.

Just a thought, drop the "ubuntu linux" reference in the title, perhaps call it how to setup a PXE boot service on Mac OS X, and there is your hint, however as it stands it has nothing to do with Mac OS X except the coincidence that Mac OS X is the OS being set up as a PXE boot service for the intended end result of installing ubuntu linux on a PC, which could also obviously be done on a linux machine in a similar way.

If you are going to argue about something, get your facts straight first. :P



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: robg on May 05, '10 03:32:39PM

There's no argument: Nothing about the site's focus will change, so there's nothing to argue about. If you have further issues with hints in the future, please use the email link at the bottom of each page to send feedback directly to those running the site. The comments are for comments about the topic of each hint, not comments about the site.

If you feel you'd rather complain in public, there's a Feedback topic area on the Forum Site; you're more than welcome to post your hatred of all things Mac OS X Hints there. But any further comments that are off-topic to the hint itself will be deleted.

-rob.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: Anonymous on May 05, '10 04:17:31PM

Rob, I take the opposite view -- to both of you.

1. it's not over the "Internet" -- unless the hint is extended to cover DHCP forwarding addresses through multiple firewalls!

2. the software that the user is being advised to install is totally unnecessary because equivalents exist in the OS.

3. the hint is not about Ubuntu -- it's about PXE booting a PXE-bootable OS, for example, Linux, for example, Ubuntu.

Each of these facts restricts the audience that this *USEFUL* hint might reach. Heck, while we're at it, why don't we further restrict the audience by specifying you need Mac OS X 10.5.3 on a G4 12" PowerBook with 1.5 GB of RAM?

If you don't see a problem with the hint as written, then perhaps someone ought to submit a whole bunch of hints for how to PXE-boot every other Linux out there, with each hint using a slightly different dhcp/tftp double-act? Maybe then someone would get the point?



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: robg on May 05, '10 05:46:21PM

I have no issues with something being a bad hint: if people tell me, and demand is there, we'll get rid of it -- we've done it before, and we'll do it again. I cannot possibly understand every single hint we run, so I rely on the audience to help. (Well, I'll rely for only a few more days; then it's Craig's issue.)

So for this hint, should we kill it, edit it, or leave it as is?

What I *do* take issue with is people using the comments to debate the merit of why a hint is on the site. That's not what the comments are for, and such feedback belongs in the Feedback forum or via email.

-rob.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: crarko on May 06, '10 05:05:26AM

Craig's feeling is that if one other person finds a hint useful, it's worth publishing. In this one, if it were me, I'd just burn an ISO. But it's not me. Someone went to the effort to write it up and submit it.

If folks want to see different hints published, the 'Submit Hint' button works just great. Share away!

~CRA



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: Anonymous on May 10, '10 06:45:21PM

Well I guess my pov is colored by having submitted a hint and...

...tumbleweed...

Nowhere to be found anywhere, and still current.

And yet something that tangentially ties Ubuntu to OS X gets published.

Discussing the merits of this hint in this hint's comments is absolutely where it belongs, because this hint is what raised the issue. Taking it to the forum is a great way to get it ignored.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: elmimmo on May 06, '10 01:35:30PM

Regarding 2, please remember this is not a service by expert professionals. I do acknowledge in the hint itself that dhcp is probably not needed, but that is how I managed to do it, cleanly and easily, after spending more time than I would have wanted googling about how to use my Mac to serve a netboot image. For me, it served the purpose so was good enough.

I encourage you to append here how to configure bootp instead of pointless bashing (someone might have learnt something with my hint, nobody learnt anything with your comment).

TFTPServer is not an equivalent to anything in the OS, since it is not a server at all, but an UI for the server that comes with OS X, and an easy one. I leave the guide of how to use the command-line tool to you. Learning that was not my interest at all.

Regarding 3, yeah, I am sure changing the tile "Use Mac OS X to serve a netboot image" will bring the attention of the average Joe (i.e. my own profile) that wants to do just what I did and has only a Mac at reach. Yep, the hint is more specific than could be. I learnt how to do it with OS X by reading guides specific to other OSs.

All the contrary, I think that making the hint's text more universal abstracts it in a way that makes it more difficult to understand and more difficult to come up in search results of non-technical persons.

Edited on May 06, '10 01:38:23PM by elmimmo



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: Anonymous on May 10, '10 06:48:26PM

I guess I was under the impression that people come to this site to learn. Evidently what they want is the answer to "What button do I push?"

Hohum.



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: leamanc on May 11, '10 07:52:37PM

I haven't read the whole thread of responses, just rob's.

But, this is indeed a valid, and good, OS X hint, in that it provides *hints* on how to take an *OS X* installation and do something that it doesn't do out of the box, or isn't readily apparent.

That the end result is installing Ubuntu Linux is not relevant at all. You're using OS X to help accomplish the install, and the hint tells you how to do it. An OS X hint, in my book. And a handy one at that, as I am a fan of network installs for Linux, and Ubuntu doesn't make it readily apparent how to do so. If I can use my other favorite *nix (OS X) to get the job done, I'm happy. :-)



[ Reply to This | # ]
It would be great to see this integrated with OS X vs GNU tools
Authored by: lullabud on May 05, '10 06:07:19PM

Honestly I was looking at doing this exact thing last week, and resorted to using Linux to do it instead because I went the same route of using the GNU/Linux tools. I would be highly interested in seeing this work from an out-of-the-box OSX client install, since I do a lot of server work and installing with CDs and DVDs is lame, but don't always have Xcode (a prerequisite for port) handy.

PS: Don't listen to those folks who say this isn't an OSX hint. It can be an OSX hint and a Linux hint at the same time.

Edited on May 05, '10 06:08:27PM by lullabud



[ Reply to This | # ]
Install Ubuntu Linux over the Internet with the help of a Mac
Authored by: gabester on May 06, '10 07:50:43AM

I definitely appreciate hints like this - oftentimes they stimulate additional comments by talented individuals to make them more applicable to OS X (i.e. using the built-in dhcp and tftp features); I also consider Mac OS X Hints to be a pretty good and reliable source for technical information that has a Mac-specific orientation but certainly includes good advise when there is crossover to other platforms (be they i/Phone/Pod touch/Pad, *nix, or Windows-related.)
g=



[ Reply to This | # ]
Missing step
Authored by: elmimmo on May 06, '10 01:45:55PM

There is one thing missing in the hint.

In the configuration file for dhcp server, there is this line:

next-server X.X.X.101;

101 was the number in my Mac's local IP address.
You should change it according to your own Mac's LAN IP.



[ Reply to This | # ]
Why this *should* be here
Authored by: computergeeksjw on May 11, '10 08:25:23AM

This is a wonderful hint, and to those who think that this hint should not be up here, I say that I have been looking for a way to PXE boot into an Ubuntu install and had no idea my Mac could do that. There are users who don't <b>just</b> use a Mac! Should we remove any hint about how to better integrate with Windows, like how to share printers to a Windows machine, or something like that?



[ Reply to This | # ]
Install Ubuntu Linux over the network with the help of a Mac
Authored by: tobylane on May 13, '10 08:34:09AM

How applicable is this to other things. Can I use Mac and Windows installers, Vm installed images, normal netbooting images? Basically, is this enough to run a thin client of any OS from?



[ Reply to This | # ]
Install Ubuntu Linux over the network with the help of a Mac
Authored by: eexit on Jun 08, '10 06:55:08AM

Nice tip! I did the same last 2 months ago and I wrote an article on my blog which looks very similar.. If you can, guys, understand french, take a look : http://blog.eexit.net/2010/04/installation-dubuntu-avec-pxe-sous-mac.html



[ Reply to This | # ]
Install Ubuntu Linux over the network with the help of a Mac
Authored by: elmimmo on May 01, '12 03:54:08AM

A couple of things to note if this fails:

  • On step 6 dhcpd refuses to run on your Mac stating:

    Can't open lease database /var/db/dhcpd.leases: No such file or directory

    (it happened to me with Lion, but I do not know if some change in it was the cause) create an empty one with this Terminal command:

    $ sudo touch /var/db/dhcpd.leases

    Once you have finished the whole process, you can leave the file there as it is inocuous, but if you had rather delete it to leave everything as it was (only if you got the above error and hence you created it in the first place!), do so with the following Terminal command:

    $ sudo rm /var/db/dhcpd.leases
  • You get an Access violation error on your Linux machine when it attempts to fetch the files from your Mac.

    It may be due to the files you downloaded to your Mac having wrong permissions. To fix that, on step 4., be sure to download the files keeping the original UNIX permissions. Some FTP clients change them to your computer’s defaults upon downloading, which you do not want to happen.

    If you use Cyberduck, go to Settings… > Transfers > Permissions > Downloads and check Change permissions: to permissions of remote file; you can set it back to what it was once the download has completed).

    Cyberduck, even with that setting, did not keep the original file permissions for softlinks. Run the following Terminal command to fix them after downloading:

    $ find /Users/Shared/tftpboot -type l -print0 | xargs -0 chmod -h 777
  • TFTP complains about Unable to locate configuration File on your Linux machine.

    Again Cyberduck was to blame in my case because for some reason it did not download the file ubuntu-installer/i386/pxelinux.cfg/default. So download it to its appropriate folder in your Mac and try again.

Edited on May 01, '12 03:58:54AM by elmimmo


[ Reply to This | # ]