Skip to main content

Tạo Cloud Image Ubuntu cho Proxmox Node

Download Current Ubuntu Cloud Image:

wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img

Tạo new virtual machine:

8000: là Virtual Machine Id trên proxmox
ubuntu-cloud: là tên của vm 

qm create 8004 --memory 8192 --core 4 --name ubuntu-cloud --net0 virtio,bridge=vmbr0

Import disk vào local-lvm storage

qm importdisk 8004 jammy-server-cloudimg-amd64.img local-lvm

Attach the new disk to the vm as a scsi drive on the scsi controller

qm set 8004 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-8004-disk-0

8004: là vmid của cloud image. ở trên có 2 id 8004 cần sửa.

Add cloud init drive

qm set 8004 --ide2 local-lvm:cloudinit

Make the cloud init drive bootable and restrict BIOS to boot from disk only

qm set 8004 --boot c --bootdisk scsi0

Add serial console

qm set 8004 --serial0 socket --vga serial0

Create template.

qm template 8004

Clone template.

qm clone 8004 135 --name yoshi --full
  • 135 là id mới
  • 8004 là vmid của cloud image

Scale disk

qm resize 135 scsi0 +45G

Setting Up Ubuntu VM:

https://technotim.live/posts/fist-13-things-linux/

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

sudo dpkg-reconfigure --priority=low unattended-upgrades

sudo nano /etc/ssh/sshd_config

PasswordAuthentication no
ChallengeResponseAuthentication no

sudo nano /etc/systemd/timesyncd.conf

[Time]
NTP=192.168.1.1

Disable root login:

sudo passwd -l root