# QEMU CheatSheet ## Usando um arquivo ISO ### Criando uma VM ``` qemu-img create -f qcow2 ~/.vm/freebsd-14 25G ``` ### Instalando o FreeBSD na VM ``` qemu-system-x86_64 \ -m 2G \ -smp 2 \ -cdrom FreeBSD-14.0-RELEASE-amd64-disc1.iso \ -boot order=d \ -drive file=~/.vm/freebsd-14,format=qcow2 ``` ### Rodando o sistema ``` qemu-system-x86_64 \ -m 2G \ -smp 2 \ -vnc none \ -enable-kvm \ -machine q35 \ -device intel-iommu \ -cpu host \ -net nic \ -net user,hostfwd=tcp::2200-:22 \ ~/.vm/freebsd-14 ``` ## Usando imagens qcow2 prontas do FreeBSD ``` xz --decompress FreeBSD-14.0-RELEASE-amd64-zfs.qcow2.xz qemu-system-x86_64 \ -hda FreeBSD-14.0-RELEASE-amd64-zfs.qcow2 \ -m 2G \ -smp 2 \ -net nic \ -net user,hostfwd=tcp::2200-:22 ``` ## Conectando a VM ``` ssh -p 2200 root@localhost ``` ## ReferĂȘncias - [https://wiki.archlinux.org/title/QEMU](https://wiki.archlinux.org/title/QEMU#Running_virtualized_system) - [QEMU CheatSheet](https://wangziqi2013.github.io/article/2022/03/09/qemu-cheat-sheet.html) - [https://gist.github.com/jtpaasch/cb7da88c890a002ab3ae464ca98c7445](https://gist.github.com/jtpaasch/cb7da88c890a002ab3ae464ca98c7445)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up