sudo virt-install \
–name ubuntu24 \
–vcpus 2 \
–memory 4096 \
–disk size=20,format=qcow2 \
–cdrom /var/lib/libvirt/images/ubuntu-24.04-live-server-amd64.iso \
–os-variant ubuntu24.04 \
–network bridge=br0 \
–graphics none \
–console pty,target_type=serial \
–extra-args ‘console=ttyS0,115200n8’
Option | Meaning |
---|---|
--name ubuntu24 | Name of the VM |
--vcpus 2 | Number of virtual CPUs |
--memory 4096 | RAM in MB (here: 4 GB) |
--disk size=20 | Create a 20 GB virtual disk |
--cdrom | Path to the Ubuntu Server ISO |
--os-variant ubuntu24.04 | Optimize for Ubuntu 24.04 (use osinfo-query os to list all) |
--network bridge=br0 | Attach VM to bridge br0 (or use network=default for NAT) |
--graphics none | No GUI; text-only (suitable for SSH sessions) |
--console pty,target_type=serial | Enable serial console for TUI installer |
--extra-args 'console=ttyS0' | Redirect installer output to the serial console |
KVM: Install Ubuntu Server 24.04