Skip to content

Instantly share code, notes, and snippets.

@richardweinberger
Last active August 26, 2024 18:34
Show Gist options
  • Save richardweinberger/603154713fe4bb9aa986ad78be8055d4 to your computer and use it in GitHub Desktop.
Save richardweinberger/603154713fe4bb9aa986ad78be8055d4 to your computer and use it in GitHub Desktop.
Fastest QEMU VM setup
$ wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.raw
$ qemu-system-x86_64 -M pc,accel=kvm -m 1G \
-drive file=./debian-12-nocloud-amd64.raw,if=virtio \
-netdev type=user,hostfwd=tcp::5573-:22,id=net0 \
-device virtio-net,netdev=net0 -rtc base=localtime -smp 4 \
-nographic
# login with user 'root'
VM$ apt update && apt install openssh-server
VM$ echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/root_login.conf
VM$ systemctl restart sshd
# set root password
VM$ passwd
$ ssh root@localhost -p 5573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment