5 ms·
libvirt ships with virt-install which also allows for quickly creating and auto-installing Windows and many Linux distributions. I haven't tried it with mac. H
by steve_rambo 3y ago
libvirt ships with virt-install which also allows for quickly creating and auto-installing Windows and many Linux distributions. I haven't tried it with mac.
Here's a recent example with Alma Linux:
$ virt-install --name alma9 --memory 1536 --vcpus 1 --disk path=$PWD/alma9.img,size=20 --cdrom alma9.iso --unattended
Then you go for a coffee, come back and have a fully installed and working Alma Linux VM. To get the list of supported operating systems (which varies with your version of libvirt), use:
$ osinfo-query os
- deleted 3y ago[deleted]
- mrAssHat 3y agoIt is not obvious what the result of this would be. What hostname will it have? How will the disk be partitioned? What packages will be installed? What timezone will be set? What keyboard layout will be set? And so on.
- serf 3y agovirt-install can be given all of those parameters as arguments[0], too; parent just didn't post an obnoxiously large shell line to demonstrate. [0]: https://linux.die.net/man/1/virt-install https://linux.die.net/man/1/virt-install
- JamesonNetworks 3y agoTo do this I had to install libosinfo-bin
- rwmj 3y agoAlso $ virt-builder fedora-39 if you wanted a Fedora 39 disk image. (Can be later imported to libvirt using virt-install --import).
- stefanha 3y agovirt-builder is awesome for quickly provisioning Linux distros. It skips the installer because it works from template images. You can use virt-builder with virt-manager (GUI) or virt-install (CLI).
- presto8 3y agoDoes virt-install automatically download the ISOs? When I try it, I get the following message: $ virt-install --name alma9 --memory 1536 --vcpus 1 --disk path=$PWD/alma9.img,size=20 --cdrom alma9.iso --unattended ERROR Validating install media 'alma9.iso' failed: Must specify storage creation parameters for non-existent path '/home/foo/alma9.iso'.