This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
computing:preseed [2024/02/17 17:50] – oemb1905 | computing:preseed [2024/02/17 17:52] – oemb1905 | ||
---|---|---|---|
Line 31: | Line 31: | ||
After getting the virt-install recipe and config to perform the desired Debian install, my next task was to automate all of this with a simple script that would create a virtual hard disk of any desired size and a libvirt entry with my desired naming convention in my production VM directory. Here's what I came up with: | After getting the virt-install recipe and config to perform the desired Debian install, my next task was to automate all of this with a simple script that would create a virtual hard disk of any desired size and a libvirt entry with my desired naming convention in my production VM directory. Here's what I came up with: | ||
- | echo -n " | + | |
+ | | ||
read hostname | read hostname | ||
- | echo -n "How large (in GB) would you like the virtual hard disk to be?" | + | echo -n "How large (in GB) would you like the virtual hard disk to be? " |
read size | read size | ||
qemu-img create -f qcow2 / | qemu-img create -f qcow2 / | ||
sleep 2s | sleep 2s | ||
- | echo "Okay, I am now creating the preseed.cfg file for your host …" | + | |
- | mkdir / | + | read ip |
- | cp -ar / | + | sleep 2s |
- | rpl -w " | + | |
- | rpl -w " | + | mkdir / |
+ | cp -ar / | ||
+ | rpl -w " | ||
+ | rpl -w " | ||
+ | rpl -w " | ||
+ | sleep 2s | ||
+ | echo " | ||
sleep 2s | sleep 2s | ||
- | echo " | ||
virt-install --name=${hostname}.qcow2 \ | virt-install --name=${hostname}.qcow2 \ | ||
| | ||
| | ||
| | ||
- | | + | |
| | ||
| | ||
| | ||
| | ||
- | | + | --network bridge: |
+ | --initrd-inject /mnt/vms/ | ||
For now, I just need really simple Debian VMs as quickly as possible. However, as I wrote this, I began to realize that I could easily expand this script to meet the needs of a variety of different use cases, could add conditionals to it, validation and more. Down the road, I plan to do that, and you can stay up to date with how I expand this script' | For now, I just need really simple Debian VMs as quickly as possible. However, as I wrote this, I began to realize that I could easily expand this script to meet the needs of a variety of different use cases, could add conditionals to it, validation and more. Down the road, I plan to do that, and you can stay up to date with how I expand this script' |