-
Notifications
You must be signed in to change notification settings - Fork 0
Armbian_Build_Tipps
Vault2501 edited this page Sep 21, 2022
·
3 revisions
-
Resize image
qemu-img resize ubuntu-22.04-server-cloudimg-amd64.img +30G modprobe nbd qemu-nbd -c /dev/nbd0 ubuntu-22.04-server-cloudimg-amd64.img parted -> resizepart 1 34.5GB -> quit qemu-nbd -d /dev/nbd0
-
Add password entry to image
This will set the root password to 'ubuntu'
mkdir /tmp/mnt guestmount -a ubuntu-22.04-server-cloudimg-amd64.img -i /tmp/mnt sed -i 's/^root:\*/root:\$6\$oaTfTxnE\.4IDa1F9\$vkTjwFPGcdRdhm8JL0iz0Ts6dLWglzQWHIieRvc6Q\/bopx5EFSL7DkHrS1l8RYR9YmEaIesJt6cuwu8AkCNRX1/' /tmp/mnt/etc/shadow guestunmount /tmp/mnt
-
Enable network and resize ext4 to new image size
netplan set ethernets.enp1s0=true resize2fs /dev/vda1
-
Install ssh and create host key
apt-get install ssh ssh-keygen -A systemctl restart ssh