Cloud-Init Ubuntu VM Installation

Proxmox VM setup

Table of contents

  1. Background: Cloud-Init Server install using tteck’s Proxmox VE Helper script
  2. Run tteck’s Ubuntu 24.04 installation script
  3. Fill in Cloud-Init Data
    1. Click on   Cloud-Init  in the VM’s vertical middle menu bar
    2. Fill in the Cloud-Init settings
  4. Resize the bootdisk (/dev/sda)
  5. Expand the VM disk partition to use the new space
  6. Enable SSH
  7. Add QEMU Guest Agent
  8. Install files required for iGPU hardware passthrough
  9. Next Step: GPU Hardware Passthrough

Background: Cloud-Init Server install using tteck’s Proxmox VE Helper script

I have found tteck’s Cloud-Init server installation method to be much faster than doing a manual Ubuntu installation. The only “gotcha” is in the warning below!

For iGPU passthrough, the required files in linux-generic are NOT part of the Ubuntu Cloud-Init distribution used by the tteck Ubuntu installation script.

That means we have to remember to load them using sudo apt install sudo linux-generic after starting the VM for the first time. So follow these instructions to the end of this page!

Do

Run tteck’s Ubuntu 24.04 installation script

We are going to run tteck’s Ubuntu 24.04 script found at https://community-scripts.github.io/ProxmoxVE/scripts?id=ubuntu2404-vm

Run tteck scripts from the Proxmox GUI shell, not SSH!

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/vm/ubuntu2404-vm.sh)"

DO NOT START the VM until after you do the following Cloud-Init setup steps below! ⬇

Fill in Cloud-Init Data

In the steps below, we are going to follow most of tteck’s detailed Cloud-Init setup instructions at https://github.com/community-scripts/ProxmoxVE/discussions/272.

If you prefer to use tteck’s steps above, STOP at the “Install Docker” step.

We will install Docker later using Anand’s excellent SimpleHomelab Deployarr application.

Click on   Cloud-Init  in the VM’s vertical middle menu bar

images

Fill in the Cloud-Init settings

  1. Set user to root
  2. Give root user a password
  3. Set to No (not enough storage, yet)
  4. Set network settings (IP/CIDR and gateway)
  5. Click  Regenerate Image 

    images

  6. It is now OK to click  ▶ Start  to start the VM!

Resize the bootdisk (/dev/sda)

This resizes the boot disk but does not allocate it to the VM. We will use parted to do that later.

  1. Select   xterm.js   under the VM’s top nav bar   Console   pull down button for copy/paste functions
  2. Open the   Resize   screen and enter the size increase you want

      Hardware    Hard Disk (scsi0)    Disk Action    Resize  

images

Expand the VM disk partition to use the new space

Type these steps in the xterm.js console:

  1. Run parted:

     parted /dev/sda
    
  2. Answer the parted prompts as they appear:

    (parted) resizepart 1

    Fix/Ignore? Fix

    Partition number? 1

    Yes/No? Yes

    End? [2146MB]? -0

    (parted) quit

  3. Then reboot:

     reboot
    

Enable SSH

sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' -e 's/^PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
rm /etc/ssh/sshd_config.d/60-cloudimg-settings.conf
systemctl restart ssh

Add QEMU Guest Agent

apt-get update && apt-get -y upgrade
apt-get install -y qemu-guest-agent

Install files required for iGPU hardware passthrough

Be sure to do this step or iGPU HW passthrough from Proxmox to your new VM will not work!

sudo apt install sudo linux-generic
reboot

Next Step: GPU Hardware Passthrough

If you have GPU Passthrough implemented on your Proxmox VE bare metal server and want to use it in this VM, follow the Proxmox GPU Passthrough: VM Setup instructions in this doc.