Hey you- read completely before u directly start to follow.
Install packages-
-
virt-manager
(GUI to manage VM) -
libvirtd
(handler for VM’s such as qemu, xen, virsh, kvm, and so on) -
QEMU
(a virtual machine emulator)
extras
there are some extra packages which might come in handy if virt manager is upset with you-
-
ebtables
(if u are getting prompt that this package conflicts with iptables, just type y and replace iptables with this.) -
dnsmasq
(provides DNS server)
*just install them manually if u face errors later
If you don’t know how to install
Debian based- sudo apt install qemu
(other packages come as dependens)
Arch - sudo pacman -S virt-manager libvirtd qemu
Configurations (run these commands in terminal)
-
add libvirtd as a daemon and run at boot
-
sudo systemctl start libvirtd
-
sudo systemctl enable --now libvirtd
-
set virsh
(to avoid network errors) -
sudo virsh net-start default
-
6.sudo virsh net-autostart default
All set!
Reboot
and
launch virt-manager
from dmenu/rofi or whatever you use (if nothing then launch a terminal and type virt-manager
and hit enter) Voila!
This is for people who wanna try harder and use command line instead,
this will provide no GUI unless u install virt-manager separately.
-
install
qemu
-
create a disk file for ur new system
qemu-img create -f raw <any name like diskfile/vmfile> <number of storage in gb for vm >G
–
*if u created less, and wanna increase ur image size
qemu-img resize <file name created earlier> +<number u wanna increase in gb>G
like -qemu-img resize diskfile +10G
same applies for reducing the filesize- replace the+
sign with-
sign. -
Converting to other formats (optional)
qemu-img convert -f raw -O qcow2 <filename>.img <newname>.<newformat>
*the iso image u going to use shouldn’t be mounted. if this is the case, first unmount it. -
Installing the OS (not using-1st we had to install to the disk we created)
qemu-system-x86_64 -cdrom <path/to/iso> -boot order=d -drive file=<diskname from step 2>,format=raw -m <amount of memory in mb u want to allocate>M
–
*Instead of-boot order=x
, use-boot menu=on
, if u want GUI installation medium instead of CLI -
Running the virtual system we installed
qemu-system-x86_64 <diskname>
DONE
Note! - If the VM grabs your mouse pointer use Ctrl+Alt+g
to release it otherwise your mouse might be trapped in the VM!