# Install DietPi on Proxmox BASH script

**URL:** https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679
**Category:** Community Tutorials
**Created:** [21 January 2023 23:26 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679 "2023-01-21T23:26:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [21 January 2023 23:26 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/1 "2023-01-21T23:26:54Z")

</div>

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](https://github.com/dazeb/proxmox-dietpi-installer)

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

EDIT: The script has now been updated to support more storage pools including BTRFS and ZFS.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [22 January 2023 09:04 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/2 "2023-01-22T09:04:40Z")

</div>

Ping @StephanStS @HolgerTB as you both use Proxmox quite heavily 🙂

---

<div class="post-metadata">

### Author: ![HolgerTB](https://dietpi.com/forum/user_avatar/dietpi.com/holgertb/32/106_2.png) [@HolgerTB](https://dietpi.com/forum/u/HolgerTB)
#### Post date: [22 January 2023 15:20 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/3 "2023-01-22T15:20:31Z")

</div>

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!!

---

<div class="post-metadata">

### Author: ![StephanStS](https://dietpi.com/forum/user_avatar/dietpi.com/stephansts/32/2522_2.png) [@StephanStS](https://dietpi.com/forum/u/StephanStS)
#### Post date: [23 January 2023 11:53 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/4 "2023-01-23T11:53:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [23 January 2023 14:09 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/5 "2023-01-23T14:09:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [23 January 2023 14:14 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/6 "2023-01-23T14:14:48Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![HolgerTB](https://dietpi.com/forum/user_avatar/dietpi.com/holgertb/32/106_2.png) [@HolgerTB](https://dietpi.com/forum/u/HolgerTB)
#### Post date: [23 January 2023 15:33 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/7 "2023-01-23T15:33:34Z")

</div>

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”

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [23 January 2023 16:01 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/8 "2023-01-23T16:01:21Z")

</div>

> [@HolgerTB](#):
>
> qm set $ID --cores “$CORES”  
> qm set $ID --memory “$RAM”

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

```auto
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!

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [15 February 2023 16:26 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/9 "2023-02-15T16:26:33Z")

</div>

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

Thank you!

---

<div class="post-metadata">

### Author: ![fow0ryl](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/df788c/32.png) [@fow0ryl](https://dietpi.com/forum/u/fow0ryl)
#### Post date: [25 August 2023 22:02 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/10 "2023-08-25T22:02:14Z")

</div>

Did not work for me on PVE 7.4-3 …

I have to change this line

```auto
qm set "$ID" --scsi0 "$STORAGE:vm-$ID-disk-0"

```

to

```auto
qm set "$ID" --scsi0 "$STORAGE:$ID/vm-$ID-disk-0.raw"

```

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [26 August 2023 08:01 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/11 "2023-08-26T08:01:43Z")

</div>

Thanks for letting us know, I’ll test and update the script today.

EDIT:  
Currently tested for 7.4-16 all working as expected. Pls make sure to type your storage name when asked. eg,

 ![783980a1cb59ac5f28b0484ef5ae6f52](https://dietpi.com/forum/uploads/default/original/2X/7/7a2b360283c33e09dbefaed514a59b2dd11d5083.png)

---

<div class="post-metadata">

### Author: ![fow0ryl](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/df788c/32.png) [@fow0ryl](https://dietpi.com/forum/u/fow0ryl)
#### Post date: [3 September 2023 12:36 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/12 "2023-09-03T12:36:22Z")

</div>

Of course I had typed the correct storage name. With empty or incorrect storage name I got other errors.  
Maybe that the underlaying filesystem makes a difference. I’m using BTRFS-Raid-0 for performance reasons on my SSD’s. I would prefer ZFS over BTRFS. But it is very very slow on my hardware. So I decided to use ZFS-Raid with HDD’s only.

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [3 September 2023 17:11 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/13 "2023-09-03T17:11:17Z")

</div>

I get what you’re saying now, I will see if I can add BTRFS. Maybe by asking the user which filesystem type to store as the storage variable. Apologies for the confusion and thanks for letting me know I’ll get on it as soon as possible.

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [3 September 2023 17:46 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/14 "2023-09-03T17:46:10Z")

</div>

I have added an option to use BTRFS, please could you switch to the testing branch on github and try that version and let me know how it goes as I cannot test BTRFS filesystem right now.

> **[GitHub - dazeb/proxmox-dietpi-installer at testing](https://github.com/dazeb/proxmox-dietpi-installer/tree/testing)**
>
> testing

---

<div class="post-metadata">

### Author: ![fow0ryl](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/df788c/32.png) [@fow0ryl](https://dietpi.com/forum/u/fow0ryl)
#### Post date: [5 September 2023 11:07 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/15 "2023-09-05T11:07:18Z")

</div>

@dazeb  
Works perfect 🙂

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [6 September 2023 14:28 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/16 "2023-09-06T14:28:30Z")

</div>

Sweet, thanks for getting back to me.

Hopefully ill get the changes moved to the main branch soon.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [6 September 2023 17:57 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/17 "2023-09-06T17:57:57Z")

</div>

Does anyone know whether this naming scheme is the same for mdadm RAIDs? And in case of Btrfs it is probably only when using its RAID/volume features but not when just formatting a single drive with a single Btrfs partition, is it?

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [6 September 2023 19:01 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/18 "2023-09-06T19:01:22Z")

</div>

@MichaIng looking into this

---

<div class="post-metadata">

### Author: ![g1gop](https://dietpi.com/forum/user_avatar/dietpi.com/g1gop/32/4603_2.png) [@g1gop](https://dietpi.com/forum/u/g1gop)
#### Post date: [8 September 2023 17:23 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/19 "2023-09-08T17:23:38Z")

</div>

New to this (dietpi) tried the script and on #proxmox 8.0.4 and it says all ok but when the vm starts, it crashes.

 ![Screenshot from 2023-09-08 18-19-14](https://dietpi.com/forum/uploads/default/original/2X/c/c52bdb67ee0911135494eb6329c504ea4cd9f3e9.png)  
Any ideas?

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [8 September 2023 17:27 UTC](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679/20 "2023-09-08T17:27:17Z")

</div>

What filesystem are you installing DietPi on? Are you using BTRFS, RAID, Thin Provisioning etc?

To be honest I never even thought of Proxmox 8 yet lol maybe they changed some stuff ill look into it.

[Next page](https://dietpi.com/forum/t/install-dietpi-on-proxmox-bash-script/15679.md?page=2)
