-
-
Save mpoullet/c834367827a60c1739fe0c12eba89194 to your computer and use it in GitHub Desktop.
Fastest QEMU VM setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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