<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>libvirt on My notes</title><link>https://flunka.github.io/tags/libvirt/</link><description>Recent content in libvirt on My notes</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 25 Dec 2023 02:15:17 +0100</lastBuildDate><atom:link href="https://flunka.github.io/tags/libvirt/index.xml" rel="self" type="application/rss+xml"/><item><title>Create Virsh Ubuntu VM</title><link>https://flunka.github.io/posts/create-virsh-ubuntu-vm/</link><pubDate>Mon, 25 Dec 2023 02:15:17 +0100</pubDate><guid>https://flunka.github.io/posts/create-virsh-ubuntu-vm/</guid><description>Download qcow image Download qcow image from Ubuntu repo
Resize image qemu-img info ubuntu.img qemu-img resize ubuntu.img 20G #or qemu-img resize ubuntu.img +10G Create user-data and meta-date for cloud-init Users are created on the first boot, so it impossible to change password/ssh key after first boot.
To create password hash use following command: mkpasswd --method=SHA-512 --rounds=4096
user-data
#cloud-config users: - name: ubuntu ssh_authorized_keys: - ssh-rsa AAAAB3...asdf root@localhost sudo: &amp;#39;ALL=(ALL) NOPASSWD:ALL&amp;#39; groups: sudo shell: /bin/bash - name: ubuntu2 lock_passwd: false passwd: &amp;lt;password-hash&amp;gt; sudo: &amp;#39;ALL=(ALL) NOPASSWD:ALL&amp;#39; groups: sudo shell: /bin/bash meta-data</description></item></channel></rss>