9

I need to install Linux OS on 30 PCs. Is there any way to install from one ISO image with multicast or something like WDS in Microsoft?

I have a Ethernet connection with speed of 100Mb so installing 30 PCs with uni-cast can be very slow.

4
  • It's fast enough to complete the job in one day. Though if you can obtain a gigabit switch you should do so. They are extremely cheap in most parts of the world. – Michael Hampton Jul 1 '20 at 16:29
  • 1
    Install 1 and clone the drives? – Colin 't Hart Jul 1 '20 at 20:34
  • @MichaelHampton If OP is working with a 100Mb/s switch then it's likely they are also working with 100Mb/s NICs. So the actual cost is a 48 port switch (or multiple smaller switches) plus 30 NICs, assuming the hardware permits such an upgrade. In my country the cost would be around £400 (€450 / $500) based on budget components. – JBentley Jul 2 '20 at 9:02
  • Isn't there some way that could be BitTorrented? A reasonably high capacity switch should allow separate 100Mbit communications between 4-5 pairs of PCs at once... – Harper - Reinstate Monica Jul 2 '20 at 19:37
18

What you're looking for is probably PXE:

https://wiki.archlinux.org/index.php/Preboot_Execution_Environment

http://jensd.be/533/linux/create-a-pxe-bootserver-to-server-multiple-linux-distributions

https://www.howtoforge.com/ubuntu_pxe_install_server


In case your LAN is too slow, you could use

Kickstart for Fedora/CentOS/RHEL: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/advanced/Kickstart_Installations/

Fully Automatic Installation: https://fai-project.org/

5
  • but PXE is boot from network and i don't think that PXE works multicast i have an Ethernet connection with 100mb and and installing one by one with PXE can be very slow. – Amir Sabeghi Jul 1 '20 at 7:59
  • @AmirSabeghi - Multiple machines can run off of a single PXE server at the same time. – bta Jul 1 '20 at 22:23
  • PXE (BOOTP/DHCP and TFTP) only deals with the initial boot, which is usually pretty small. The actual installation can use some other protocol. – Roger Lipscombe Jul 2 '20 at 8:13
  • Additionally, Debian has a page for this at wiki.debian.org/PXEBootInstall – Chris J Jul 2 '20 at 19:13
  • thanks, but kickstart is just for automatic installation and use pxe for boot. i don't think this help me in case of network speed problem as I explained in question. – Amir Sabeghi Jul 18 '20 at 4:45
14

You can distribute a Linux installation across the network via multicast using udpcast:

  1. Prepare a Linux installation on one "source" PC.
  2. Boot a live Linux on all PCs via any method you like.
  3. Invoke udp-sender /dev/sda on the source PC.
  4. Invoke udp-receiver /dev/sda on all target PCs.
  5. Initiate transfer at the source PC.
  6. Go have a tea.

After the transfer has finished, all PCs have a usable Linux installation.

In detail, there are several approaches to this.

Having a live Linux running on all PCs is the most irritating part. Many people recommend https://fogproject.org/ for PXE, but it needs a dedicated server I just had not handy. I eventually resorted to a custom Tiny Core Linux distributed via PXE. For your first rodeo, you can also go around and boot a live Linux from a USB drive. All you need is something that comes with udp-sender and udp-receiver (in Ubuntu, it is in the udpcast package).

The distribution process itself can be sped up significantly by not cloning the entire hard-drive, but rather individual partitions and a quick compression like gz -2. If you happen to have a server, you can also store an image of the target's file-system with a designated file-system cloning tool like e2image -ra. The commands would then be something like

udp-sender image.ext4.gz
udp-receiver | gzip -d > /dev/sda1

With this method, I clone Ubuntu (and Windows) to a couple of rooms full of PCs at a school. The speed is impressive.

5
  • 4
    Aren't there a bunch of stuff that's (normally) unique for each installation eg. ssh server key? – Oskar Skog Jul 1 '20 at 9:15
  • 6
    @OskarSkog Indeed, the hostname and SSH host key should be unique. However, this is "only" to avoid confusion and improve security. It is not a hard necessity. You can totally have 30 machines on the network with the same SSH host key and still connect to all of them. The locally configured hostname is not important for most applications. Both hostname and key can be changed after distributing. – Hermann Jul 1 '20 at 9:36
  • 2
    @OskarSkog It's possible to have the cloned image set up to perform some first-boot actions. Whether you do so or not would depend on your requirements. – Bob Jul 1 '20 at 19:16
  • If you're compressing just as a one-off, lzop or lz4 are pretty good if you're not sure gzip -2 will finish while you're reading docs and getting ready to actually try something. (But gzip is likely to be already installed in any bootable image; lz4 or lzop might not be.) – Peter Cordes Jul 2 '20 at 21:29
  • @hermann be aware that any of the machines can decrypt ssh communications sent to any of the clones since they all have the same description key, and it's not uncommon to send user passwords to an ssh host. i believe there is a script to regenerate ssh host keys, so suggests ssh-keygen -A may work. also generating lots of private keys on clones may be a bad idea, especially if it's not on bare metal (possible parallel construction) – ThorSummoner Jul 7 '20 at 18:16
3

You can use
RedHat's Kickstart,
FAI - Fully Automatic Installation
Spacewalk (based on RedHat's satellite)

and other solutions available.

1

Replicate the ISO 1->2->4->8, so taking 3 copy times and 4 install times when in parallel.

1
  • Reasonable work around but not quite "over the wire" – bu5hman Jul 1 '20 at 17:16
0

I'd go with nc and a minimal img.gz, then run a script to expand the partition/fs, and regen the keys, hostname.

https://serverfault.com/a/315564/254756

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.