Skip to content

Instantly share code, notes, and snippets.

@LincolnBryant
Last active November 10, 2015 07:05
Show Gist options
  • Save LincolnBryant/a115ba20421be734e277 to your computer and use it in GitHub Desktop.
Save LincolnBryant/a115ba20421be734e277 to your computer and use it in GitHub Desktop.

the libvirt netinstall bargain bonanza!

I think in my ideal world, I'd have unlimited hardware to install every quirky Linux or UNIX distro under the Sun. Since I don't live in that glorious fantasy realm, I've taken to virtualizing pretty much everything lately. One of the things that irritates me about that approach, though, is that I have to download a relatively fat ISO in order to get at a fairly small installer and bootstrap my shiny new OS.

However, all is not lost! libvirt's virt-install tool has a handy --location flag that lets you specify an http/ftp server and pull down the netinstall media without any pesky install media ISOs. Below is an example that will create a machine with 4 CPUs, 4GB RAM, using a disk image called centos-7.img. See qemu-img(1) for more information on creating disk images.

virt-install -r 4096 -n debian-8 -f debian-8.img --vcpus=4 --location
ftp://ftp.debian.org/debian/dists/jessie/main/installer-amd64/ --os-type=linux
--extra-args='console=tty0 console=ttyS0,115200n8'

As you can see above, there's also a needed --extra-args flag in order to get a console for the installer.

For you, dear reader, I've gone on an epic quest (man virt-install and Google)
to create perhaps the most complete list of install paths KNOWN TO MAN. Mind you
I've more-or-less only selected LTS or latest releases here. So, without further
ado, here's the netinstall super list in copy-pasta format:

Distro Version --location
Debian 8 (Jessie) ftp://ftp.debian.org/debian/dists/jessie/main/installer-amd64/
Debian 7 (Wheezy) ftp://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/
Ubuntu 14.04 (Trusty) http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/
Ubuntu 15.10 (Wily) http://archive.ubuntu.com/ubuntu/dists/wily/main/installer-amd64/
Fedora 23 http://dl.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/os/
Scientific 7.1 ftp://ftp.scientificlinux.org/linux/scientific/7.1/x86_64/os/
Scientific 6.7 ftp://ftp.scientificlinux.org/linux/scientific/6.7/x86_64/os/
SUSE 13.2 http://download.opensuse.org/distribution/13.2/repo/oss/
SUSE Leap http://download.opensuse.org/distribution/leap/42.1/repo/oss/
CentOS 7 http://mirror.centos.org/centos/7/os/x86_64/
CentOS 6.7 http://mirror.centos.org/centos/6.7/os/x86_64/

Thanks for being awesome, libvirt.

Before you ask, yes I'm aware of Docker, and no I'm not interested in using it. Actually most of my fun-time work recently has been in the container space, and using Docker to implement other container-y things seems like a huge headache waiting to happen. I'll never be a cool kid at this rate :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment