Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Install QEMU in Ubuntu/Fidora/Kali Linux (With Secure boot enabled)
- ##################################################################
- JOIN US ON TELEGRAM FOR MORE AND DETAILED CLASSES
- VISIT OUR TELEGRAM PROFILE: https://t.me/LinuxClassesEFXTv
- ##################################################################
- STEP 1: Update the System
- sudo apt update && sudo apt upgrade -y
- STEP 2: Install QEMU
- sudo apt install qemu-system-x86 qemu-utils libvirt-daemon libvirt-clients bridge-utils virt-manager -y
- STEP 3: Verify Installation
- qemu-system-x86_64 --version
- STEP 4: Enable and Start Services
- sudo systemctl enable --now libvirtd
- sudo systemctl start libvirtd
- STEP 5: Create HDD.qcow2
- mkdir ~/qemu ; qemu-img create -f qcow2 ~/qemu/fedora_disk.qcow2
- Step 6: Install ISO in ~/qemu/fedora_disk.qcow2 (HDD.qcow2)
- qemu-system-x86_64 \
- -boot d \
- -cdrom /home/demo/Downloads/Fedora-Xfce-Live-x86_64-41-1.4.iso \
- -m 5048 \
- -enable-kvm \
- -drive file=~/qemu/fedora_disk.qcow2,format=qcow2
- STEP 6: Start VM. Things you can modify
- # -m = RAM / memory
- # cpus = Number of cpu
- # snapshot = off/on (off menans on, on means off)
- qemu-system-x86_64 -boot c -m 4048 -enable-kvm -smp cpus=2 \
- -drive file=~/qemu/fedora_disk.qcow2,format=qcow2,if=virtio,snapshot=off \
- -device virtio-net,netdev=net0 -netdev user,id=net0 \
- -monitor unix:/tmp/qemu-monitor-socket,server,nowait
- STEP 7: Start with Full screen
- # sudo dnf install virt-viewer
- # sudo dnf install remote-viewer
- # remote-viewer spice://localhost:5900
- # or
- # change the Display size in QEMU virtual MACHINE
- qemu-system-x86_64 -boot c -m 4048 -enable-kvm -smp cpus=2 \
- -drive file=~/qemu/fedora_disk.qcow2,format=qcow2,if=virtio,snapshot=off \
- -device virtio-net,netdev=net0 -netdev user,id=net0 \
- -monitor unix:/tmp/qemu-monitor-socket,server,nowait \
- -spice port=5900,disable-ticketing=on -device virtio-vga
- STEP 8: Connect Screen with remote-viewer
- remote-viewer spice://localhost:5900
- STEP 9: Snapshots
- # Start vm using (Step 6)
- # Ensure that snapshot=off in the commands
- # Open new terminal and paste command
- # Use the command to get in to (qemu) shell and follow step 10
- nc -U /tmp/qemu-monitor-socket
- STEP 10: How to use Qemu Shell to save/load/delete/list snapshot?
- (qemu) savevm snapshot_name # Use command to save Snapshot
- (qemu) loadvm snapshot_name # To load Snapshot
- (qemu) info snapshots # To list all Snapshots
- (qemu) delvm snapshot_name # Delete snapshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement