Install DietPi on Proxmox BASH script

I made a basic script that installs DietPi on proxmox as i use it for lots of VM’s. This just helps get it booted up and online quicker.

Git Repo GitHub - dazeb/proxmox-dietpi-installer: A Proxmox Helper Script to install DietPi in Proxmox

The installer just needs to know where to store the VM disk. The rest is automatic.

1 Like

Ping @StephanStS @HolgerTB as you both use Proxmox quite heavily :slight_smile:

1 Like

I have tested the script. After make it executable I could run the script.

But the RAM was 512 MB, CPU only 1 core. As far as I can see in the script the variable RAM=$ and CORES=$ are not used when creating the vm.

I added these lines to the script and it worked:

qm set $ID --cores “$CORES”
qm set $ID --memory “$RAM”

Maybe there are some things to add to improve the script:

  • ability to enter the Proxomox VM ID
  • ability to provide a VM Name

And it would be perfect!

Thanks for sharing!!

3 Likes

I have made some templates for my environment:
CPU, RAM, disk size as well as regional settings, disable IPv6 in my VMs etc set. Made all updates and then converted it to a template for further cloning.
Did this for a headless and two GUI based machines.

But your script is a nice starter for using the VMs initially.

I also am working at a LXC DietPi container. I generate them with a script from a VM.

1 Like

thanks, yea its just a starter script really, everything is commented so that it should be easily editable by beginners.

When you run the script it will now ask you for how much RAM and how many cores.

Default values for RAM and CPU set at 2048MB and x2 cores.

Thanks for testing!

2 Likes

Great, but your script is still missing the qm set commands:

qm set $ID --net0 “virtio,bridge=vmbr0”
qm set $ID --scsi0 “$STORAGE:vm-$ID-disk-0”
qm set $ID --boot order=‘scsi0’
qm set $ID --scsihw virtio-scsi-pci

you need to add
qm set $ID --cores “$CORES”
qm set $ID --memory “$RAM”

1 Like

Wow i can’t believe i missed that, i removed it while testing as initially i had the ram and cores set as a variable

RAM=1024
CORES=2

I used a oneliner qm create at first to create the machine but that didn’t work out without errors.

It’s now fixed with the qm set $ID --cores “$CORES” and qm set $ID --memory “$RAM”

Thanks again!

1 Like

The script has been updated with patch 2 with some help from @MichaIng.

Thank you!

2 Likes